All lessons · Apps and UI · Start here · Glossary
Witness data in input_type and folding sub-minimum changeWorkingFrom one fix
From one fix · Check: partly right · Checked 2026-11-19
Put the type script's witness data in WitnessArgs.input_type of each input it guards (the type script reads the first witness of its own input group), so the lock field stays free for the wallet's signature and one signature can cover several such inputs. If the change left after a fixed fee is below a plain cell's minimum occupied capacity, add it to an existing output whose scripts accept extra capacity; if there is no such output, refuse the build instead of creating a cell that cannot exist.
Why it matters: If the type script's data sat in the lock field, the wallet's signature would overwrite it or clash with it, and one wallet could not sign a transaction that retires several tickets at once.
Pattern
witnesses: inputs.map(() => WitnessArgs{inputType: data}); if (rest < plainFloor) outputs[0].capacity += restA test changed in the same commit
It sits next to the fix. We did not run it.
- toastmanAu/daowow:
apps/web/test/retire-tx.test.js
- Concepts
- Witnesses and signatures, Transaction building and fees, Capacity and cell size
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-11-14
- Last changed
- 2026-11-14
- Last checked
- 2026-11-19
- Check against the commit
- partly right: a true core, with a part that is loose or too wide
Sources (1)
- 2026-11-14 · toastmanAu/daowow · more from this project
More about Apps and UI
- Pre-sign checkers must mirror every on-chain comparison
- Exact CKB-to-shannon conversion with BigInt
- Occupied capacity depends on the actual lock's args length
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Witness data in input_type and folding sub-minimum change", CKB lessons, https://pulse.lusocryptolabs.com/learned/apps/witness-data-in-input-type-and-folding-sub-minimum-change, CC BY 4.0, last changed 2026-11-14.