CKB Pulse

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

Prefer
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.

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)

More about CKB node, RPC and indexer

All 45 in this topic

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.

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.