Skip to content

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.

The bootstrap script depends on the compiled CLI SDK:

Terminal window
cd sdk/cli && npm install && npm run build && cd ../..
Terminal window
node scripts/build_treasury_bootstrap_tx.mjs deploy/bootstrap-tx.json

The script:

  1. Fetches a live funding UTXO from your wallet
  2. Computes the validator Merkle root from the configured pubkey set
  3. Encodes the BLKL v2 governance header and empty payload
  4. Builds a GOV1 v4 witness binding the initial state
  5. Writes an unsigned transaction to deploy/bootstrap-tx.json
Terminal window
# Sign with your CKB private key
ckb-cli --url https://testnet.ckb.dev tx sign-inputs \
--tx-file deploy/bootstrap-tx.json \
--add-signatures
# Submit
ckb-cli --url https://testnet.ckb.dev tx send \
--tx-file deploy/bootstrap-tx.json

Record the transaction hash printed by send.

Wait for the transaction to confirm (~30 seconds on testnet), then continue to Step 3.