Spore(type)约束Spore (type) Constraints

来源:sporeprotocol/spore-contract / contracts/spore/src/entry.rs + lib/utils + lib/errors · mainnet 0x4a4d…b9f5(data1)/ testnet v2 0x685a…0a0d、v1 0xbbad…3494(data1)(spore-sdk)Source: sporeprotocol/spore-contract / contracts/spore/src/entry.rs + lib/utils + lib/errors · mainnet 0x4a4d…b9f5 (data1) / testnet v2 0x685a…0a0d, v1 0xbbad…3494 (data1) (spore-sdk)
Type 脚本Type scriptNFT / DOBNFT / DOB主网Mainnet测试网Testnet开源Open source社区Community

0 → 1铸造 MintMint

Inputs 输入Inputs
tx.inputs[0]任意 cell(用于计算 spore_id)any cell (used to derive spore_id)
可选:cluster 授权optional: cluster authorizationcluster cell 在输入+输出 或 cluster 的 lock 在输入+输出(lock proxy) 或 cluster agentcluster cell in inputs+outputs or the cluster's lock in inputs+outputs (lock proxy) or a cluster agent
➜
Outputs 输出Outputs
spore cellCell{ type: { codeHash: SPORE, hashType: data1, args: spore_id = type_id(inputs[0], i) }, data: SporeData{ content_type: "image/png"…, content: bytes, cluster_id: Some(32B)? } }
data:SporeData(molecule table)data: SporeData (molecule table)
content_typeBytes
contentBytes
cluster_id?BytesOpt
  • content_type Bytes MIME,可带 ;immortal=true、mutant[]=…MIME, may carry ;immortal=true, mutant[]=… 非空且可解析non-empty and parsable (64 / 80–87)
  • content Bytes NFT 内容NFT content 非空;multipart 需含 --boundarynon-empty; multipart must contain --boundary (66 / 69)
  • cluster_id? BytesOpt 所属 cluster 的 type argstype args of the owning cluster cluster cell 在 cell_depscluster cell in cell_deps (6 / 7)

限制Constraints

  • group:: 输出 ≤ 1outputs ≤ 1 (67)
  • data:: 是合法 SporeDatais a valid SporeData (62)
  • args[0..32] = blake2b(inputs[0] ‖ 输出序号 u64)= blake2b(inputs[0] ‖ output index u64) (63)
  • cluster_id:: cell_deps 有该 cluster;需 cluster 或其 lock(或 agent)同时在输入输出that cluster is in cell_deps; the cluster or its lock (or agent) must be in both inputs and outputs (6 / 7)
  • mutant:: content_type 声明的每个 mutant 都在 cell_deps,执行扩展并支付费用;cluster 要求的 mutant 必须被引用every declared mutant is in cell_deps, runs and is paid; the cluster's required mutant must be applied (71 / 72 / 73 / 74)
  • witness:: co-build Message 中恰有一个本脚本的 SporeAction,字段与 cell 一致(HEAD 源码;已部署版本可能不同,未核实)exactly one SporeAction for this script in the co-build Message, fields match the cell (HEAD source; deployed version may differ, unverified) (8–13)

1 → 1转移 TransferTransfer

Inputs 输入Inputs
sporeCell{ lock: A, type: SPORE(id), data: D }
➜
Outputs 输出Outputs
sporeCell{ lock: B, type: SPORE(id), data: D }

限制Constraints

  • group:: 输入 ≤ 1、输出 ≤ 1inputs ≤ 1, outputs ≤ 1 (67 / 68)
  • data:: 字节完全相同byte-identical (61)
  • witness:: co-build Message 中恰有一个本脚本的 SporeAction,字段与 cell 一致(HEAD 源码;已部署版本可能不同,未核实)exactly one SporeAction for this script in the co-build Message, fields match the cell (HEAD source; deployed version may differ, unverified) (8–13)

1 → 0销毁 BurnBurn

Inputs 输入Inputs
sporeCell{ type: SPORE(id), data: D }
➜
Outputs 输出Outputs
outputs不含该 sporeno cell with this spore

限制Constraints

  • content_type:: 不能带 immortal=truemust not have immortal=true (65)
  • witness:: co-build Message 中恰有一个本脚本的 SporeAction,字段与 cell 一致(HEAD 源码;已部署版本可能不同,未核实)exactly one SporeAction for this script in the co-build Message, fields match the cell (HEAD source; deployed version may differ, unverified) (8–13)
部署与来源Deployments & source 未核验unverified
源码source sporeprotocol/spore-contract@9a6010e4 · contracts/spore/src/entry.rs · lib/utils · lib/errors/src/error.rs (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 未核验unverified no binary or checksum at the recorded commit matched the deployed data hash (reproducible build not attempted)
0x4a4dce1df3…7132b9f5: listed in deployment/migration/mainnet/spore/2024-01-25-0.2.2-beta.1.json
0x685a602193…02130a0d: listed in deployment/migration/testnet/spore/2024-03-16-0.2.2-beta.2.json
0xbbad126377…6c133494: listed in deployment/frozen/testnet.toml
网络networkcode_hashcell_deptype_id args数据哈希data hash部署交易deploy tx
mainnet0x4a4dce1df3dffff7f8b2cd7dff7303df3b6150c9788cb75dcf6747247132b9f5 data10x96b198fb5d…a1b69824:0 code—0x4a4dce1df3…7132b9f50x96b198fb5d…a1b69824 #12042082
testnet0x685a60219309029d01310311dba953d67029170ca4848a4ff638e57002130a0d data10x5e8d2a517d…7d9d5a1f:0 code0xff279a6deb…a234428a0x685a602193…02130a0d0x5e8d2a517d…7d9d5a1f #12606776
testnet0xbbad126377d45f90a8ee120da988a2d7332c78ba8fd679aab478a19d6c133494 data10xfd694382e6…fc37fd19:0 code0x4b4e91f744…e0dae6fe0xbbad126377…6c1334940xfd694382e6…fc37fd19 #10228288
mainnet0xcfba73b58b6f30e70caed8a999748781b164ef9a1e218424a6fb55ebf641cb33 type0xb88032a061…3d960c6d:0 code0x62312cd846…13e0e3de0x45721f0b3b…45e1d6cd0xb88032a061…3d960c6d #15198802
testnet0x0b1f412fbae26853ff7d082d422c2bdd9e2ff94ee8aaec11240a5b34cc6e890f type0x306961e0eb…5e32dc6f:0 code0x80f0d4bf6b…5c36f6800x0766968599…2aa759270x306961e0eb…5e32dc6f #14415430
链上数据核对于 on-chain data checked 2026-10-20
错误码(lib/errors):5 InvalidClusterData · 6 ClusterCellNotInDep · 7 ClusterOwnershipVerifyFailed · 8–13 co-build · 60 BoundaryEncoding · 61 ModifySporePermanentField · 62 InvalidSporeData · 63 InvalidSporeID · 64 InvalidContentType · 65 DestroyImmortalNFT · 66 EmptyContent · 67 ConflictCreation · 68 MultipleSpend · 69 InvalidMultipartContent · 70 MIMEParsingError · 71–74 extension · 80–87 MIMEError codes (lib/errors): 5 InvalidClusterData · 6 ClusterCellNotInDep · 7 ClusterOwnershipVerifyFailed · 8–13 co-build · 60 BoundaryEncoding · 61 ModifySporePermanentField · 62 InvalidSporeData · 63 InvalidSporeID · 64 InvalidContentType · 65 DestroyImmortalNFT · 66 EmptyContent · 67 ConflictCreation · 68 MultipleSpend · 69 InvalidMultipartContent · 70 MIMEParsingError · 71–74 extension · 80–87 MIME
spore-sdk 还列出 tag 为 did 的 Spore 部署(mainnet 0xcfba…cb33 / testnet 0x0b1f…890f,type),本解码器按 Spore 解析spore-sdk also lists a Spore deployment tagged did (mainnet 0xcfba…cb33 / testnet 0x0b1f…890f, type); the decoder treats it as Spore
GitHub · gpBlockchain/ckb-contract-flow-html