All lessons · Wallets and signing · Start here · Glossary
JoyID signer prices fees with a 1,000 byte signature placeholderWorkingFrom one fix
From one fix · Check: partly right · Checked 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.
Why it matters: 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.
Pattern
witness.lock=ccc.hexFrom('00'.repeat(JOYID_PLACEHOLDER));priced.setWitnessArgs(at,witness);Taken from the commit, shortened.
- Concepts
- Transaction building and fees, Witnesses and signatures
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-10-30
- Last changed
- 2026-10-30
- Last checked
- 2026-11-19
- Check against the commit
- partly right: a true core, with a part that is loose or too wide
Sources (1)
- 2026-10-30 · 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
- Multisig sighash placeholder lock: script plus M zeroed signatures
- One placeholder witness per input when all inputs share one lock
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
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.