CKB Pulse

All lessons · Developer tooling · Start here · Glossary

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

From one fix · Check: right · Checked 2026-11-19

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.

Why it matters: A pre-send checker that looks only at witness 0 reports a properly signed ckb-cli tx file as unsigned, because the signature lives in the file's signatures map until `tx send` assembles it.

Pattern

Prefer
const recorded = Object.entries(doc.signatures ?? {}).find(([arg]) => arg.toLowerCase() === expectedLockArg);

Taken from the commit, shortened.

Concepts
Witnesses and signatures, Transaction building and fees
Evidence
From one fix: from one project, checked against its commit
First seen
2026-09-23
Last changed
2026-09-23
Last checked
2026-11-19
Check against the commit
right: the lesson follows from its commit and still holds in the code today

Sources (1)

More about Developer tooling

All 35 in this topic

Do you maintain a project this lesson came from? Confirm or correct it

Cite this lesson
LusoCryptoLabs, "ckb-cli tx sign-inputs stores signatures in the file's signatures map, not witness 0", CKB lessons, https://pulse.lusocryptolabs.com/learned/tooling/ckb-cli-tx-sign-inputs-stores-signatures-in-the-file-s-signa, CC BY 4.0, last changed 2026-09-23.

Drawn from public commits and checked against the commit each one came from and the project's code today. Read the source before you rely on one. Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. Want a lesson changed or removed? Open an issue.