CKB Pulse

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 bytes

A test changed in the same commit

It sits next to the fix. We did not run it.

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)

More about Apps and UI

All 9 in this topic

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.

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.