Skip to main content

From Fiber Channels to CKB Settlement

Week 11 ended with incident replay. Reef could preserve a baseline success, a routed failure, a route autopsy, channel and peer correlation, CKB funding evidence, and a later matching success without claiming causal repair. Week 12 asks the next technical question: What happens when a Fiber channel has to touch CKB again? Fiber gives the payment experience its speed by moving updates off-chain. But that does not erase CKB. It changes when CKB matters. The channel is funded on CKB. It can close on CKB. Settlement finality is a CKB evidence path. Dispute and watchtower posture are only knowable when real sources expose them. The thesis for the week is: Fiber makes payments fast off-chain, but CKB remains the settlement and dispute boundary. That is the technical boundary a diagnostics tool has to respect.

A channel is not only a Fiber row

From the operator side, it is tempting to treat a channel as a single dashboard object: ready or not ready That is too flat. A Fiber channel crosses multiple evidence domains:
  • a CKB funding transaction creates the anchor;
  • Fiber reports the channel lifecycle and current off-chain state;
  • commitment updates describe the latest agreed channel state;
  • closing creates or reveals an on-chain spend path;
  • final settlement depends on CKB transaction visibility and confirmation depth;
  • watchtower or dispute posture is only source-backed if logs, metrics, Fiber APIs, or future read surfaces expose it.
Those states should not be collapsed into one health label. The channel can be ready in Fiber while the funding lookup is temporarily unavailable. A close transaction can be visible but not final. A log can show a channel close without proving dispute protection. Each case needs its own source status.

Commitment state is the safety boundary

Payment channels work because participants keep updating the off-chain state. That creates a technical risk: old signed state may still exist. The system is safe only if the latest state is distinguishable from stale state and stale state is punishable, invalidated, or otherwise unsafe to use. For learning purposes, the important model is:
  • commitment number tells you which state is newer;
  • latest fully signed state is the state the peers currently agree on;
  • older commitments become stale;
  • stale commitments must have revocation evidence or equivalent protection;
  • if old state can still settle cleanly, the channel has a dispute risk.
This is why settlement diagnostics cannot stop at “channel exists”. They need to know what kind of state evidence is being inspected. A funding transaction proves an anchor. It does not prove latest-state safety. A ready Fiber channel proves current off-chain operation. It does not prove that every stale commitment is harmless. A close transaction proves an on-chain spend. It does not prove the spend represents the latest valid state unless the source can support that claim.

Settlement is a CKB evidence path

When a channel moves back on-chain, the diagnostic question becomes very CKB-shaped. The tool needs to ask:
  • can CKB RPC read the funding transaction?
  • has the funding outpoint been spent?
  • is there a close transaction?
  • how many confirmations does the close transaction have?
  • has the required finality depth been reached?
  • is settlement evidence missing, pending, or final?
Those are separate facts. A readable funding transaction means the anchor exists from the selected chain source. A readable close transaction means there is on-chain closing evidence. Enough confirmations mean the close has reached the configured finality threshold. If any source is missing, that is a source gap, not a reason to invent a final state. That distinction is the CKB part of Fiber diagnostics. Fiber can explain the channel and payment context, but CKB proves the on-chain settlement path.

Watchtower evidence must stay honest

Watchtower and dispute coverage are important, but they are easy to overclaim. If Reef can read a stable Fiber API, metric, or log row that proves watchtower state, it can report that evidence. If it can only read a channel close log, it can report the close observation. It cannot turn that into proof that a watchtower protected the channel. If no source exposes dispute posture, the correct state is unknown. That may feel unsatisfying, but it is the safer product behavior. The source-backed rules from Week 9 still apply:
  • missing watchtower source means unknown;
  • missing dispute source means unknown;
  • a close transaction is not automatically a dispute;
  • a later settlement is not automatically proof that a stale state was impossible;
  • future read APIs can improve coverage, but they should not be guessed before they exist.

Why this matters for Reef

Reef started with payment diagnostics because failed payments are the easiest place to see Fiber operational pain. But operators also need a boundary between:
  • payment failure;
  • channel readiness;
  • channel closing;
  • on-chain settlement;
  • stale-state risk;
  • dispute evidence;
  • watchtower coverage.
Those are related, but not the same. Week 12 makes that separation explicit. It gives Reef a technical vocabulary for the moment when off-chain payment-channel state has to be reconciled with CKB finality.

What to build locally this week

Run the Week 12 exercises from the Fiber settlement boundary package:
The scripts are dry-run. They do not require a Fiber node, funded wallet, private key, hosted Reef deployment, or broadcast path. Read them in order:
  • 45-channel-as-ckb-state-machine.ts
  • 46-commitment-and-revocation-model.ts
  • 47-settlement-evidence-tracker.ts
  • 48-watchtower-and-dispute-boundary.ts
Together they model the Week 12 settlement boundary:
  • treat a Fiber channel as a CKB-anchored state machine;
  • distinguish latest commitment, stale commitment, and revoked commitment;
  • track funding, close, and finality evidence from CKB-style reads;
  • keep watchtower and dispute posture source-backed instead of invented.
Week 12 is where the Fiber diagnostics story comes back to CKB: the chain is not in every payment update, but it is still the place where channel settlement becomes real.