CKB Pulse

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

Prefer
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.

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)

More about CCC (TypeScript SDK)

All 33 in this topic

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.

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.