CKB Pulse

All lessons · Wallets and signing · Start here · Glossary

Lock code hashes differ between testnet and mainnet for Omnilock, JoyID, ACP and PW lockWorkingChecked by the owner

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

When identifying a wallet's lock by its code hash, Omnilock, JoyID, anyone-can-pay and PW lock have different code hashes on testnet and mainnet (per CCC's known scripts), while secp256k1 and multisig share one across networks. Code that compares against a single testnet hash will misclassify or fail to filter mainnet locks, so keep a hash per network (or look it up from the client's known scripts).

Why it matters: With only the testnet hashes, a mainnet Omnilock, JoyID, ACP or PW lock is not recognised, so it gets a generic 'lock 0x…' label and skips the lock-specific branches, such as reading the Omnilock mode flag or choosing what the wallet will show.

Pattern

Avoid
if (lock.codeHash === OMNILOCK) {

Taken from the commit, shortened.

Concepts
Cell deps and script lookup
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-08
Last changed
2026-11-08
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 Wallets and signing

All 23 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, "Lock code hashes differ between testnet and mainnet for Omnilock, JoyID, ACP and PW lock", CKB lessons, https://pulse.lusocryptolabs.com/learned/wallets/lock-code-hashes-differ-between-testnet-and-mainnet-for-omni, CC BY 4.0, last changed 2026-11-08.

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.