USDI Asset 约束(主网 = xUDT 二进制)USDI Asset Constraints (mainnet = xUDT binary)
来源:主网 code cell data hash = xUDT 0x50bd…1b95 → ckb-production-scripts/c/xudt_rce.c · mainnet 0xbfa3…6bfc / testnet 0xcc9d…7037,hash_type type(CKB Explorer 注册表)Source: mainnet code cell data hash = xUDT 0x50bd…1b95 → ckb-production-scripts/c/xudt_rce.c · mainnet 0xbfa3…6bfc / testnet 0xcc9d…7037, hash_type type (CKB Explorer registry)
0 → N发行 / 增发(owner 模式)Issue / Mint (owner mode)
Inputs 输入Inputs
某个 input:ownersome input: ownerCell{
lock: hash(lock) == args[0..32] // 默认
// flags 0x80000000:input type hash 也可
// flags 0x40000000:output type hash 也可
// flags 0x20000000:禁用 input lock 方式
}Cell{
lock: hash(lock) == args[0..32] // default
// flags 0x80000000: input type hash also accepted
// flags 0x40000000: output type hash also accepted
// flags 0x20000000: disables the input-lock method
}
Outputs 输出Outputs
output:xUDT celloutput: xUDT cellCell{
type: { codeHash: xUDT,
args: owner lock hash 32B [flags u32 LE] [extension data] },
data: amount u128 LE (16B) [extension data]
}
限制Constraints
- type.args≥ 32 字节≥ 32 bytes-1
- owner 模式owner mode满足任一启用的 owner 条件时跳过数量检查(扩展脚本仍执行)when any enabled owner condition holds, the amount check is skipped (extension scripts still run)
N → M转账 / 销毁Transfer / Burn
Inputs 输入Inputs
inputs:xUDT cell(同一 type)inputs: xUDT cells (same type)Cell{
type: { codeHash: xUDT, args: … },
data: amount_in u128 LE
}
Outputs 输出Outputs
outputs:xUDT cell(同一 type)outputs: xUDT cells (same type)Cell{
type: { codeHash: xUDT, args: … },
data: amount_out u128 LE
}
type.args 字节布局type.args byte layout
owner lock hash32B
flags4B u32 LE(可选)4B u32 LE (optional)
扩展数据extension data变长variable
- owner lock hash32Bowner 判定用 hashhash used for owner checks≥ 32B-1
- flags4B u32 LE(可选)4B u32 LE (optional)低位:0 无扩展 / 1 扩展在 args / 2 扩展在 witness;高 3 位:owner 模式开关low bits: 0 no extension / 1 extensions in args / 2 extensions in witness; top 3 bits: owner-mode switches去掉 owner 位后 ∈ {0,1,2}∈ {0,1,2} after masking owner bits44
- 扩展数据extension data变长variableflags=1:ScriptVec;flags=2:20 字节 blake160(witness 中的 ScriptVec)flags=1: ScriptVec; flags=2: 20-byte blake160 of the ScriptVec in the witnessflags=1 长度须与 ScriptVec 一致;flags=2 须为 20 字节且 hash 匹配flags=1 length must match the ScriptVec; flags=2 must be 20 bytes and the hash must match45 / 44 / 49
限制Constraints
- data长度 ≥ 16 字节,前 16 字节为 u128 LElength ≥ 16 bytes; first 16 bytes are u128 LE-2
- Σ amount累加不得溢出summation must not overflow-51
- Σ amount_in≥ Σ amount_out(非 owner 模式)≥ Σ amount_out (non-owner mode)-52
- 扩展脚本extension scripts每个扩展脚本的 validate 必须返回 0each extension script's validate must return 0具体错误码由扩展脚本决定error codes depend on the extension
部署与来源Deployments & source 未核验unverified
源码source
nervosnetwork/ckb-production-scripts@26b0b4f1 · c/xudt_rce.c · c/rce.h · build.rs (xUDT source; build.rs at this commit pins the xudt_rce binary hash 0x50bd8d66…1b95, which equals the mainnet USDI code cell data hash (pinned since abdcb117, 2023-03-01). Testnet USDI binary not matched.)
二进制核验binary check
未核验unverified no binary or checksum at the recorded commit matched the deployed data hash (reproducible build not attempted)
| 网络network | code_hash | cell_dep | type_id args | 数据哈希data hash | 部署交易deploy tx |
|---|---|---|---|---|---|
| mainnet | 0xbfa35a9c38a676682b65ade8f02be164d48632281477e36f8dc2f41f79e56bfc type | 0xf6a5eef651…f109e20d:0 code | 0x9105ea6983…27d211c4 | 0x50bd8d6680…e78a1b95 | 0xf6a5eef651…f109e20d #14861099 |
| testnet | 0xcc9dc33ef234e14bc788c43a4848556a5fb16401a04662fc55db9bb201987037 type | 0xaec423c2af…ac204fee:0 code | 0xf0bad05412…6e1d0f0b | 0x28a734e118…4dcc94d8 | 0xaec423c2af…ac204fee #15880637 |
链上数据核对于 on-chain data checked 2026-11-06
核验结论:清单把 USDI 标为“未开源”。链上核验发现主网 USDI 的 Type ID code cell(0xf6a5eef6…e20d:0,type_id args 0x9105ea69…11c4)中的二进制 blake2b = 0x50bd8d66…1b95,与 RFC 0052 的 xUDT data1 code_hash 完全相同,所以主网 USDI 就是 xUDT 合约(开源),只是通过另一个 Type ID 引用。下面的卡片沿用 xUDT 页面的规则。Verification: the list marks USDI as closed source. On chain, the binary in the mainnet USDI Type ID code cell (0xf6a5eef6…e20d:0, type_id args 0x9105ea69…11c4) hashes (blake2b) to 0x50bd8d66…1b95, identical to the RFC 0052 xUDT data1 code_hash. So mainnet USDI IS the open-source xUDT script, referenced through a different Type ID. The cards below reuse the xUDT rules.
测试网 USDI(0xcc9d…7037)的 code cell 数据 hash 是 0x28a734e1…94d8,不是 xUDT,也未在 ckb-production-scripts 历史中找到;测试网只识别、不检查。The testnet USDI (0xcc9d…7037) code cell data hash is 0x28a734e1…94d8, which is not xUDT and was not found in ckb-production-scripts history; testnet is identified only, not checked.
Type ID 可升级:若发行方替换主网 code cell,上述结论会失效(check-deployments 会报告 data hash 变化)。官网 https://www.interpaystellar.com/(Explorer 注册表)。Type ID is upgradable: if the issuer replaces the mainnet code cell this conclusion no longer holds (check-deployments reports the data-hash change). Website https://www.interpaystellar.com/ (Explorer registry).
错误码数值来自 c/rce.h 枚举(ERROR_INVALID_FLAG=44,ERROR_INVALID_ARGS_FORMAT=45,ERROR_HASH_MISMATCHED=49);以 master 源码为准,已部署版本可能略有差异Numeric error codes come from the c/rce.h enum (ERROR_INVALID_FLAG=44, ERROR_INVALID_ARGS_FORMAT=45, ERROR_HASH_MISMATCHED=49); based on master, the deployed build may differ slightly
测试网 USDI(0xcc9d…7037)的 code cell 数据 hash 是 0x28a734e1…94d8,不是 xUDT,也未在 ckb-production-scripts 历史中找到;测试网只识别、不检查。The testnet USDI (0xcc9d…7037) code cell data hash is 0x28a734e1…94d8, which is not xUDT and was not found in ckb-production-scripts history; testnet is identified only, not checked.
Type ID 可升级:若发行方替换主网 code cell,上述结论会失效(check-deployments 会报告 data hash 变化)。官网 https://www.interpaystellar.com/(Explorer 注册表)。Type ID is upgradable: if the issuer replaces the mainnet code cell this conclusion no longer holds (check-deployments reports the data-hash change). Website https://www.interpaystellar.com/ (Explorer registry).
错误码数值来自 c/rce.h 枚举(ERROR_INVALID_FLAG=44,ERROR_INVALID_ARGS_FORMAT=45,ERROR_HASH_MISMATCHED=49);以 master 源码为准,已部署版本可能略有差异Numeric error codes come from the c/rce.h enum (ERROR_INVALID_FLAG=44, ERROR_INVALID_ARGS_FORMAT=45, ERROR_HASH_MISMATCHED=49); based on master, the deployed build may differ slightly