All lessons · Wallets and signing · Start here · Glossary
Keep at least 61 CKB in the change cell when sending from a secp256k1 walletBasicFrom one fix
From one fix · Check: partly right · Checked 2026-11-19
A plain secp256k1_blake160 cell occupies 61 CKB, so when a wallet sends X it must keep at least 61 CKB (the occupied capacity of its own lock) in the change cell, plus the fee, and refuse the send otherwise. The recipient output must also be at least the occupied capacity of the recipient's lock, never less than 61 CKB for a plain address. Enforce the change floor in the transaction builder, and use extra headroom (this runner uses threshold >= amount + 100) for automatic sweeps so fee and change always fit.
Why it matters: A transaction whose change or recipient output holds less than its occupied capacity (61 CKB for a plain secp256k1 cell) is rejected by the node, so the send fails.
A test changed in the same commit
It sits next to the fix. We did not run it.
- ckb-service-runner/ckb-service-runner:
acceptance/a8/p2.test.mjs,acceptance/a8/p3.test.mjs,acceptance/a8/p4.test.mjs
- Concepts
- Capacity and cell size, Transaction building and fees
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-10-21
- Last changed
- 2026-10-21
- Last checked
- 2026-11-19
- Check against the commit
- partly right: a true core, with a part that is loose or too wide
Sources (1)
- 2026-10-21 · ckb-service-runner/ckb-service-runner · more from this project
More about Wallets and signing
- Placeholder JoyID lock args are 22 bytes when quoting capacity
- 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, "Keep at least 61 CKB in the change cell when sending from a secp256k1 wallet", CKB lessons, https://pulse.lusocryptolabs.com/learned/wallets/keep-at-least-61-ckb-in-the-change-cell-when-sending-from-a, CC BY 4.0, last changed 2026-10-21.