CKB Pulse

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

Prefer
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.

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)

More about Wallets and signing

All 23 in this topic

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.

Drawn from public commits and checked against the commit each one came from and the project's code today. Read the source before you rely on one. Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. Want a lesson changed or removed? Open an issue.