CKB Pulse

全部经验 · 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)

更多关于CKB node, RPC and indexer

查看此主题的全部 45 条

核对人: @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.

取自公开提交,并对照每条经验的来源提交和项目当前代码做了核对。使用前请先读来源。 文本采用 CC BY 4.0:请署名 LusoCryptoLabs, CKB lessons,并附上经验的链接。 想修改或撤下某条经验?请提交 issue。