全部经验 · Wallets and signing · 从这里开始 · 术语表
JoyID signer prices fees with a 1,000 byte signature placeholder实践来自一次修复
来自一次修复 · 核对结果:部分正确 · 核对于 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.
为什么重要: 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.
代码模式
witness.lock=ccc.hexFrom('00'.repeat(JOYID_PLACEHOLDER));priced.setWitnessArgs(at,witness);摘自提交,已缩短。
- 概念
- Transaction building and fees, Witnesses and signatures
- 证据
- 来自一次修复: 来自一个项目,已对照其提交核对
- 首次出现
- 2026-10-30
- 最近改动
- 2026-10-30
- 最近核对
- 2026-11-19
- 对照提交的核对结果
- 部分正确:核心属实,但有一部分表述松散或范围过宽
来源(1)
- 2026-10-30 · toastmanAu/openswap · 这个项目的更多经验
更多关于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
引用这条经验
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.