> ## Documentation Index
> Fetch the complete documentation index at: https://ckb.danielasaboro.com/llms.txt
> Use this file to discover all available pages before exploring further.

# From Hosted LSP POC to Production Readiness

> Week 17 turns the open gaps behind hosted Fiber into crash, signer-policy, isolation, and release-evidence invariants.

# From Hosted LSP POC to Production Readiness

Week 16 followed a mobile payment through a proposed hosted Fiber service and back to exact CKB settlement evidence. It also stopped at an uncomfortable but necessary boundary: a coherent architecture is not the same thing as a production-safe product.

Week 17 goes deeper by converting that boundary into executable acceptance criteria. The question is no longer merely “can the flow work?” It is “what evidence would justify trusting it across crashes, malicious requests, noisy tenants, key recovery, and release claims?”

The answer remains deliberately conservative:

`Multi-tenant hosted LSP and remote-channel signing are post-v0.9.0 design/prototype work, not released Fiber behavior.`

Fiber’s open [hosted LSP design issue #1625](https://github.com/nervosnetwork/fiber/issues/1625) is the primary source. It records implemented branch coverage alongside incomplete full CI, standalone SDK-agent E2E, production signing policy, crash-recoverable continuations, external-signer watchtower recovery, and credential recovery. The associated [hosted baseline PR #1623](https://github.com/nervosnetwork/fiber/pull/1623) is work in progress. Passing local models here cannot erase those upstream gaps.

## A signature is not the end of a transition

A remote signature arrives in the middle of a channel state transition. The node still has to validate it, persist continuation material, apply the transition, queue the peer message, and send that message. Crashing between any two of those steps creates a dangerous question: should restart repeat the work or assume it already happened?

The ordering must make the answer recoverable:

`persist request -> verify exact response -> persist continuation -> apply state -> persist outbox -> emit once`

Exercise 65 journals each phase under `(tenantId, channelId, requestId)`. It injects a crash after every durable boundary, reconstructs a new coordinator from cloned disk state, and proves that one channel transition and one peer effect result. A changed signature, changed continuation, malformed next public nonce, stale counter, or different tenant cannot borrow the receipt.

This is an executable teaching model of a stated production blocker. Its Maps, synthetic signature, and outbox are not Fiber storage or wire formats.

## The wallet must approve meaning

Moving private keys to a phone does not make the host harmless. If the phone signs any well-formed digest, a compromised host may ask it to authorize a validly encoded theft.

A fail-closed wallet policy therefore reconstructs the proposed state transition and checks its semantics:

* tenant and channel signer scope;
* previous state root and monotonic commitment counter;
* balance conservation and bounded fees;
* exact added or removed direction-aware TLC;
* full payment hash, amount, and safe expiry;
* preimage for fulfillment or elapsed height for timeout;
* one-time secret nonce use;
* rejection of unknown transition variants.

Exercise 66 approves one declared TLC addition and exact fulfillment. It rejects hidden balance loss, cross-tenant signing, unknown intent, nonce reuse, wrong preimages, and premature timeout. The policy is intentionally smaller than a real Fiber wallet policy; its purpose is to demonstrate why structural signature verification is necessary but insufficient.

## Multi-tenancy needs failure containment, not just prefixes

Tenant-prefixed keys prevent one class of collision. They do not by themselves stop one tenant from exhausting memory, monopolizing activation, crashing a shared process, poisoning a backup, or forcing the public trampoline offline.

Exercise 67 treats the public network plane, tenant runtimes, and durable tenant state as different failure domains. Admission is bounded globally and per tenant. Hydration gives queued tenants a turn. Runtime eviction removes memory only; channel state remains durable. A tenant crash does not disconnect ordinary public forwarding. Backup integrity binds both payload and tenant identity, so Tenant A’s image cannot overwrite Tenant B.

The scheduler and quota numbers are local teaching choices. The stable design requirement comes from issue #1625: one public node, tenant-scoped data planes, durable state, active-runtime bounds, and global/per-tenant quotas.

## Release claims need an evidence gate

Week 17 uses four labels:

| Label | Meaning |
| - | - |
| Released | Present in a tagged upstream release, merged, required verification green, and no declared production blocker remains. |
| Prototype | Primary-source implementation or tests exist, but there is no qualifying released artifact. |
| Blocked | A required test is absent or the primary source declares an unresolved production gap. |
| Unknown | There is not enough primary evidence to classify the claim. |

Exercise 68 applies that gate. The [Fiber v0.9.0 release](https://github.com/nervosnetwork/fiber/releases/tag/v0.9.0) qualifies only the foundations it actually shipped. Hosted-LSP production safety remains blocked even when every local Week 17 exercise passes. Clearing local fixtures cannot manufacture an upstream tag, green full CI, standalone SDK workflow, external-signer watchtower recovery, credential recovery, or reviewed production policy.

CKB node health is a separate dependency gate. The [CKB August 19 development report](https://github.com/nervosnetwork/ckb/discussions/5308) is useful current node evidence, and the [CKB transaction model](https://docs.nervos.org/docs/getting-started/how-ckb-works) remains the consensus boundary. Neither proves an experimental hosted Fiber layer is released.

## Verified behavior versus teaching model

| Classification | Week 17 boundary |
| - | - |
| CKB consensus/transaction behavior | Confirmed consume-and-create transaction evidence remains the final on-chain settlement fact. |
| Verified Fiber v0.9.0 behavior | Only capabilities documented by the v0.9.0 release are described as released foundations. |
| Hosted branch/design evidence | Issue #1625 and PR #1623 support prototype architecture and explicitly list open readiness work. |
| Future production requirement | Complete signer policy, crash journals, external-signer watchtower flow, credential recovery, and standalone E2E remain gates. |
| Simplified local teaching model | Synthetic signatures, in-memory journals, policy values, scheduler, backups, and classification function are not Fiber implementation formats. |

## Run the exercises

```bash theme={null}
cd week17/hosted-lsp-production-readiness
npm test
```

* `65-crash-journaled-signer-continuation.ts` crashes and resumes every signer-continuation boundary without duplicate state or peer effects.
* `66-fail-closed-wallet-policy.ts` checks the semantic channel transition before producing a client signature.
* `67-hosted-service-failure-containment.ts` contains tenant load, crashes, eviction, and backup/restore without taking down public forwarding.
* `68-production-readiness-evidence-gate.ts` prints released, prototype, blocked, and unknown claims plus every open production gate.

[CKB Quest](https://ckb-quest.vercel.app/) continues to inspire short, visible checkpoints. The [Nervos Knowledge Base Fiber guide](https://www.nervos.org/knowledge-base/what_is_fiber) supplies architectural context, while [Nervos Nation](https://nervosnation.com/) remains optional ecosystem framing rather than protocol authority.

The progression from Week 13 to Week 17 is now one continuous trust argument: exact settlement evidence, durable recovery, safe reestablishment, hosted-mobile synthesis, and finally proof that a prototype has earned—or has not yet earned—the word “production.”


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.