All lessons · CKB node, RPC and indexer · Start here · Glossary
get_consensus dao_type_hash is the DAO code hash, not the DAO type script hashWorkingFrom one fix
From one fix · Check: right · Checked 2026-11-19
The dao_type_hash field returned by the get_consensus RPC is the native Nervos DAO code hash (used with hash_type type, args 0x). A contract that checks deposits with load_cell_type_hash needs the hash of the whole script, ccc Script{codeHash: dao_type_hash, hashType: "type", args: "0x"}.hash() (0xcc77c4de... on testnet); committing the raw dao_type_hash makes every deposit fail the check.
Why it matters: If a config pins the raw code hash, no deposit's type script hashes to it, so the node rejects every aggregate with -28 on Inputs[0].Type and the round can never aggregate; its entries have to be refunded after the deadline.
Pattern
const nativeDao = ccc.Script.from({ codeHash: (await rpc("get_consensus", [])).dao_type_hash, hashType: "type", args: "0x" }); const daoTypeHash = nativeDao.hash();Taken from the commit, shortened.
A test changed in the same commit
It sits next to the fix. We did not run it.
- toastmanAu/daowow:
apps/web/test/aggregate-tx.test.js,apps/web/test/lifecycle-rules.test.js - toastmanAu/daowow:
apps/web/test/app-shell.test.js,apps/web/test/entropy-derive.test.js,apps/web/test/model-entry-guard.test.js,apps/web/test/model-refund-guard.test.js,apps/web/test/model-route.test.js
- Concepts
- Cell deps and script lookup, Data encoding (molecule, hex, bigints)
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-10-05
- Last changed
- 2026-11-10
- Last checked
- 2026-11-19
- Check against the commit
- right: the lesson follows from its commit and still holds in the code today
Sources (2)
- 2026-10-05 · toastmanAu/daowow · more from this project
- 2026-11-10 · toastmanAu/daowow · more from this project
More about CKB node, RPC and indexer
- Check chain-wide script users before consuming a deployed code cell
- Decoding the packed epoch field (number, index, length)
- Nervos DAO compensation from the header's accumulated rate (AR)
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "get_consensus dao_type_hash is the DAO code hash, not the DAO type script hash", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/get-consensus-dao-type-hash-is-the-dao-code-hash-not-the-dao, CC BY 4.0, last changed 2026-11-10.