All lessons · Rust scripts and ckb-std · Start here · Glossary
CKB blake160 is the first 20 bytes of the 32 byte ckbhashBasicFrom one fix
From one fix · Check: right · Checked 2026-11-19
CKB blake160, used for lock args and pubkey hashes, is the first 20 bytes of the 32 byte blake2b digest personalized with "ckb-default-hash". A blake2b hasher configured with a 20 byte output length gives a different value, because the digest length is part of blake2b's parameter block. Always hash to 32 bytes and then truncate.
Why it matters: Lock args derived from a 20 byte blake2b digest do not match the pubkey hash that the secp256k1 blake160 lock checks, so cells sent to that lock cannot be unlocked.
Pattern
let mut hasher = blake2b_ref::Blake2bBuilder::new(20).personal(b"ckb-default-hash").build();Taken from the commit, shortened.
A test changed in the same commit
It sits next to the fix. We did not run it.
- Tactus-Labs/tactus-o1:
crates/tactus-ordering-script/tests/hash_oracle.rs
- Concepts
- Data encoding (molecule, hex, bigints), Witnesses and signatures
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-10-09
- Last changed
- 2026-10-09
- 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-09 · Tactus-Labs/tactus-o1 · more from this project
More about Rust scripts and ckb-std
- Use raw_data(), not as_slice(), when parsing a packed::Bytes witness
- Treat an absent WitnessArgs.lock as a load failure in ckb-std lock scripts
- Creation witness for an output type script goes in WitnessArgs.output_type
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "CKB blake160 is the first 20 bytes of the 32 byte ckbhash", CKB lessons, https://pulse.lusocryptolabs.com/learned/scripts/ckb-blake160-is-the-first-20-bytes-of-the-32-byte-ckbhash, CC BY 4.0, last changed 2026-10-09.