Fiber Payment Gateway for Agent Backends

Spindle provides authentication, scope enforcement, and audit reconciliation for automated payments on CKB. A narrow control layer built for Fiber testnet operations.

Status
Testnet Ready
Rail
Fiber Network
Target
Agent Ops
GATEWAY_INSPECTOR // SEEDED_TRACE
AGENT_ID: SPND_PROV_01
OWNERSHIP_CHECK
Invoice belongs to the authenticated tenant
POLICY_EVALUATION
Policy approves the request
CONCURRENCY_CHECK
Invoice claimed for processing
CONFIRMATION
Payment confirmed and audited
POST /api/v1/payments
{
"agent_id": "spnd_prov_01",
"invoice_id": "fibt_100234...",
"amount": 50.00,
"policy_check": "PASSED",
"fiber_node": "03abc...f12",
}
// RESPONSE_PAYLOAD
{
"status": "SETTLED",
"payment_hash": "0x789...abc",
"settled_at": "2026-04-22T14:30:02Z",
}
SCHEMA: V1_CORE
REGION: CKB_TESTNET_SECURE
PARITY: 100%

A gateway is a control boundary.

CONTROL
ID: SPND_CONTROL_01

Implicit vs. Explicit

Agent backends should not talk to Fiber directly. Spindle makes every automated intent explicit and auditable before execution.

LOGICAL_PROOF
EXPLICIT(intent) => AUDIT(intent) => EXECUTE;
BOUNDARY
ID: SPND_BOUNDARY_01

Narrow Gateway

We are not a proof platform. We are a policy-enforcement gateway for Fiber testnet. Authority through constraint, not scope creep.

LOGICAL_PROOF
IF (scope == 'testnet') THEN PROCEED ELSE BLOCK;
LOGIC
ID: SPND_LOGIC_01

Real Reconciliation

The gateway reconciles local state with Fiber RPC reality, recovering stale processing records into final technical outcomes.

LOGICAL_PROOF
RECONCILE(local_state, rpc_reality) => UPDATE;

Request Lifecycle

STAGE_01
Authentication

API key validation and route-level scope enforcement.

INPUT
TENANT_CTX + REQ_BODY
OUTPUT
AUDIT_ROW + NEXT_STATE
STAGE_02
Ownership

Tenant-scoped isolation for all payment records.

INPUT
TENANT_CTX + REQ_BODY
OUTPUT
AUDIT_ROW + NEXT_STATE
STAGE_03
Policy

Spend limits and recipient allowlist verification.

INPUT
TENANT_CTX + REQ_BODY
OUTPUT
AUDIT_ROW + NEXT_STATE
STAGE_04
Execution

Fiber RPC calls against owned testnet nodes.

INPUT
TENANT_CTX + REQ_BODY
OUTPUT
AUDIT_ROW + NEXT_STATE
STAGE_05
Idempotency

Honest retry handling for settled or in-flight payments.

INPUT
TENANT_CTX + REQ_BODY
OUTPUT
AUDIT_ROW + NEXT_STATE
STAGE_06
Reconciliation

Record persistence and audit registry query access.

INPUT
TENANT_CTX + REQ_BODY
OUTPUT
AUDIT_ROW + NEXT_STATE

Concrete Capabilities

Spindle is judged on concrete gateway behavior. We enforce technical boundaries between agent backends and Fiber RPC nodes.

CAPABILITY_IDCORE_LOGICCLASS
AUTH_SCOPEAPI Key + Route Scoped PermissionsL1_GATEWAY
FIBER_SYNCFiber Testnet Invoice ReconciliationCORE_PAYMENT
POLICY_GATEPre-execution spending limit enforcementCONTROL_LAYER
AUDIT_RECAPFull lifecycle audit row persistenceCOMPLIANCE
IDEMPOTENT_RETRYStateful duplicate execution blockingSYSTEM_INTEGRITY
NON_CLAIMS:
// NO_MAINNET_SETTLEMENT// NO_ZK_VERIFICATION// NO_LIVE_TELEMETRY

Technical Integration

POST /api/v1/invoices
{
  "amount": "50",
  "assetSymbol": "USDT",
  "description": "Agent payout"
}
POST /api/v1/payments
{
  "invoice": "fibt1..."
}

Review the implementation.

The documentation and seeded scenarios provide the definitive API shape and request flow of the current Spindle Gateway.