Open a Unidirectional Fiber Channel
Fund a private one-way channel, verify the payer and acceptor roles, and send a real Testnet payment in the permitted direction.
Only the initiator can send
The browser node opens and funds the channel, so it becomes the payer. Bottle accepts the channel and becomes the receiver. During the channel lifetime, payments can move from the initiator to the acceptor, but not back.
A public node can accept a private channel
Connect to Bottle over WSS before requesting a channel. Bottle is a public Fiber node, but this specific channel remains private and never appears in the public routing graph.
One-way channels must use public: false. Combining one_way: true with a public channel is rejected.
Set one_way when funding the channel
Submit 499 Testnet CKB with one_way: true and wait for ChannelReady. The returned channel confirms is_one_way: true, is_public: false, and is_acceptor: false for this browser node.
Send normally in the allowed direction
Once ready, the payer uses the ordinary sendPayment() API. The routing engine recognizes the channel direction, sends directly to Bottle, and rejects any attempt by the acceptor to pay back through it.
Make the role and balance movement visible
The React page displays the channel flags alongside local and remote balances. After a successful payment, local payer balance decreases and remote acceptor balance increases without another on-chain transaction.
app/page.tsx · lines 9–29