CKB Pulse
Lições

O que a CKB aprendeu

Começa aqui · Glossário · Testa-te · Feed

As lições estão escritas em inglês, por isso pesquise em inglês.

Verificada pelo dono

21 lições encontradas. Todas as lições

Página 1 de 2

send_transaction error -1111 (PoolRejectedRBF) is a conflict, not "already in pool"PráticoVerificada pelo dono

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 · Fontes (2) · 2026-11-18

ckb-vm-js 0.2.0 (npm) checks header hash instead of rejecting the fieldPráticoVerificada pelo dono

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) · Fontes (1) · 2026-11-17

Pass wasm bytes to ckb-vm-js createVerifier in NodePráticoVerificada pelo dono

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 · Fontes (1) · 2026-11-17

Saved transaction test vectors go stale when their cell deps are spentPráticoVerificada pelo dono

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 · Fontes (1) · 2026-11-09

Lock code hashes differ between testnet and mainnet for Omnilock, JoyID, ACP and PW lockPráticoVerificada pelo dono

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 · Fontes (1) · 2026-11-08

CCC EVM and Bitcoin signers pass the exact signed text through signMessageRawPráticoVerificada pelo dono

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 · Fontes (1) · 2026-11-07

Adding a wallet missing from CCC's connector via a SignersController subclassPráticoVerificada pelo dono

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 · Fontes (1) · 2026-11-06

CCC EVM signer exposes several lock addresses via getAddressObjsPráticoVerificada pelo dono

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 · Fontes (1) · 2026-11-06

Nervos DAO phase 1 withdrawing cells keep the DAO type; count deposits by 8 zero bytes of dataPráticoVerificada pelo dono

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) · Fontes (2) · 2026-11-06

JoyID sub key signatures depend on the live CoTA cell dep holding the sub key rootAvançadoVerificada pelo dono

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 · Fontes (1) · 2026-11-06

Binding an off-chain lock proof to the live cell deps it ran withAvançadoVerificada pelo dono

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 · Fontes (1) · 2026-11-04

ckb-std C shim needs a RISC-V C toolchain (clang) in CIPráticoVerificada pelo dono

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 · Fontes (1) · 2026-11-02

Página 1 de 2

Texto sob CC BY 4.0: dá crédito à LusoCryptoLabs, CKB lessons, com uma ligação para a lição. JSON · Queres que uma lição seja mudada ou retirada? Abre um issue.