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
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)
- 2026-10-09 · toastmanAu/openswap · more from this project
More about Wallets and signing
- JoyID lock witness outputType may carry a subkey proof, so type script data must move elsewhere
- JoyID signer prices fees with a 1,000 byte signature placeholder
- Multisig sighash placeholder lock: script plus M zeroed signatures
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.