From Mobile Client to CKB Settlement
Weeks 12–15 built a chain of increasingly strict invariants:- Fiber channel claims eventually meet CKB settlement evidence.
- A force-close proof resolves one exact direction-aware TLC, not every same-hash record.
- That reconciliation must survive crashes, migrations, backup/restore, and restart.
- A recovered node must reestablish and synchronize without stale replay or unbounded peer work.
Hosted multi-tenant LSP support and the remote signer are design/prototype direction after Fiber v0.9.0—not released production-safe behavior.
The source is Fiber’s open multi-tenant hosted LSP design issue #1625, reviewed against the work-in-progress hosted baseline PR #1623 and a remote-signer integration draft. The design reports substantial branch coverage, but it also records incomplete CI, signer policy, continuation journaling, credential recovery, and watchtower work. Week 16 preserves those caveats.
One public network plane, many private tenant data planes
The architecture separates Public T—the operator’s publicly reachable Fiber node and trampoline—from Hosted Tenant U. Public T owns P2P connections, gossip, public routing, and public liquidity. Each tenant owns a namespace containing its private channel, invoices, payment sessions, and attempts. A hosted tenant does not run another public network stack. One physical store does not imply one authorization domain. Every key, index, actor name, channel binding, RPC context, quota, and delivery record must include or derive from the tenant scope. A tenant credential selects the execution context; accepting a caller-suppliedtenant_id beside an unrelated credential would recreate the confused-deputy problem.
Exercise 61 signs the complete role/tenant/method claims in a teaching token, derives the store prefix from the verified credential, and maintains a separate channel-owner index. It rejects modified tenant claims, methods outside the allowlist, operator-to-tenant authority escalation, arbitrary public peer channels, and cross-tenant channel dispatch.
The real proposal uses tenant-scoped Biscuit credentials and one restricted private channel between each tenant and Public T. The exercise’s HMAC token is only a compact way to make the authorization invariant executable.
Remote signing means typed intent, not “please sign this hash”
A remote signer helps only if the client understands and constrains what it signs. The proposed SDK owns the RootKey, RootSigner, channel keys, commitment/TLC secrets, and MuSig2 secret nonces. The hosted node receives public material, typed signing requests, signatures, and idempotency receipts. It must not silently fall back to a local signer for an external-signer channel. Exercise 62 uses an actual Ed25519 client keypair to demonstrate the boundary. The node persists a canonical typed request and stable request ID. The client signs those exact bytes. The node verifies tenant context, request identity, content, key binding, signature, and next public material before producing one peer side effect. Identical submissions returnAlreadyApplied; changed continuation material is a conflict; rejected submissions leave the channel paused.
The cryptographic algorithm and request encoding are teaching choices, not Fiber’s channel-signing scheme. The design’s deeper lesson is that approval binds to readable protocol intent: commitment outputs, balances, TLC changes, expiries, fees, counters, state roots, and preimage policy. Structural binding alone is not a complete wallet policy.
The proposal explicitly lists production blockers: a complete fail-closed signer policy, crash-recoverable continuation journal, external-signer watchtower/TLC-spend flow, credential recovery and rotation, signer readiness integration, and standalone SDK-agent end-to-end coverage. Moving keys out of the host is not enough to claim non-custodial production safety.
Offline delivery buffers a TLC, not money in an account
An offline recipient cannot sign a new channel transition immediately. A watchtower cannot accept that new TLC for them, and a hold invoice applies after a final TLC has already been accepted. The hosted design therefore lets Public T keep one concrete upstream TLC pending while it activates the tenant and attempts delivery over the real private channel. The state bridge is explicit:Deferred -> Dispatching -> InFlight -> SettlingUpstream -> Succeeded | Failed
The delivery is persisted before downstream dispatch. Its primary identity is the incoming channel and direction-aware TLC ID; payment hash is a secondary lookup. Admission validates a unique internal registration, canonical full hash, amount, asset, expiry, private-channel binding, duplicate state, success state, and global/per-tenant quotas.
The deadline is the earliest of the invoice buffer window, operator maximum, registration expiry, and upstream expiry after reserving downstream delta plus a settlement safety margin. If no safe window remains, Public T fails the upstream TLC immediately. It must not wait until the last possible second and discover it cannot safely commit the result.
Exercise 63 keeps the payer in flight while the tenant is offline. No internal LSP balance is credited. Once runtime, channel, and signer are ready, one downstream payment is created. Only a valid full-hash preimage from downstream success permits fulfillment of the exact upstream TLC. Amount mismatch, malformed hash, ambiguous same-hash registrations, unsafe expiry, and exhausted quota are rejected. Every non-final phase has a restart action, including “find an existing downstream payment before creating another.”
Buffered upstream MPP aggregation is deliberately outside the model, matching the proposal’s MVP boundary.
Follow one payment all the way back to CKB
Exercise 64 is the course synthesis:- A mobile RootSigner authorizes tenant registration.
- The tenant creates a signed invoice with Public T as a trampoline hint.
- An external payer sends an ordinary trampoline payment; no tenant ID enters the public Fiber wire.
- Public T persists the exact incoming delivery before any downstream side effect.
- The supervisor hydrates the tenant and restores its private channel.
- The mobile ChannelSigner approves one typed commitment request.
- Public T delivers over a real private Fiber channel.
- Downstream success returns the preimage.
- Public T fulfills the exact upstream TLC idempotently.
- If the private channel later force-closes, reconciliation still requires exact tenant/channel/direction/TLC/full-hash lineage and sufficient CKB confirmations.
Verified behavior versus future direction
The official Fiber overview supplies the stable channel/trampoline context. The Fiber v0.9.0 release anchors only the released foundations. The August 2026 development report identifies hosted LSP, multi-tenant trampoline, remote signing, and buffered delivery as continuing direction.
Run the exercises
61-tenant-isolated-data-plane.tsenforces credential, namespace, method, and private-channel ownership boundaries.62-typed-remote-signing.tsbinds a client signature to one typed request and makes identical submission replay idempotent.63-buffered-offline-delivery.tspersists exact upstream TLC delivery, applies safe deadlines/quotas, and recovers every non-final phase.64-mobile-to-ckb-settlement-synthesis.tsprints the complete mobile-to-trampoline-to-private-channel-to-CKB evidence trace.