CKB Pulse

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.

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)

More about Rust scripts and ckb-std

All 35 in this topic

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.

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.