CKB Contract Flow

Zero Lock(全零 code hash,不是合约)Zero Lock (all-zero code hash, not a contract)

来源:CKB 节点 nervosnetwork/ckb script/src/types.rs(TxData::extract_script) · code_hash 0x00…00,hash_type data(主网与测试网相同,CKB Explorer 注册表)Source: CKB node nervosnetwork/ckb script/src/types.rs (TxData::extract_script) · code_hash 0x00…00, hash_type data (same on mainnet and testnet, CKB Explorer registry)
Lock 脚本Lock script系统 / 创世System主网Mainnet测试网Testnet开源Open sourceNervos 官方Nervos
贡献者:Contributed by @mohanson @mohanson

给 AI agent:For AI agents: zero_lock.md · llms.txt

0 → 1创建:任何人都能把 cell 锁进 Zero LockCreate: anyone can put a cell under the Zero Lock

Inputs 输入Inputs
任意 inputany inputCell{ lock: 任意(由其自身 lock 授权) }Cell{ lock: any (authorised by its own lock) }
Outputs 输出Outputs
outputCell{ lock: { codeHash: 0x0000…0000, hashType: data, args: any } }
lock 只在 input 中执行,所以创建时不运行任何 Zero Lock 代码,也没有检查。Locks only run for inputs, so no Zero Lock code runs and nothing is checked when it is created.

1 → ✗花费:永远失败Spend: always fails

Inputs 输入Inputs
inputCell{ lock: { codeHash: 0x0000…0000, hashType: data } }
Outputs 输出Outputs
无法上链cannot be committed交易被节点拒绝the node rejects the tx

限制Constraints

  • code_hashhash_type 为 data/data1/data2 时,节点在 cell_deps 中找 blake2b(data) = code_hash 的 cell;没有任何数据的 hash 是全零,找不到for hash_type data/data1/data2 the node looks in cell_deps for a cell with blake2b(data) = code_hash; no data hashes to all zeros, so none is foundScriptNotFound
部署与来源Deployments & source 内置built-in
源码source
nervosnetwork/ckb@426736a4 · script/src/types.rs · script/src/error.rs (no contract code exists; behaviour comes from CKB script resolution (TxData::extract_script → ScriptError::ScriptNotFound) at this ckb commit)
二进制核验binary check
内置built-in no code cell: nothing hashes to the all-zero data hash; behaviour defined by the CKB node
未在链上找到部署no on-chain deployment resolved
链上数据核对于 on-chain data checked 2026-11-06
这不是“未开源合约”:链上不存在对应代码,行为完全由 CKB 节点的脚本解析规则决定,因此单独标注。This is not a closed-source contract: no code exists on chain; its behaviour is defined entirely by the CKB node's script resolution, so it is listed separately.
用途:常用作“销毁 / 永久锁定”的输出 lock(例如 UTXOSwap 文档里 LP Token Info cell 的 lock 是 all zero)。CKB Explorer 注册表在 2026-11-06 显示主网有约 84.03 亿 CKB 位于该 lock 下。Use: a common burn / lock-forever output lock (e.g. the UTXOSwap docs give the LP Token Info cell an all-zero lock). On 2026-11-06 the CKB Explorer registry showed about 8.403 billion CKB under this lock on mainnet.
没有可花费的测试交易:只出现在 output 中,解码器只给 input 中的 lock 建组。No spending test tx exists: it only ever appears in outputs, and the decoder only groups locks found in inputs.