CKB Pulse

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

JoyID signer prices fees with a 1,000 byte signature placeholderPráticoDe uma correção

De uma correção · Verificação: em parte certa · Verificada em 2026-11-19

With CCC and @ckb-ccc/joy-id, prepareTransaction fills the JoyID witness lock with a 1,000 byte placeholder before the fee is computed as ceil((serialized size + 4) x rate / 1000). The real signature is usually shorter (347 bytes in one testnet order), so the committed transaction is smaller and its measured rate is higher than the rate it was built at (7,278 against 5,000 shannons/KB). To recover the build rate, clone the transaction, set the JoyID witness lock back to 1,000 zero bytes, and compute the rate on that size, confirming with tx.estimateFee(rate) equal to the paid fee.

Porque importa: Measuring the fee rate on the signed transaction overstates the rate it was built at, so a fee policy check on a JoyID transaction would wrongly judge it as outside its rate range.

Padrão

Preferir
witness.lock=ccc.hexFrom('00'.repeat(JOYID_PLACEHOLDER));priced.setWitnessArgs(at,witness);

Tirado do commit, encurtado.

Conceitos
Transaction building and fees, Witnesses and signatures
Evidência
De uma correção: de um projeto, verificada contra o commit
Vista pela primeira vez
2026-10-30
Última mudança
2026-10-30
Última verificação
2026-11-19
Verificação contra o commit
em parte certa: um núcleo verdadeiro, com uma parte solta ou demasiado larga

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, "JoyID signer prices fees with a 1,000 byte signature placeholder", CKB lessons, https://pulse.lusocryptolabs.com/learned/wallets/joyid-signer-prices-fees-with-a-1-000-byte-signature-placeho, CC BY 4.0, last changed 2026-10-30.

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.