Todas as lições · CCC (TypeScript SDK) · Começa aqui · Glossário
Reserve co-signer witness space before completeFeeBy in multi-signer CCC transactionsPráticoReproduzida
Reproduzida · Verificação: certa · Verificada em 2026-11-19
When a CCC transaction has inputs locked by several secp256k1 signers but the fee is paid by one, call tx.prepareSighashAllWitness(coSignerLock, 65, client) for each co-signer before tx.completeFeeBy(payer, feeRate). Otherwise the fee is estimated without their signature witnesses and may come out short. Each co-signer must own at least one input to have a script group to sign.
Porque importa: completeFeeBy only prepares the payer's witness, so co-signer signatures added later grow the transaction past the size the fee was paid for, and the fee can fall short of the fee rate.
Padrão
await tx.prepareSighashAllWitness(await lockOf(s), SECP_SIGNATURE_LEN, client);Tirado do commit, encurtado.
Reproduzida por um teste
Um teste público corre o que esta lição diz em @ckb-ccc/core 1.23.1, sem nó. Qualquer pessoa o pode correr.
tests/ccc/cosigner-witness-before-fee.test.mjs
- Conceitos
- Transaction building and fees, Witnesses and signatures
- Evidência
- Reproduzida: reproduzida por um teste público
- Vista pela primeira vez
- 2026-10-06
- Última mudança
- 2026-10-06
- Ú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)
- 2026-10-06 · salmansarwarr/Kirea-finance · mais deste projeto
Mais sobre CCC (TypeScript SDK)
- Sign each lock group with its own placeholder length and witness shape
- completeFeeBy adds change instead of shrinking outputs, breaking output bound proofs
- Plain CKB transfer with a CCC signer
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
LusoCryptoLabs, "Reserve co-signer witness space before completeFeeBy in multi-signer CCC transactions", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/reserve-co-signer-witness-space-before-completefeeby-in-mult, CC BY 4.0, last changed 2026-10-06.