CKB Pulse

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.

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)

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, "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.

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.