Todas as lições · Wallets and signing · Começa aqui · Glossário
Placeholder JoyID lock args are 22 bytes when quoting capacityPráticoDe uma correção
De uma correção · Verificação: certa · Verificada em 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.
Porque importa: 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.
Padrão
const JOYID_SHAPED = { args: "0x" + "00".repeat(22) };Tirado do commit, encurtado.
Um teste mudou no mesmo commit
Está ao lado da correcção. Nós não o corremos.
- 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
- Conceitos
- Capacity and cell size, Transaction building and fees
- Evidência
- De uma correção: de um projeto, verificada contra o commit
- Vista pela primeira vez
- 2026-11-10
- Última mudança
- 2026-11-10
- Última verificação
- 2026-11-19
- Verificação contra o commit
- certa: a lição sai do commit e continua a valer no código de hoje
Fontes (1)
- 2026-11-10 · toastmanAu/daowow · mais deste projeto
Mais sobre 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
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
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.