CKB Pulse

全部经验 · 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)

更多关于Wallets and signing

查看此主题的全部 23 条

你维护这条经验的来源项目吗?请确认或纠正

引用这条经验
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.

取自公开提交,并对照每条经验的来源提交和项目当前代码做了核对。使用前请先读来源。 文本采用 CC BY 4.0:请署名 LusoCryptoLabs, CKB lessons,并附上经验的链接。 想修改或撤下某条经验?请提交 issue。