全部经验 · CKB node, RPC and indexer · 从这里开始 · 术语表
Check chain-wide script users before consuming a deployed code cell实践由所有者核对
由所有者核对 · 核对结果:正确 · 核对于 2026-11-19
Before consuming a deployed code cell, call indexer get_cells across the whole chain with script_search_mode "prefix" and args "0x", once as lock and once as type. Query the cell's data hash with hash_type data, data1 and data2, and for a Type ID cell also its type script hash with hash_type type. Zero results only means no live cell uses the binary right now. Consuming the cell is irreversible, and a Type ID identity cannot be recreated, so treat unused Type ID cells with extra caution.
为什么重要: If you only check your own wallet's cells, you can consume a binary that someone else's live cells still depend on, and those cells become unspendable. Consuming a Type ID cell destroys an identity that cannot be recreated.
代码模式
script: { code_hash: codeHash, hash_type: hashType, args: "0x" }, script_type: scriptType, script_search_mode: "prefix"摘自提交,已缩短。
- 概念
- Cell deps and script lookup, Indexer queries and cell collection, Type ID and upgrades
- 证据
- 由所有者核对: 由其来源项目的所有者核对,该所有者同时也是这些经验的发布者
- 首次出现
- 2026-09-18
- 最近改动
- 2026-10-10
- 最近核对
- 2026-11-19
- 对照提交的核对结果
- 正确:这条经验出自该提交,并且在今天的代码中仍然成立
来源(2)
- 2026-09-18 · toastmanAu/daowow · 这个项目的更多经验
- 2026-10-10 · LusoCryptoLabs/ckb-pulse · 这个项目的更多经验
更多关于CKB node, RPC and indexer
- Search for a script's cells under both its data hash and its type id code hash
- Filtering get_cells for plain, typeless, empty funding cells
- get_live_cell may return "unknown" rather than "dead" for a spent output
核对人: @LusoCryptoLabs (项目所有者), 2026-11-19.
引用这条经验
LusoCryptoLabs, "Check chain-wide script users before consuming a deployed code cell", CKB lessons, https://pulse.lusocryptolabs.com/learned/node/check-chain-wide-script-users-before-consuming-a-deployed-co, CC BY 4.0, last changed 2026-10-10.