CKB Pulse

All lessons · Wallets and signing · Start here · Glossary

Secp256k1 sighash lock groups cover non contiguous later group witnessesWorkingFrom one fix

From one fix · Check: right · Checked 2026-11-19

With the bundled secp256k1 blake160 sighash lock, all inputs sharing the same lock form one group even when another owner's inputs sit between them. The signature goes in the witness at the group's first input index, and changing a later group witness (which leaves the tx hash unchanged) still fails verification at Inputs[first].Lock. So composed multi owner transactions must place one signature placeholder per lock group at its first input and finalize every group witness before signing.

Why it matters: A composer that signs only a contiguous slice of witnesses, or edits a later group witness after signing, produces a signature that fails at Inputs[first].Lock even though the tx hash is unchanged.

Pattern

Prefer
witnesses[first] = WitnessArgs::new_builder().lock(Some(Bytes::from(vec![0; 65])).pack())

Taken from the commit, shortened.

Concepts
Witnesses and signatures, Transaction building and fees
Evidence
From one fix: from one project, checked against its commit
First seen
2026-10-09
Last changed
2026-10-09
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 Wallets and signing

All 23 in this topic

Do you maintain a project this lesson came from? Confirm or correct it

Cite this lesson
LusoCryptoLabs, "Secp256k1 sighash lock groups cover non contiguous later group witnesses", CKB lessons, https://pulse.lusocryptolabs.com/learned/wallets/secp256k1-sighash-lock-groups-cover-non-contiguous-later-gro, CC BY 4.0, last changed 2026-10-09.

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.