CKB Pulse

Todas as lições · Wallets and signing · Começa aqui · Glossário

Secp256k1 sighash lock groups cover non contiguous later group witnessesPráticoDe uma correção

De uma correção · Verificação: certa · Verificada em 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.

Porque importa: 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.

Padrão

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

Tirado do commit, encurtado.

Conceitos
Witnesses and signatures, Transaction building and fees
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-10-09
Última mudança
2026-10-09
Última verificação
2026-11-19
Verificação contra o commit
certa: a lição sai do commit e continua a valer no código de hoje

Fontes (1)

Mais sobre Wallets and signing

Ver as 23 deste tema

Manténs um projeto de onde esta lição veio? Confirma ou corrige

Citar esta lição
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.

Tiradas de commits públicos e verificadas contra o commit de onde cada uma veio e o código de hoje do projeto. Lê a fonte antes de confiar numa. Texto sob CC BY 4.0: dá crédito à LusoCryptoLabs, CKB lessons, com uma ligação para a lição. Queres que uma lição seja mudada ou retirada? Abre um issue.