All lessons · Apps and UI · Start here · Glossary
Pre-sign checkers must mirror every on-chain comparisonWorkingFrom one fix
From one fix · Check: right · Checked 2026-11-19
A pre-sign checker that reuses the builder's assumptions will miss the builder's bugs, so make it compare every field the script compares, outputs_data included. When you add data to an output, count those bytes in its occupied capacity (8 + data + lock + type). Replay refused transactions in ckb-debugger against the deployed binaries to confirm the fix.
Why it matters: The builder wrote an empty receipt cell that the contract refused with -28 SHARD_ERROR_DATA on testnet after signing, because the checker shared the builder's belief and never compared outputs_data; the cell's capacity was also short by the 73 data bytes it needed.
Pattern
outputsData: [..., "0x", ...] for a cell whose type script checks its data; capacity computed with 0 data bytesA test changed in the same commit
It sits next to the fix. We did not run it.
- toastmanAu/daowow:
apps/web/test/aggregate-tx.test.js,apps/web/test/lifecycle-rules.test.js
- Concepts
- Capacity and cell size, Transaction building and fees, Testing and devnet
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-11-11
- Last changed
- 2026-11-11
- 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)
- 2026-11-11 · toastmanAu/daowow · more from this project
More about Apps and UI
- Pinning JS codecs and derivations to Rust test vectors
- Witness data in input_type and folding sub-minimum change
- Exact CKB-to-shannon conversion with BigInt
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Pre-sign checkers must mirror every on-chain comparison", CKB lessons, https://pulse.lusocryptolabs.com/learned/apps/pre-sign-checkers-must-mirror-every-on-chain-comparison, CC BY 4.0, last changed 2026-11-11.