Account, node, and channel

These are separate pieces of state: Logging in recovers the CKB identity and connects the persistent managed node by default. Optional browser mode requires its own node identity and channel database, which stays in local IndexedDB during use and can move to the next device through KeyWay’s encrypted explicit-logout handoff. The two modes do not share channel state.

Relays are not channels

When KeyWay starts, it connects to public testnet relays. Relay connections provide network reachability and gossip; they do not lock funds and do not give the user payment capacity. activateCkbChannel() separately negotiates and funds a channel with an available channel peer. That channel places capacity into the Fiber graph.

On-chain and Fiber balances

  • On-chain balance is the sum of live CKB cells controlled by the account’s lock script.
  • Fiber balance is the sum of local_balance across ready channels.
  • Opening a channel moves capacity from ordinary CKB cells into a channel funding cell.
  • Fiber payments update channel states off-chain rather than broadcasting one CKB transaction per payment.

Routed payments

A payment can cross several public channels:
Every hop must have enough outbound liquidity. A route may exist for 1 CKB and fail for 999 CKB because route existence and route capacity are different questions.

Browser ownership

In optional browser mode, one user has both an account identity and a local node identity. Closing the tab stops that node. Explicit logout encrypts and uploads its channel database so the next device can restore it before Fiber starts.
Do not treat IndexedDB as disposable cache. It contains the off-chain channel state needed to resume the node safely.

Managed mode

Managed mode is the testnet default from SDK 0.0.7. It keeps a dedicated native Fiber process and channel database online outside the browser lifecycle. The React API remains the same, but KeyWay operates the node and therefore takes on a larger custody and availability boundary. Host node and channel capacity limits apply. Existing browser channels are not moved into managed mode.