All lessons · Developer tooling · Start here · Glossary
Witnesses do not follow reordered inputsWorkingFrom one fix
From one fix · Check: right · Checked 2026-11-19
Witnesses are matched to inputs by position: witness i belongs to input i, and a script reading GroupInput witnesses sees the witnesses at its group's input positions. Reordering inputs does not move the witnesses, so after reordering, check and rebuild the witness list so each input's position again holds the intended witness.
Why it matters: After an input reorder, a script group can read a witness meant for a different input, so verification can fail or check the wrong data.
A test changed in the same commit
It sits next to the fix. We did not run it.
- Hanssen0-Alter-Ego/ckb-vm-js:
tests/browser/workbench.spec.js,tests/js/guided.test.js
- Concepts
- Witnesses and signatures, Transaction building and fees
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-11-16
- Last changed
- 2026-11-16
- 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-16 · Hanssen0-Alter-Ego/ckb-vm-js · more from this project
More about Developer tooling
- ckb-cli deploy info file layout for offline multisig signing
- ckb-cli needs --skip-check to sign and send transactions with custom locks
- ckb-cli tx init overwrites an existing tx file with an empty skeleton
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Witnesses do not follow reordered inputs", CKB lessons, https://pulse.lusocryptolabs.com/learned/tooling/witnesses-do-not-follow-reordered-inputs, CC BY 4.0, last changed 2026-11-16.