Todas as lições · CKB node, RPC and indexer · Começa aqui · Glossário
Check chain-wide script users before consuming a deployed code cellPráticoVerificada pelo dono
Verificada pelo dono · Verificação: certa · Verificada em 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.
Porque importa: 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.
Padrão
script: { code_hash: codeHash, hash_type: hashType, args: "0x" }, script_type: scriptType, script_search_mode: "prefix"Tirado do commit, encurtado.
- Conceitos
- Cell deps and script lookup, Indexer queries and cell collection, Type ID and upgrades
- Evidência
- Verificada pelo dono: verificada pelo dono do projeto de onde veio, que também publica estas lições
- Vista pela primeira vez
- 2026-09-18
- Última mudança
- 2026-10-10
- Última verificação
- 2026-11-19
- Verificação contra o commit
- certa: a lição sai do commit e continua a valer no código de hoje
Fontes (2)
- 2026-09-18 · toastmanAu/daowow · mais deste projeto
- 2026-10-10 · LusoCryptoLabs/ckb-pulse · mais deste projeto
Mais sobre 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
Verificada por @LusoCryptoLabs (dono do projeto), 2026-11-19.
Manténs um projeto de onde esta lição veio? Confirma ou corrige
Citar esta lição
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.