All lessons · CCC (TypeScript SDK) · Start here · Glossary
CCC custom client scripts must include AnyoneCanPay for SignerCkbPrivateKeyWorkingReproduced
Reproduced · Check: right · Checked 2026-11-19
On a devnet, if you construct a CCC client with a custom `scripts` map that overrides only `KnownScript.Secp256k1Blake160`, `SignerCkbPrivateKey` can still fail. This commit's comment says the signer also loads AnyoneCanPay metadata while classifying related locks, so it adds a `KnownScript.AnyoneCanPay` entry to the map even though no ACP input or cell dep is used.
Why it matters: Without an AnyoneCanPay entry in a custom scripts map, SignerCkbPrivateKey cannot resolve the ACP known script while it classifies related locks, so signing breaks even for a transaction that only uses secp256k1 locks.
Pattern
scripts:{[c.KnownScript.Secp256k1Blake160]:{codeHash:K,hashType:'type',cellDeps:[{cellDep:dep}]},[c.KnownScript.AnyoneCanPay]:acp}Taken from the commit, shortened.
A test changed in the same commit
It sits next to the fix. We did not run it.
- Ticoworld/QuotaCell:
policy/deps/ckb-c-stdlib/tests/ci.c
Reproduced by a test
A public test runs what this lesson says on @ckb-ccc/core 1.23.1, with no node. Anyone can run it.
tests/ccc/custom-scripts-need-anyone-can-pay.test.mjs
- Concepts
- Cell deps and script lookup, Testing and devnet
- Evidence
- Reproduced: reproduced by a public test
- First seen
- 2026-10-23
- Last changed
- 2026-10-23
- 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-10-23 · Ticoworld/QuotaCell · more from this project
More about CCC (TypeScript SDK)
- Registering NervosDao on devnet
- Hand-rolled Script hash: hash_type byte mapping and molecule offsets, checked against CCC
- Re-zero the witness lock before recomputing the sign message with getSignHashInfo
Do you maintain a project this lesson came from? Confirm or correct it
Cite this lesson
LusoCryptoLabs, "CCC custom client scripts must include AnyoneCanPay for SignerCkbPrivateKey", CKB lessons, https://pulse.lusocryptolabs.com/learned/ccc/ccc-custom-client-scripts-must-include-anyonecanpay-for-sign, CC BY 4.0, last changed 2026-10-23.