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.

#Cell deps and script lookup

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

Página 3 de 3

Output type scripts need cell deps too, including the native DAO typeBásicoDe uma correção

CKB runs the type script of every output (not only input locks and input types), so a transaction that creates a native DAO deposit must include the DAO type's code cell (genesis tx0 index 2) as a cell dep, or the node rejects it with ScriptNotFound on Outputs[i].Type. Pre-send checks that only verify deps for input locks will miss this; check every input lock, input type and output type, deduplicated by code_hash and hash_type.

#Cell deps and script lookup #Transaction building and fees · Fontes (1) · 2026-10-05

Delegating script validation via exec to a hash bound cell depPráticoDe uma correção

This lifecycle type script stores a 32 byte data hash in its args, scans cell deps with load_cell_data_hash to find exactly one match (rejecting duplicates), then calls ckb_std syscalls::exec on that dep, which keeps the current Script context (GroupInput, GroupOutput, args) for the child. Because exec only returns when it fails, any code after the call must return an error instead of falling through to success.

#Cell deps and script lookup #Type ID and upgrades · Fontes (1) · 2026-10-04

Derive devnet Spore and system script cell deps from a fresh OffCKB exportPráticoVista outra vez

Do not hardcode devnet code hashes and cell dep out points (secp256k1, Spore, cluster) in an example: they come from the local OffCKB devnet and can drift when OffCKB's bundled scripts change. Export them with `offckb system-scripts --network devnet --export-style ccc` before start, fail if a needed script lacks codeHash, hashType or a cellDep outPoint, and build both the CCC client config and the Spore SDK lumos config from that one file.

#Cell deps and script lookup #Testing and devnet · Fontes (2) · 2026-09-29

Use the secp256k1 sighash dep group, not the bare code cell, as the lock depPráticoDe uma correção

When a hand-built transaction spends a secp256k1_blake160_sighash_all cell, it needs a cell dep for that lock. That dep should be the genesis dep group (dep_type dep_group), not the bare code cell in genesis tx0, because the lock also loads the secp256k1_data table from a second cell. With only the code cell, ScriptNotFound goes away but the lock then fails inside execution.

#Cell deps and script lookup #Transaction building and fees · Fontes (2) · 2026-09-25

Check that a derived successor type args match the spent cell's type argsPráticoDe uma correção

When a successor cell's type args are derived from other data (such as a config commitment) instead of copied from the spent input, compare them with the input cell's own type args before building. A mismatch (for example a config cell paired with a shard from another round) puts the input's type script group in the transaction with no output, so the type script runs as a burn and typically fails with an opaque error code. Read output.type.args during cell discovery and throw a clear client error on mismatch.

#Transaction building and fees #Cell deps and script lookup · Fontes (1) · 2026-09-23

Absence of on-chain references does not mean a code cell is safe to consumePráticoDe uma correção

Before consuming a deployed code cell, search live cells for its data hash as lock and type script code hash (prefix mode, hash types data, data1 and data2), and compare its data hash (blake2b with personalization ckb-default-hash) against the binaries you currently build. Zero references does not mean superseded: a contract unchanged by a rebuild has no users yet and is still the live deployment. This search does not see type ID references or cell dep use, so treat a cell that anything may resolve by type ID or as a dep as still needed.

#Type ID and upgrades #Indexer queries and cell collection #Cell deps and script lookup · Fontes (1) · 2026-09-20

Restrict script hashType to data, type, data1, data2 when loading configPráticoDe uma correção

CKB hash_type encodes as data=0, type=1, data1=2, data2=4 (no value 3), so a config loader should reject any hashType string outside data/type/data1/data2 rather than map it loosely. A wrong code hash or hash type makes cell discovery watch the wrong cells and silently return empty results.

hash_type validation, not covered

#Cell deps and script lookup #Data encoding (molecule, hex, bigints) · Fontes (1) · 2026-09-18

Página 3 de 3

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.