All lessons · Rust scripts and ckb-std · Start here · Glossary
Recognising a Nervos DAO deposit cell referenced as a stake cell depWorkingFrom one fix
From one fix · Check: right · Checked 2026-11-19
A Nervos DAO deposit cell has the DAO type script (code hash 0x82d76d1b75fe2fd9a27dfbaa65a039221a380d76c926f378d3f81cf3e7e13f2e, hash_type type, empty args) and 8 zero bytes of data; a withdrawing cell has the same type script but the deposit block number as data. A contract that accepts one as a cell dep must check code hash, hash_type, empty args and data == 8 zero bytes, since the DAO script does not run for a dep. For the same reason a ckb_testtool test can create such cells directly with the DAO type script and zero data, without deploying the DAO binary.
Why it matters: Without these checks, a withdrawing DAO cell or a lookalike cell under another type script could be accepted as a stake, because nothing re-validates a cell that is only referenced as a dep.
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/a7/p1.test.mjs,contracts/csr-contract-tests/tests/float.rs,contracts/csr-contract-tests/tests/harness.rs,contracts/csr-contract-tests/tests/job.rs,contracts/csr-contract-tests/tests/registry.rs
- Concepts
- Cell deps and script lookup, Testing and devnet
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-10-20
- Last changed
- 2026-10-20
- 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-10-20 · ckb-service-runner/ckb-service-runner · more from this project
More about Rust scripts and ckb-std
- Separate builds for test-only contract constants
- ckb-std C shim needs a RISC-V C toolchain (clang) in CI
- Median time vs tip timestamp for deadlines
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Recognising a Nervos DAO deposit cell referenced as a stake cell dep", CKB lessons, https://pulse.lusocryptolabs.com/learned/scripts/recognising-a-nervos-dao-deposit-cell-referenced-as-a-stake, CC BY 4.0, last changed 2026-10-20.