CKB Pulse
Lessons

What CKB learned

Start here · Glossary · Test yourself · Feed

Checked by the owner

21 lessons found. All lessons

Page 1 of 2

send_transaction error -1111 (PoolRejectedRBF) is a conflict, not "already in pool"WorkingChecked by the owner

CKB's send_transaction returns -1107 when the same tx is already in the pool, but -1111 (PoolRejectedRBF) when a different pool tx spends one of its inputs and this tx cannot replace it. Treating -1111 like -1107 makes a client resend a tx whose input is gone and only notice the failure much later. Fiber now reports it as a conflict (failing a funding tx at once) while closing txs keep the old handling.

#Network and RPC reliability #Transaction building and fees · Sources (2) · 2026-11-18

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

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.

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

#Testing and devnet #Data encoding (molecule, hex, bigints) · Sources (1) · 2026-11-17

Pass wasm bytes to ckb-vm-js createVerifier in NodeWorkingChecked by the owner

In Node, calling ckb-vm-js createVerifier() with no arguments fails with "fetch failed" because it cannot fetch its .wasm from a file URL. Read the bytes from the package's ckb-vm-js/wasm export (via import.meta.resolve and readFile) and pass them as createVerifier({ wasm }).

New Node loading detail for ckb-vm-js wasm.

#Testing and devnet · Sources (1) · 2026-11-17

Saved transaction test vectors go stale when their cell deps are spentWorkingChecked by the owner

A saved CKB transaction lists its cell deps by out point. A replay that resolves those deps as live cells, as a node does when it verifies a new transaction, stops working once a lock upgrade or redeployment spends a dep cell, although neither the saved transaction nor the verifier changed. A replay test should tell that case (a dep that is no longer live) apart from a real verification failure, and skip the vector with a note instead of reporting a defect.

#Testing and devnet #Cell deps and script lookup · Sources (1) · 2026-11-09

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

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

#Cell deps and script lookup · Sources (1) · 2026-11-08

CCC EVM and Bitcoin signers pass the exact signed text through signMessageRawWorkingChecked by the owner

In CCC, the EVM and Bitcoin signers' signTransaction builds the text to sign and passes it to this.signMessageRaw. A dApp can temporarily replace signMessageRaw on the signer instance, record the argument, call the original, and restore it afterwards, to show users the text the wallet will sign. Omnilock in Ethereum display mode (auth flag 0x12) passes "CKB transaction: 0x…" and Bitcoin signers pass "CKB (Bitcoin Layer) transaction: 0x…". PW-lock and Omnilock with flag 0x01 pass a bare 32 byte hash. This relies on CCC internals, so recheck it when upgrading.

#Witnesses and signatures · Sources (1) · 2026-11-07

Adding a wallet missing from CCC's connector via a SignersController subclassWorkingChecked by the owner

To list a wallet that CCC's connector does not include yet, subclass ccc.SignersController (from @ckb-ccc/connector-react) and override addRealSigners: call this.addSigners(name, icon, [{ name: "CKB", signer }], context) with a ccc.Signer for that wallet, then await super.addRealSigners(context). Pass an instance to ccc.Provider as signersController. Wallets are shown in the order they are added, so adding yours before the super call puts it ahead of CCC's own. The Khie entry is drawn by the connector above that list and is not part of it; the hide-khie attribute removes it.

Order and the Khie entry checked against the CCC source at e10b99d (@ckb-ccc/ccc 1.3.7, connector 2.4.0): packages/ccc/src/signersController.ts (addSigner appends) and packages/connector/src/scenes/selecting/wallets.ts.

#Witnesses and signatures · Sources (1) · 2026-11-06

CCC EVM signer exposes several lock addresses via getAddressObjsWorkingChecked by the owner

A CCC signer for MetaMask can control more than one CKB lock (Omnilock addresses and the legacy PW-lock address used by Portal Wallet), and getRecommendedAddressObj returns only one of them. When assets such as Nervos DAO deposits may sit under any of them, call signer.getAddressObjs(), dedupe by script hash and check each, rather than assuming the recommended address holds the funds.

#Indexer queries and cell collection #Login and authorization · Sources (1) · 2026-11-06

Nervos DAO phase 1 withdrawing cells keep the DAO type; count deposits by 8 zero bytes of dataWorkingChecked by the owner

A Nervos DAO cell in phase 1 of withdrawal still has the DAO type script (code hash 0x82d76d...3f2e, hash_type type, args 0x), so filtering by type alone counts it as a deposit. Only cells whose output data is exactly 0x0000000000000000 are deposits; a withdrawing cell's data holds its deposit block number. The commit's testnet test shows a type-only count giving 500 CKB where the true deposit total is 300 CKB.

#Indexer queries and cell collection #Data encoding (molecule, hex, bigints) · Sources (2) · 2026-11-06

JoyID sub key signatures depend on the live CoTA cell dep holding the sub key rootAdvancedChecked by the owner

A JoyID sub key (second device) signature is checked by the JoyID lock against the sub key root held in the account's CoTA cell, which the transaction carries as a cell dep. Adding a device spends that CoTA cell and creates a new one with a new root. Two separate things follow: a transaction that still lists the old CoTA out point has a cell dep that is no longer live, and the lock run against the old root data does not accept the sub key signature.

JoyID specific: sub key root lives in the CoTA cell dep.

#Cell deps and script lookup #Witnesses and signatures · Sources (1) · 2026-11-06

Binding an off-chain lock proof to the live cell deps it ran withAdvancedChecked by the owner

When an off-chain signature proof is verified by running the lock against cell deps read live from the chain, record every out point those deps resolved to, dep group members included. Treat the resulting authorization as valid only while all of those cells are still live. A lock upgrade, a redeployment, or a key rotation or recovery in a lock that keeps its keys in a dep cell spends one of them, and the owner must prove again.

#Cell deps and script lookup #Login and authorization · Sources (1) · 2026-11-04

ckb-std C shim needs a RISC-V C toolchain (clang) in CIWorkingChecked by the owner

ckb-std compiles a C shim for riscv64imac-unknown-none-elf via cc-rs, which by default looks for riscv64-unknown-elf-gcc and fails with ToolNotFound when that toolchain is missing in CI. Pointing cc-rs at clang and llvm-ar (which can target RISC-V) lets the contract build without the GCC cross toolchain.

#Testing and devnet · Sources (1) · 2026-11-02

Page 1 of 2

Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. JSON · Want a lesson changed or removed? Open an issue.