All lessons · Developer tooling · Start here · Glossary
Absence of on-chain references does not mean a code cell is safe to consumeWorkingFrom one fix
From one fix · Check: partly right · Checked 2026-11-19
Before consuming a deployed code cell, search live cells for its data hash as lock and type script code hash (prefix mode, hash types data, data1 and data2), and compare its data hash (blake2b with personalization ckb-default-hash) against the binaries you currently build. Zero references does not mean superseded: a contract unchanged by a rebuild has no users yet and is still the live deployment. This search does not see type ID references or cell dep use, so treat a cell that anything may resolve by type ID or as a dep as still needed.
Why it matters: Reclaiming every unreferenced code cell would have consumed the current dao-lock deployment and forced a pointless redeploy, and consuming a code cell cannot be undone.
Pattern
digest = hashlib.blake2b(path.read_bytes(), digest_size=32, person=b"ckb-default-hash").hexdigest()Taken from the commit, shortened.
- Concepts
- Type ID and upgrades, Indexer queries and cell collection, Cell deps and script lookup
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-09-20
- Last changed
- 2026-09-20
- 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-09-20 · toastmanAu/daowow · more from this project
More about Developer tooling
- Script hash_type selects the VM version: data2 (4) or type (1) for a VM2 target
- Derive devnet Spore and system script cell deps from a fresh OffCKB export
- Matching a Script code_hash to its code Cell by hash_type
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Absence of on-chain references does not mean a code cell is safe to consume", CKB lessons, https://pulse.lusocryptolabs.com/learned/tooling/absence-of-on-chain-references-does-not-mean-a-code-cell-is, CC BY 4.0, last changed 2026-09-20.