CKB Pulse

All lessons · Developer tooling · Start here · Glossary

ckb-vm-js 0.2.0 (npm) checks header hash instead of rejecting the fieldWorkingChecked by the owner

Checked by the owner · Check: right · Checked 2026-11-19

With ckb-vm-js 0.2.0 from npm, verifyScriptGroup accepts an RPC header in context.tip_header that carries its own hash only when that hash matches the recomputed one, and fails with "header hash does not match" otherwise (the earlier vendored build rejected any `hash` field as unknown). Dropping `hash` before passing RPC headers or transactions remains safe because the verifier recomputes it.

Why it matters: If a header's hash field disagrees with the recomputed hash, verifyScriptGroup fails with a request error ("header hash does not match") rather than running the script, and builds from before npm 0.2.0 failed on any hash field at all.

No existing lesson covers how ckb-vm-js treats a hash field on RPC headers.

Pattern

Prefer
const { hash: _, ...rest } = o as Record<string, unknown>;

Taken from the commit, shortened.

A test changed in the same commit

It sits next to the fix. We did not run it.

Concepts
Testing and devnet, Data encoding (molecule, hex, bigints)
Evidence
Checked by the owner: checked by the owner of the project it came from, who is also the publisher of these lessons
First seen
2026-11-17
Last changed
2026-11-17
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 Developer tooling

All 35 in this topic

Checked by @LusoCryptoLabs (owner of the project), 2026-11-19.

Do you maintain a project this lesson came from? Confirm or correct it

Cite this lesson
LusoCryptoLabs, "ckb-vm-js 0.2.0 (npm) checks header hash instead of rejecting the field", CKB lessons, https://pulse.lusocryptolabs.com/learned/tooling/ckb-vm-js-0-2-0-npm-checks-header-hash-instead-of-rejecting, CC BY 4.0, last changed 2026-11-17.

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.