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
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)
- 2026-11-08 · LusoCryptoLabs/ckb-ward · more from this project
More about Wallets and signing
- Binding an off-chain lock proof to the live cell deps it ran with
- JoyID sub key signatures depend on the live CoTA cell dep holding the sub key root
- Use the secp256k1 sighash dep group, not the bare code cell, as the lock dep
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.