External Funding
Open a payment channel using a funding transaction signed by an external wallet
What Is External Funding?
External funding lets a Fiber node open a channel while an external wallet signs the funding transaction. The node negotiates the channel and builds the funding transaction, but the wallet provides the signatures for the CKB Cells it contributes.
Use this flow when the funding Cells are controlled by a wallet or Lock Script outside the Fiber node.
How It Works
In an app integration, Fiber acts as the channel negotiator while the wallet remains the owner of the funding Cells. The flow is:
- The app calls
open_channel_with_external_fundingto ask the Fiber node to prepare an externally funded channel. - Fiber negotiates the channel and returns
channel_idplusunsigned_funding_tx. - The app passes that exact transaction to the external wallet for signing.
- The wallet signs the inputs it controls and returns the signed witnesses.
- The app submits the signed transaction back to Fiber with
submit_signed_funding_tx.
After the unsigned transaction is returned, the transaction structure is frozen. The app or wallet should only fill the corresponding witnesses; it should not rebuild the transaction or modify its structure.
Do not rebuild the transaction or modify inputs, outputs, outputs_data,
or cell_deps after unsigned_funding_tx is returned.
Signing the Funding Transaction
For Rust developers using secp256k1-sighash locks, Fiber includes a development-only sign_external_funding_tx implementation that shows the expected signing process. It resolves previous outputs, groups matching lock scripts, signs each script group, and writes the signature into WitnessArgs.lock.
This helper only covers secp256k1 signing and should be treated as a development reference, not a production wallet integration.
For JavaScript developers, see the pinned fiber-wallet example using @ckb-ccc/ccc. The example includes JSON-RPC to CCC transaction conversion, copying signed witnesses back to the original transaction, standard CCC signers, OmniLock witness preparation, and JoyID redirect signing.
Related APIs
open_channel_with_external_fundingnegotiates the channel and returns the unsigned funding transaction.submit_signed_funding_txsubmits the signed funding transaction.sign_external_funding_txis a development-only helper for secp256k1-sighash signing.