iCKB owned_owner(lock + type)约束iCKB owned_owner (lock + type) Constraints

来源:ickb/contracts / scripts/contracts/owned_owner/src · mainnet code_hash 0xacc7…1bd0(data1)Source: ickb/contracts / scripts/contracts/owned_owner/src · mainnet code_hash 0xacc7…1bd0 (data1)
Lock 脚本Lock scriptDeFiDeFi主网Mainnet开源Open source社区Community

0 → 2创建:取款请求 + owner 凭证Create: withdrawal request + owner token

Inputs 输入Inputs
iCKB 存款等iCKB deposit etc.Cell{ lock: ICKB_LOGIC, type: NERVOS_DAO }
➜
Outputs 输出Outputs
owned(第 i 个输出)owned (output i)Cell{ lock: OWNED_OWNER, type: NERVOS_DAO, data: block number ≠ 0 }
owner(第 j 个输出)owner (output j)Cell{ lock: user, type: OWNED_OWNER, data: owned_distance = i − j (i32) }
owner data:OwnedOwnerData(struct 4B)owner data: OwnedOwnerData (struct 4B)
owned_distance4B
  • owned_distance 4B owned cell 相对 owner cell 的序号偏移 i32 LEindex offset of the owned cell relative to the owner i32 LE 恰好指向一个 owned cellpoints to exactly one owned cell (8)

限制Constraints

  • owned:: lock = 本脚本的 cell 必须是 DAO 取款请求a cell locked by this script must be a DAO withdrawal request (6)
  • cell:: 不能同时 lock = type = 本脚本not both lock and type = this script (7)
  • pairing:: 输出中每个 owned 恰有一个 owner 指向它(序号 + distance)in outputs each owned has exactly one owner pointing to it (index + distance) (8)

2 → 0领取:用 owner 解锁取款请求Claim: unlock the withdrawal request with the owner

Inputs 输入Inputs
ownedCell{ lock: OWNED_OWNER, type: NERVOS_DAO } @ OutPoint(tx, i)
ownerCell{ lock: user(签名), type: OWNED_OWNER, data: distance } @ OutPoint(tx, j)Cell{ lock: user (signs), type: OWNED_OWNER, data: distance } @ OutPoint(tx, j)
➜
Outputs 输出Outputs
提取的 CKBwithdrawn CKB任意(DAO 规则另行检查)any (DAO rules checked separately)

限制Constraints

  • pairing:: 输入中按 OutPoint:owned 的 (tx, i) = owner 的 (tx, j + distance),一一对应in inputs by OutPoint: owned (tx, i) = owner (tx, j + distance), one to one (8)
  • owner data ≥ 4 字节≥ 4 bytes (4)
部署与来源Deployments & source 已核验verified
源码source ickb/contracts@c951927e · scripts/contracts/owned_owner/src (default-branch HEAD recorded at backfill 2026-10-21; spec/plugin were written from the default branch shortly before (exact read commit not recorded))
二进制核验binary check 已核验verified deployed data hash matches a binary / checksum in the repo at the recorded commit
0xacc79e07d1…aa381bd0: listed in scripts/deployment/mainnet/migrations/2024-09-12-151119.json; listed in scripts/deployment/testnet/migrations/2024-09-12-141730.json; blake2b of scripts/build/release/owned_owner
网络networkcode_hashcell_deptype_id args数据哈希data hash部署交易deploy tx
mainnet0xacc79e07d107831feef4c70c9e683dac5644d5993b9cb106dca6e74baa381bd0 data10x621a6f38de…5d3ed165:0 dep_group—0xacc79e07d1…aa381bd00xd730919138…29dc8f44 #14010067
链上数据核对于 on-chain data checked 2026-10-20
错误码:1–4 系统 · 5 NotEmptyArgs · 6 NotWithdrawalRequest · 7 ScriptMisuse · 8 MismatchError codes: 1–4 syscall · 5 NotEmptyArgs · 6 NotWithdrawalRequest · 7 ScriptMisuse · 8 Mismatch
作用:让任何人都能代用户发起 DAO 取款,而只有 owner cell 的持有者能领取Purpose: anyone can create a DAO withdrawal for a user, but only the owner-cell holder can claim it
GitHub · gpBlockchain/ckb-contract-flow-html