CKB Pulse

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

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

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)

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, "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.

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.