CKB Pulse
Lessons

What CKB learned

Start here · Glossary · Test yourself · Feed

#Transaction building and fees

52 lessons found. All lessons

Page 5 of 5

ckb-cli tx init overwrites an existing tx file with an empty skeletonWorkingFrom one fix

`ckb-cli tx init --tx-file` creates a new empty transaction file and exits 0, so running it on a prepared transaction silently destroys that transaction. For a prebuilt transaction, write ckb-cli's tx-file wrapper ({transaction, multisig_configs, signatures}) yourself and go straight to `tx info` and `tx sign-inputs`.

#Transaction building and fees #Witnesses and signatures · Sources (1) · 2026-09-23

ckb-cli tx sign-inputs stores signatures in the file's signatures map, not witness 0WorkingFrom one fix

ckb-cli `tx sign-inputs --add-signatures` leaves witness 0's lock zero-filled and records the signature in the tx file's `signatures` map keyed by lock arg; `tx send` assembles the final witnesses from that map. A checker that inspects witness 0 for a signature before `tx send` will wrongly report the transaction as unsigned, so read `doc.signatures[lockArg]` instead.

#Witnesses and signatures #Transaction building and fees · Sources (1) · 2026-09-23

Persist the transaction hash before broadcasting itWorkingFrom one fix

A CKB transaction hash covers the raw transaction but not the witnesses, so after fee completion ccc tx.hash() already gives the final hash before signing. Save that hash to a durable journal before broadcasting, and assert that the hash returned by send equals it. Also assert that signing and preparation did not change the hash, so a rerun after a lost RPC reply waits for the recorded transaction instead of building and sending a duplicate.

#Transaction building and fees #Network and RPC reliability · Sources (1) · 2026-09-18

ckb-cli deploy gen-txs does not check the block size limitWorkingFrom one fix

`ckb-cli deploy gen-txs` checks capacity and reports success even when the deployment transaction exceeds the 597,000 byte block size limit; the node only rejects it at broadcast with ExceededMaximumBlockBytes. When deploying several large contract binaries, sum their sizes before signing and split them across separate deployment configs (sending each transaction only after the previous one confirms) if they approach the limit.

#Transaction building and fees #Capacity and cell size · Sources (1) · 2026-09-18

Page 5 of 5

Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. JSON · Want a lesson changed or removed? Open an issue.