All lessons · Wallets and signing · Start here · Glossary
Placeholder JoyID lock args are 22 bytes when quoting capacityWorkingFrom one fix
From one fix · Check: right · Checked 2026-11-19
When quoting capacity before a wallet is connected, use a placeholder lock shaped like the wallet you expect. A JoyID lock has 22 byte args, 2 bytes more than a secp256k1 lock's 20, so every cell carrying the user's lock needs 2 CKB more occupied capacity. Pass the placeholder (for example args of 22 zero bytes) to the same quote function used after connecting, so the pre-connect total is not lower than what a JoyID user will actually commit.
Why it matters: A placeholder sized like a 20 byte lock quotes a JoyID user a total that is too low by 2 CKB per cell they will own, so the figure they agreed to before connecting differs from what is actually built.
Pattern
const JOYID_SHAPED = { args: "0x" + "00".repeat(22) };Taken from the commit, shortened.
A test changed in the same commit
It sits next to the fix. We did not run it.
- toastmanAu/daowow:
apps/web/test/app-shell.test.js,apps/web/test/entry-view.test.js,apps/web/test/model-entry-guard.test.js,apps/web/test/page-scripts.test.js
- Concepts
- Capacity and cell size, Transaction building and fees
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-11-10
- Last changed
- 2026-11-10
- Last checked
- 2026-11-19
- Check against the commit
- right: the lesson follows from its commit and still holds in the code today
Sources (1)
- 2026-11-10 · toastmanAu/daowow · more from this project
More about Wallets and signing
- Keep at least 61 CKB in the change cell when sending from a secp256k1 wallet
- Count only empty, typeless lock cells as spendable balance
- DAO compensation must use the deposit cell's occupied capacity (102 CKB), not 61
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Placeholder JoyID lock args are 22 bytes when quoting capacity", CKB lessons, https://pulse.lusocryptolabs.com/learned/wallets/placeholder-joyid-lock-args-are-22-bytes-when-quoting-capaci, CC BY 4.0, last changed 2026-11-10.