Step 2: Bootstrap the Registry and Treasury
The bootstrap transaction creates two cells in a single on-chain operation:
- The registry cell (output index 0) — a BLKL v2 payload with a v3 governance header that embeds the treasury lock script
- The treasury seed cell (output index 1) — the initial CKB pool that funds governance operations, locked to the treasury address
The bootstrap also establishes the type_id_value — the stable identity of your registry — by hashing the first input outpoint and output index. This value never changes.
This is where the treasury is connected to the registry. The bootstrap computes the treasury address from your governance_lock_type_id and proposal_anchor_type_id, then writes the full treasury lock script into the registry cell’s governance header. After this transaction is confirmed, the CLI and GUI automatically discover the treasury address by reading the registry cell — no separate configuration is needed.
Build the CLI SDK
Section titled “Build the CLI SDK”The bootstrap script depends on the compiled CLI SDK:
cd sdk/cli && npm install && npm run build && cd ../..Run the bootstrap script
Section titled “Run the bootstrap script”node scripts/build_treasury_bootstrap_tx.mjs deploy/bootstrap-tx.jsonThe script:
- Fetches a live funding UTXO from your wallet
- Computes the validator Merkle root from the configured pubkey set
- Encodes the BLKL v2 governance header and empty payload
- Builds a GOV1 v4 witness binding the initial state
- Writes an unsigned transaction to
deploy/bootstrap-tx.json
Sign and submit
Section titled “Sign and submit”# Sign with your CKB private keyckb-cli --url https://testnet.ckb.dev tx sign-inputs \ --tx-file deploy/bootstrap-tx.json \ --add-signatures
# Submitckb-cli --url https://testnet.ckb.dev tx send \ --tx-file deploy/bootstrap-tx.jsonRecord the transaction hash printed by send.
Confirm on-chain
Section titled “Confirm on-chain”Wait for the transaction to confirm (~30 seconds on testnet), then continue to Step 3.
Background reading
Section titled “Background reading”- Registry and cell design — why Type ID is used and what
type_id_valuemeans for governance updates - The autonomous treasury model — why the registry cell and treasury seed are bootstrapped together
- BLKL v2 Format — the binary format of the registry payload you are initializing