All lessons · Wallets and signing · Start here · Glossary
Verifying Neuron style signed messages against a secp256k1_blake160 lockWorkingFrom one fix
From one fix · Check: partly right · Checked 2026-11-19
To verify a Neuron "Sign Message" signature, hash with CKB Blake2b over UTF-8("Nervos Message:" followed by the text), recover the compressed public key from the 65 byte r||s||v signature (v is 0 or 1, not 27/28), and accept the owner only if the lock has the exact code_hash and hash_type of the secp256k1_blake160 template and its args equal blake160 of the recovered key (comparing args alone is not enough). Neuron signs low-s; if you choose to also accept high-s, normalise s to n minus s and flip v before recovery, because some verify helpers (CCC's) reject high-s.
Why it matters: Without the prefix and CKB Blake2b, recovery returns the wrong key, and comparing args alone lets a matching key claim a lock with a different code_hash or hash_type.
Pattern
return ckbHash(NERVOS_MESSAGE_PREFIX, utf8Encode(text));Taken from the commit, shortened.
A test changed in the same commit
It sits next to the fix. We did not run it.
- poshboytl/omavote:
verifier-ts/test/adapter.test.ts,verifier-ts/test/builder.ts,verifier-ts/test/carrier.test.ts,verifier-ts/test/cli.test.ts,verifier-ts/test/input.test.ts - poshboytl/omavote:
crates/omavote-core/tests/scenarios.rs
- Concepts
- Witnesses and signatures, Data encoding (molecule, hex, bigints)
- Evidence
- From one fix: from one project, checked against its commit
- First seen
- 2026-10-08
- Last changed
- 2026-10-08
- Last checked
- 2026-11-19
- Check against the commit
- partly right: a true core, with a part that is loose or too wide
Sources (2)
- 2026-10-08 · poshboytl/omavote · more from this project
- 2026-10-08 · poshboytl/omavote · more from this project
More about Wallets and signing
- Do not detect DER signatures by a leading 0x30 byte
- Omnilock owner signing needs an 85 byte zeroed witness lock placeholder
- JoyID sub key membership is checked through the CoTA aggregator
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "Verifying Neuron style signed messages against a secp256k1_blake160 lock", CKB lessons, https://pulse.lusocryptolabs.com/learned/wallets/verifying-neuron-style-signed-messages-against-a-secp256k1-b, CC BY 4.0, last changed 2026-10-08.