TITLE: Spore Cell Data Structure Definition DESCRIPTION: Defines the data structure for a Spore Cell, including content type, content, and an optional cluster ID. It specifies the `type` script configuration with `SPORE_TYPE_DATA_HASH` and `SPORE_ID` arguments, and a user-defined `lock` script. All fields in a Spore Cell are immutable once created. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC.md#_snippet_0 LANGUAGE: YAML CODE: ``` data: content-type: Bytes # String Bytes content: Bytes # OPTIONAL cluster_id: Bytes type: hash_type: "data1" code_hash: SPORE_TYPE_DATA_HASH args: SPORE_ID lock: ``` LANGUAGE: APIDOC CODE: ``` Spore Cell Fields: content-type: type: Bytes (String Bytes) description: Hint text data of the formats in the content field, also can holds extension feature labels like TYPE/SUBTYPE;PARAM=VAL. It should follow the standard of MIME (RFC 2046). parameters: immortal: type: boolean default: false description: Defines whether this NFT is undestructible. Example: image/png;immortal=true content: type: Bytes description: This field contains the main content of the NFT. cluster_id: type: Bytes (Optional) description: An optional field used to denote the series or class collection of this Spore NFT item. Refer to the Spore Cluster Cell section for more details. type: hash_type: "data1" code_hash: SPORE_TYPE_DATA_HASH args: SPORE_ID (hash(this_transaction.inputs[0] | output_index_of_this_cell)) description: Script configuration for the cell type. lock: type: description: User-defined lock script. ``` ---------------------------------------- TITLE: Transfer Spore Token (CKB Transaction) DESCRIPTION: This YAML snippet demonstrates a CKB transaction structure for transferring a single Spore token from one holder to another. It shows the input Spore Cell with the original lock script and the output Spore Cell with the new lock script, indicating the change of ownership. Witnesses are required for input validation. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC.md#_snippet_7 LANGUAGE: yaml CODE: ``` Inputs: Spore Cell: Capacity: N CKBytes Data: content-type: "image/png" content: BYTES_OF_THE_IMAGE Type: hash_type: "data1" code_hash: SPORE_TYPE_DATA_HASH args: SPORE_ID Lock: code_hash: LOCK_HASH_1 args: LOCK_ARGS_1 <...> Outputs: Spore Cell: Capacity: N CKBytes Data: content-type: "image/png" content: BYTES_OF_THE_IMAGE Type: hash_type: "data1" code_hash: SPORE_TYPE_DATA_HASH args: SPORE_ID Lock: code_hash: LOCK_HASH_2 args: LOCK_ARGS_2 <...> Witnesses: ``` ---------------------------------------- TITLE: Minting a Single Spore Cell with PNG Content DESCRIPTION: This YAML transaction demonstrates how to issue a new Spore cell. It specifies the Spore's type, a user-defined lock, and embeds PNG image data along with its content-type. The `cluster_id` is intentionally left null for a standalone Spore. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC.md#_snippet_2 LANGUAGE: yaml CODE: ``` CellDep: <...> Inputs: Outputs: Spore Cell: Capacity: N CKBytes Type: hash_type: "data1" code_hash: SPORE_TYPE_DATA_HASH args: SPORE_ID Lock: Data: content-type: "image/png" content: BYTES_OF_THE_IMAGE cluster_id: null Witnesses: ``` ---------------------------------------- TITLE: Mutant Cell Data Structure (RFC) DESCRIPTION: This YAML snippet defines the proposed data structure for a Mutant cell, detailing its `Data`, `Type`, and `Lock` fields. It specifies that the Lua code resides in the `Data` field and the `Type` arguments can include a `MUTANT_ID` and an optional `MINIMAL_PAYMENT`. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/MUTANT.md#_snippet_5 LANGUAGE: YAML CODE: ``` Data: LUA_CODE_DATA_BYTES Type: hash_type: "data1" code_hash: SPORE_MUTANT_TYPE_HASH args: [] Lock: ``` ---------------------------------------- TITLE: Mint Multiple Spore Tokens (CKB Transaction) DESCRIPTION: This YAML snippet illustrates a CKB transaction structure for issuing multiple Spore tokens simultaneously. It details the required Cell Dependencies (Spore Type Script, Cluster Type Script, Cluster Cell), the input cells (Cluster Cell, other CKB cells), and the output cells, which include multiple new Spore Cells with distinct IDs and content, along with an updated Cluster Cell. Witnesses are required for input validation. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC.md#_snippet_6 LANGUAGE: yaml CODE: ``` CellDep: Cluster Cell: Type: hash_type: "data1" code_hash: CLUSTER_TYPE_DATA_HASH args: 0xbfca51165 Lock: code_hash: LOCK_HASH args: LOCK_ARGS Data: name: CLUSTER_NAME description: DESCRIPTION Inputs: Cluster Cell: Type: hash_type: "data1" code_hash: CLUSTER_TYPE_DATA_HASH args: 0xbfca51165 Lock: code_hash: LOCK_HASH args: LOCK_ARGS Data: name: CLUSTER_NAME description: DESCRIPTION Outputs: Spore Cell1: Capacity: N CKBytes Type: hash_type: "data1" code_hash: SPORE_TYPE_DATA_HASH args: SPORE_ID_1 Lock: Data: content-type: "image/png" content: BYTES_OF_THE_IMAGE1 cluster_id: 0xbfca51165 Spore Cell2: Capacity: N CKBytes Type: hash_type: "data1" code_hash: SPORE_TYPE_DATA_HASH args: SPORE_ID_2 Lock: Data: content-type: "image/png" content: BYTES_OF_THE_IMAGE2 cluster_id: null Spore Cell3: Capacity: N CKBytes Type: hash_type: "data1" code_hash: SPORE_TYPE_DATA_HASH args: SPORE_ID_3 Lock: Data: content-type: "plain/text" content: BYTES_OF_THE_TEXT cluster_id: 0xbfca51165 Cluster Cell: Type: hash_type: "data1" code_hash: CLUSTER_TYPE_DATA_HASH args: 0xbfca51165 Lock: code_hash: LOCK_HASH args: LOCK_ARGS Data: name: CLUSTER_NAME description: DESCRIPTION <...> Witnesses: ``` ---------------------------------------- TITLE: Applying Mutant to Spore via Content-Type DESCRIPTION: This YAML snippet illustrates how to apply a Mutant to a Spore by specifying its ID within the `content-type` field of the Spore's Data. It shows the structure for integrating a Mutant with a Spore cell, requiring the referenced mutant cell in `CellDep`. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/MUTANT.md#_snippet_1 LANGUAGE: YAML CODE: ``` Data: content-type: "image/png;mutant[]=MUTANT_ID" content: ... Type: code_hash: SPORE_TYPE_ID_V2 args: 0xSPORE_ID ``` ---------------------------------------- TITLE: Spore Cluster Cell Data Structure Definition DESCRIPTION: Defines the data structure for a Spore Cluster Cell, including its name and description. It specifies the `type` script configuration with `CLUSTER_TYPE_DATA_HASH` and `CLUSTER_ID` arguments, and a user-defined `lock` script. A Spore Cluster Cell is indestructible and immutable once created. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC.md#_snippet_1 LANGUAGE: YAML CODE: ``` data: name: Bytes # String Bytes description: Bytes # String Bytes type: hash_type: "data1" code_hash: CLUSTER_TYPE_DATA_HASH args: CLUSTER_ID lock: ``` LANGUAGE: APIDOC CODE: ``` Spore Cluster Cell Fields: name: type: Bytes (String Bytes) description: Represents the name of the Spore Cluster. description: type: Bytes (String Bytes) description: Provides a textual description of this Cluster. type: hash_type: "data1" code_hash: CLUSTER_TYPE_DATA_HASH args: CLUSTER_ID (hash(this_transaction.inputs[0] | output_index_of_this_cell)) description: Script configuration for the cell type, following the rules of Type ID script. lock: type: description: User-defined lock script. ``` ---------------------------------------- TITLE: Minting Spore with Cluster Association (Cluster as Input) DESCRIPTION: This transaction illustrates minting a Spore cell that references an existing Cluster. The Cluster cell itself is included in both the transaction's inputs and outputs, demonstrating its direct involvement in the Spore's creation and adherence to Cluster rules 2-4. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC.md#_snippet_3 LANGUAGE: yaml CODE: ``` CellDep: Cluster Cell: Type: hash_type: "data1" code_hash: CLUSTER_TYPE_DATA_HASH args: 0xbfca51165 Lock: code_hash: LOCK_HASH_1 args: LOCK_ARGS_1 Data: name: CLUSTER_NAME description: DESCRIPTION Inputs: Cluster Cell: Type: hash_type: "data1" code_hash: CLUSTER_TYPE_DATA_HASH args: 0xbfca51165 Lock: code_hash: LOCK_HASH_1 args: LOCK_ARGS_1 Data: name: CLUSTER_NAME description: DESCRIPTION Outputs: Cluster Cell: Type: hash_type: "data1" code_hash: CLUSTER_TYPE_DATA_HASH args: 0xbfca51165 Lock: code_hash: LOCK_HASH_1 args: LOCK_ARGS_1 Data: name: CLUSTER_NAME description: DESCRIPTION Spore Cell: Type: hash_type: "data1" code_hash: SPORE_V1_DATA_HASH # hash of Spore's type script data hash args: TYPE_ID Lock: Data: content-type: "image/png" content: BYTES_OF_THE_IMAGE cluster_id: "0xbfca51165" ``` ---------------------------------------- TITLE: Build Spore Contracts with Capsule DESCRIPTION: Commands to compile Spore contracts using Capsule, supporting debug, testnet release, and mainnet release modes. Requires Rust, Cross, and Capsule dependencies for successful compilation. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/README.md#_snippet_0 LANGUAGE: bash CODE: ``` $ capsule build # build in debug mode $ capsule build --release # build in release mode for testnet $ capsule build --release -- --features release_export # build in release mode for mainnet ``` ---------------------------------------- TITLE: Mutant Execution Modes and External Values (Opcode API) DESCRIPTION: This section details the three execution modes (opcodes) for Mutant scripts: minting, transfer, and melt. It specifies the external values made available to the Lua script in each mode, such as `spore_ext_mode`, `spore_output_index`, and `spore_input_index`, which define the script's execution context. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/MUTANT.md#_snippet_2 LANGUAGE: APIDOC CODE: ``` Opcode 0 (Minting Mode): spore_ext_mode = 0 spore_output_index: index of the Spore in outputs Opcode 1 (Transfer Mode): spore_ext_mode = 1 spore_input_index: index of the Spore in inputs spore_output_index: index of the Spore in outputs Opcode 2 (Melt Mode): spore_ext_mode = 2 spore_input_index: index of the Spore in inputs ``` ---------------------------------------- TITLE: Creating a New Spore Cluster Cell DESCRIPTION: This transaction outlines the process for creating a new Cluster cell. It defines the Cluster's type, a user-defined lock, and includes metadata such as its name and description. This new Cluster can then be referenced by Spore cells. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC.md#_snippet_5 LANGUAGE: yaml CODE: ``` Inputs: <...> Outputs: Spore Cluster Cell: Type: hash_type: "data1" code_hash: CLUSTER_TYPE_DATA_HASH args: CLUSTER_ID Lock: Data: name: "NAME_OF_CLUSTER" description: "THIS IS A DESCR FOR THIS CLUSTER" ``` ---------------------------------------- TITLE: Build and Deploy Spore Contracts DESCRIPTION: This snippet provides the general commands to build Spore contracts for either testnet or mainnet using 'capsule build', followed by instructions to navigate to the deployment directory and execute the 'deploy.sh' script. The script requires the contract name, CKB URL, and a CKB address as arguments. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/deployment/README.md#_snippet_0 LANGUAGE: bash CODE: ``` $ capsule build --release # build for testnet $ capsule build --release -- --features release_export # build for mainnet $ cd deployment $ ./deploy.sh ``` ---------------------------------------- TITLE: Mint Spore with Cluster Agent using Direct Input DESCRIPTION: Illustrates how a Cluster Agent Cell holder can mint a Spore by directly providing the Cluster Agent Cell as an input. The Spore Cell's data includes content type, content bytes, and cluster ID, with its type script defined by SPORE_TYPE_DATA_HASH. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC_PROXY_AGENT.md#_snippet_6 LANGUAGE: yaml CODE: ``` CellDeps: Inputs: Cluster Agent Cell A: Type: args: CLUSTER_ID_A code_hash: CLUSTER_AGENT_TYPE_HASH Lock: <...any other cells> Outputs: Spore Cell: Capacity: N CKBytes Data: content-type: "image/png" content: BYTES_OF_THE_IMAGE cluster: CLUSTER_ID_A Type: hash_type: "data1" code_hash: SPORE_TYPE_DATA_HASH # hash of Spore's type script data hash args: SPORE_ID Lock: Cluster Agent Cell A: Data: Hash(ClusterProxyCell.Type) Type: code_hash: CLUSTER_AGENT_TYPE_HASH args: CLUSTER_ID_A Lock: # for example, acp ``` ---------------------------------------- TITLE: Example Spore Contract Deployment Command DESCRIPTION: This example demonstrates a concrete usage of the 'deploy.sh' script to deploy the 'spore' contract. It specifies a testnet CKB URL and a sample CKB address, illustrating how to provide the required parameters for a successful deployment. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/deployment/README.md#_snippet_1 LANGUAGE: bash CODE: ``` $ ./deploy.sh spore https://testnet.ckbapp.dev/ ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq28phxutezqvjgfv5q38gn5kwek4m9km3cmajeqs ``` ---------------------------------------- TITLE: Example Lua Script for Spore Mutant DESCRIPTION: This Lua script demonstrates a basic Mutant behavior. It prints 'Hello, world!' and exits with a failure code equal to the output index if the Spore is not at `Output[0]`, showcasing conditional execution based on transaction context. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/MUTANT.md#_snippet_0 LANGUAGE: Lua CODE: ``` print("Hello, world!"); if spore_output_index > 0 then ckb.exit_script(spore_output_index) end ``` ---------------------------------------- TITLE: Run Spore Contract Tests with Capsule DESCRIPTION: Commands to execute native test cases for Spore contracts using Capsule, available in both debug and release modes. Tests are located in the `tests/` directory and verify contract functionality. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/README.md#_snippet_1 LANGUAGE: bash CODE: ``` $ capsule test # test in debug mode $ capsule test --release # test in release mode ``` ---------------------------------------- TITLE: Spore Contract Deployment TOML Configuration Example DESCRIPTION: This TOML configuration snippet illustrates how to define a contract cell, using 'cluster_agent' as an example. It shows settings for the contract name, enabling type ID, specifying the build file location, and configuring the lock script with 'code_hash', 'args', and 'hash_type'. It is crucial that the '' value matches the CKB address used during deployment. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/deployment/README.md#_snippet_2 LANGUAGE: toml CODE: ``` [[cells]] name = "cluster_agent" enable_type_id = true location = { file = "../build/release/cluster_agent" } [lock] code_hash = "0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8" args = hash_type = "type" ``` ---------------------------------------- TITLE: Mutant Type Args Structure DESCRIPTION: This YAML snippet illustrates the two possible structures for the Mutant cell's `args` field. It shows how the `Mutant ID` is always present, and an optional 1-byte field can be appended to specify a `CKByte minimum` payment, which is interpreted as `10^x` shannons. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/MUTANT.md#_snippet_6 LANGUAGE: YAML CODE: ``` <32bytes Mutant ID> <32bytes Mutant ID><1bytes CKByte minimum> ``` ---------------------------------------- TITLE: Mint Spore with Cluster Agent using Lock Proxy DESCRIPTION: Details the process of minting a Spore where the Cluster Agent Cell is associated with a Lock Proxy. An arbitrary cell, acting as the Lock Proxy Cell, is used as an input, sharing the same lock script as the Cluster Agent Cell. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC_PROXY_AGENT.md#_snippet_7 LANGUAGE: yaml CODE: ``` CellDeps: Cluster Agent Cell A: Data: Hash(Cluster_Proxy_Cell_Type) Type: args: CLUSTER_ID_A code_hash: CLUSTER_AGENT_TYPE_HASH Lock: args: code_hash: LOCK_CODE_HASH_A Inputs: Any Cell: # Lock Proxy Cell Lock: args: code_hash: LOCK_CODE_HASH_A <...any other cells> Outputs: Spore Cell: Capacity: N CKBytes Data: content-type: "image/png" content: BYTES_OF_THE_IMAGE cluster: CLUSTER_ID_A Type: hash_type: "data1" code_hash: SPORE_TYPE_DATA_HASH # hash of Spore's type script data hash args: SPORE_ID Lock: ``` ---------------------------------------- TITLE: Minting Spore with Cluster Association (Lock Proxy Cells) DESCRIPTION: This example demonstrates associating a Spore with a Cluster using 'Lock Proxy Cells' when the Cluster cell itself is not directly in inputs/outputs. It satisfies Cluster rule 5 by ensuring at least one cell with the Cluster's lock script exists in both inputs and outputs, acting as a proxy for the Cluster's lock. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC.md#_snippet_4 LANGUAGE: yaml CODE: ``` CellDep: Cluster Cell: Type: hash_type: "data1" code_hash: CLUSTER_TYPE_DATA_HASH args: 0xbfca51165 Lock: code_hash: LOCK_HASH_1 args: LOCK_ARGS_1 Data: name: CLUSTER_NAME description: DESCRIPTION Inputs: Cell 1: # Lock Proxy Cell Lock: code_hash: LOCK_HASH_1 args: LOCK_ARGS_1 Outputs: Cell 2: # Lock Proxy Cell Lock: code_hash: LOCK_HASH_1 args: LOCK_ARGS_1 Spore Cell: Type: hash_type: "data1" code_hash: SPORE_V1_DATA_HASH # hash of Spore's type script data hash args: TYPE_ID Lock: Data: content-type: "image/png" content: BYTES_OF_THE_IMAGE cluster_id: "0xbfca51165" ``` ---------------------------------------- TITLE: Transaction to Create Cluster Agent Cell (Direct Input) DESCRIPTION: Outlines a transaction for creating a Cluster Agent Cell. This method involves consuming an existing Cluster Proxy Cell in the inputs and then recreating it in the outputs, alongside the newly minted Cluster Agent Cell. This ensures the Cluster Proxy Cell remains available for future use while delegating minting rights. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC_PROXY_AGENT.md#_snippet_4 LANGUAGE: yaml CODE: ``` CellDeps: Cluster Proxy Cell: Data: CLUSTER_ID_A Type: code_hash: CLUSTER_PROXY_TYPE_HASH args: CLUSTER_PROXY_ID Lock: Inputs: Cluster Proxy Cell: Data: CLUSTER_ID_A Type: code_hash: CLUSTER_PROXY_TYPE_HASH args: CLUSTER_PROXY_ID Lock: <...any other cells> Outputs: Cluster Agent Cell: Data: Hash(ClusterProxyCell.Type) Type: code_hash: CLUSTER_AGENT_TYPE_HASH args: CLUSTER_ID_A Lock: Cluster Proxy Cell: Data: CLUSTER_ID_A Type: code_hash: CLUSTER_PROXY_TYPE_HASH args: CLUSTER_PROXY_ID Lock: <...any other cells> ``` ---------------------------------------- TITLE: Transaction to Create Cluster Proxy Cell (Direct Input) DESCRIPTION: Illustrates a transaction where a Cluster Proxy Cell is created by directly referencing an existing Cluster Cell in both the inputs and outputs. This method ensures the original Cluster Cell is not consumed but rather 'passed through', while a new Cluster Proxy Cell is minted, linking to it. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC_PROXY_AGENT.md#_snippet_1 LANGUAGE: yaml CODE: ``` CellDeps: Cluster Cell A: Data: <...> Type: args: CLUSTER_ID_A code_hash: CLUSTER_TYPE_HASH_A Lock: Inputs: Cluster Cell A: Type: args: CLUSTER_ID_A code_hash: CLUSTER_TYPE_HASH_A Lock: <...any other cells> Outputs: Cluster Cell A: Type: args: CLUSTER_ID_A code_hash: CLUSTER_TYPE_HASH_A Lock: Cluster Proxy Cell: Data: CLUSTER_ID_A Type: code_hash: CLUSTER_PROXY_TYPE_HASH args: CLUSTER_PROXY_ID_A Lock: # for example, acp ``` ---------------------------------------- TITLE: Transaction to Create Cluster Proxy Cell (Lock Proxy) DESCRIPTION: Demonstrates an alternative method for creating a Cluster Proxy Cell. Instead of directly consuming the Cluster Cell, this transaction uses an input cell with the same lock script as the target Cluster Cell. This allows the creation of a Cluster Proxy Cell without requiring the Cluster Cell itself to be in the transaction's inputs or outputs. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC_PROXY_AGENT.md#_snippet_2 LANGUAGE: yaml CODE: ``` CellDeps: Cluster Cell A: Type: args: CLUSTER_ID_A code_hash: CLUSTER_TYPE_HASH_A Lock: args: code_hash: LOCK_CODE_HASH_A Inputs: Any Cell: Lock: args: code_hash: LOCK_CODE_HASH_A <...any other cells> Outputs: Cluster Proxy Cell: Data: CLUSTER_ID_A Type: code_hash: CLUSTER_PROXY_TYPE_HASH args: CLUSTER_PROXY_ID Lock: # for example, acp <...any other cells> ``` ---------------------------------------- TITLE: Cluster Proxy Cell Structure Definition DESCRIPTION: Defines the conceptual structure of a Cluster Proxy Cell within the Spore Protocol. This cell's data holds the referenced cluster ID, its type script identifies it as a proxy, and its arguments can include a minimal payment. The `cluster_proxy_id` is derived from the hash of the first input and output index of its creation transaction. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC_PROXY_AGENT.md#_snippet_0 LANGUAGE: APIDOC CODE: ``` Cluster Proxy Cell: Data: REFERENCED_CLUSTER_ID Type: code_hash: CLUSTER_PROXY_TYPE_HASH args: [] Lock: ``` ---------------------------------------- TITLE: Cluster Agent Cell Structure Definition DESCRIPTION: Defines the conceptual structure of a Cluster Agent Cell. This special cell allows its holder to mint Spore within a referenced Cluster. Its data field stores the type hash of the associated Cluster Proxy Cell, and its type script includes the referenced cluster ID. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC_PROXY_AGENT.md#_snippet_3 LANGUAGE: APIDOC CODE: ``` Cluster Agent Cell: Data: Type Hash of Referenced Cluster Proxy Type: code_hash: CLUSTER_AGENT_TYPE_HASH args: REFERENCED_CLUSTER_ID Lock: ``` ---------------------------------------- TITLE: Create Cluster Agent Cell via Payment Appearance DESCRIPTION: Describes how to create a Cluster Agent Cell by making a payment to the Cluster Proxy owner. This method involves transferring capacity to the same lock address as the Cluster Proxy, requiring a payment cell with sufficient capacity (N >= MINIMAY_PAYMENT_A). SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC_PROXY_AGENT.md#_snippet_5 LANGUAGE: yaml CODE: ``` CellDeps: Cluster Proxy Cell: Data: CLUSTER_ID_A Type: code_hash: CLUSTER_PROXY_TYPE_HASH args: Lock: code_hash: CODE_HASH_A args: PUBKEY_A Inputs: Payment Cell: # Capacity: N # N >= MINIMAY_PAYMENT_A Lock: <...any other cells> Outputs: Cluster Agent Cell: Data: Hash(ClusterProxyCell.Type) Type: code_hash: CLUSTER_AGENT_TYPE_HASH args: CLUSTER_ID_A Lock: Receivement Cell: Capacity: N Lock: code_hash: CODE_HASH_A args: PUBKEY_A <...any other cells> ``` ---------------------------------------- TITLE: Generate libckblua.so Library using Bash DESCRIPTION: This snippet provides the necessary bash commands to clone the `ckb-lua-vm` repository and compile the `libckblua.so` shared library. This library is crucial for integrating Lua virtual machine functionalities within CKB-based projects, enabling smart contract execution. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/contracts/spore_extension_lua/lua/README.md#_snippet_0 LANGUAGE: bash CODE: ``` git clone https://github.com/nervosnetwork/ckb-lua-vm cd ckb-lua-vm make build/libckblua.so ``` ---------------------------------------- TITLE: Contract Hashes for Spore Protocol - tag 0.2.2-beta.2 (testnet) DESCRIPTION: Contract hashes for the 0.2.2-beta.2 testnet release of Spore Protocol, including spore, cluster, cluster_agent, cluster_proxy, and spore_extension_lua components. This version is recommended for testnet compatibility. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/VERSIONS.md#_snippet_2 LANGUAGE: APIDOC CODE: ``` spore: tx_hash: 0x5e8d2a517d50fd4bb4d01737a7952a1f1d35c8afc77240695bb569cd7d9d5a1f index: 0 code_hash: 0x685a60219309029d01310311dba953d67029170ca4848a4ff638e57002130a0d ``` LANGUAGE: APIDOC CODE: ``` cluster: tx_hash: 0xcebb174d6e300e26074aea2f5dbd7f694bb4fe3de52b6dfe205e54f90164510a index: 0 code_hash: 0x0bbe768b519d8ea7b96d58f1182eb7e6ef96c541fbd9526975077ee09f049058 ``` LANGUAGE: APIDOC CODE: ``` cluster_agent: tx_hash: 0x52210232292d10c51b48e72a2cea60d8f0a08c2680a97a8ee7ca0a39379f0036 index: 0 code_hash: 0x923e997654b2697ee3f77052cb884e98f28799a4270fd412c3edb8f3987ca622 ``` LANGUAGE: APIDOC CODE: ``` cluster_proxy: tx_hash: 0xc5a41d58155b11ecd87a5a49fdcb6e83bd6684d3b72b2f3686f081945461c156 index: 0 code_hash: 0x4349889bda064adab8f49f7dd8810d217917f7df28e9b2a1df0b74442399670a ``` LANGUAGE: APIDOC CODE: ``` spore_extension_lua: tx_hash: 0x9b2098e5b6f575b2fd34ffd0212bc1c96e1f9e86fcdb146511849c174dfe0d02 index: 0 code_hash: 0x5ff1a403458b436ea4b2ceb72f1fa70a6507968493315b646f5302661cb68e57 ``` ---------------------------------------- TITLE: Mutant Cell Deployment on Pudge Testnet DESCRIPTION: This snippet provides the deployment details for the Mutant cell itself on the Pudge Testnet, including its `code_hash`, transaction ID (`tx`), and output index. These values are necessary for referencing and deploying Mutant cells. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/MUTANT.md#_snippet_4 LANGUAGE: YAML CODE: ``` code_hash: 0xf979ff194202dd2178c18cfc2e5cc60c965a1c94aad8a46eb80e74ee85842b5ce tx: 0xa3add6709887b3e136546edb024cd905726d73a126d47764b4537e8b08de390f index: 1 ``` ---------------------------------------- TITLE: Spore Lua Library Deployment on Pudge Testnet DESCRIPTION: This snippet provides the deployment details for the Spore Lua Library on the Pudge Testnet, including its `code_hash`, transaction ID (`tx`), and output index. These values are essential for referencing the library in Spore transactions. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/MUTANT.md#_snippet_3 LANGUAGE: YAML CODE: ``` code_hash: 0xed08faee8c29b7a7c29bd9d495b4b93cc207bd70ca93f7b356f39c677e7ab0fc tx: 0xa3add6709887b3e136546edb024cd905726d73a126d47764b4537e8b08de390f index: 0 ``` ---------------------------------------- TITLE: Spore Lua Library Deployment Details DESCRIPTION: Details for the deployed Spore Lua library, including its transaction hash, output index, and data hash on the Pudge Testnet. This information is crucial for interacting with the Mutant contract. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/README.md#_snippet_2 LANGUAGE: APIDOC CODE: ``` tx_hash: 0x8fb7170a58d631250dabd0f323a833f4ad2cfdd0189f45497e62beb8409e7a0c index: 0 data_hash: 0xed08faee8c29b7a7c29bd9d495b4b93cc207bd70ca93f7b356f39c677e7ab0fc ``` ---------------------------------------- TITLE: Contract Hashes for Spore Protocol - tag 0.2.2-beta.1 (mainnet) DESCRIPTION: Contract hashes for the 0.2.2-beta.1 mainnet release of Spore Protocol, covering spore and cluster components. This version provides core functionalities on the main network. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/VERSIONS.md#_snippet_1 LANGUAGE: APIDOC CODE: ``` spore: tx_hash: 0x96b198fb5ddbd1eed57ed667068f1f1e55d07907b4c0dbd38675a69ea1b69824 index: 0 code_hash: 0x4a4dce1df3dffff7f8b2cd7dff7303df3b6150c9788cb75dcf6747247132b9f5 ``` LANGUAGE: APIDOC CODE: ``` cluster: tx_hash: 0xe464b7fb9311c5e2820e61c99afc615d6b98bdefbe318c34868c010cbd0dc938 index: 0 code_hash: 0x7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075 ``` ---------------------------------------- TITLE: Mint Spore with Cluster Agent using Signature (Not Implemented) DESCRIPTION: Outlines a proposed method for minting a Spore using a signature, where the Cluster Agent Cell's lock is associated with a public key hash. This method requires a valid signature in the Witnesses section and is currently not implemented. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/RFC_PROXY_AGENT.md#_snippet_8 LANGUAGE: yaml CODE: ``` CellDeps: Cluster Agent Cell A: Type: args: CLUSTER_ID_A code_hash: CLUSTER_AGENT_TYPE_HASH Lock: args: code_hash: LOCK_CODE_HASH_A Inputs: <...any other cells> Outputs: Spore Cell: Capacity: N CKBytes Data: content-type: "image/png" content: BYTES_OF_THE_IMAGE cluster: CLUSTER_ID_A Type: hash_type: "data1" code_hash: SPORE_V1_DATA_HASH # hash of Spore's type script data hash args: SPORE_ID Lock: Witnesses: ``` ---------------------------------------- TITLE: Contract Hashes for Spore Protocol - tag 0.2.1 (testnet) DESCRIPTION: Details for the deprecated 0.2.1 testnet release of Spore Protocol contracts, including transaction and code hashes for spore, cluster, cluster_agent, and cluster_proxy components. Users are advised to upgrade to newer versions for optimal ecosystem compatibility. SOURCE: https://github.com/sporeprotocol/spore-contract/blob/master/docs/VERSIONS.md#_snippet_0 LANGUAGE: APIDOC CODE: ``` spore: tx_hash: 0x06995b9fc19461a2bf9933e57b69af47a20bf0a5bc6c0ffcb85567a2c733f0a1 index: 0 code_hash: 0x5e063b4c0e7abeaa6a428df3b693521a3050934cf3b0ae97a800d1bc31449398 ``` LANGUAGE: APIDOC CODE: ``` cluster: tx_hash: 0xfbceb70b2e683ef3a97865bb88e082e3e5366ee195a9c826e3c07d1026792fcd index: 0 code_hash: 0x7366a61534fa7c7e6225ecc0d828ea3b5366adec2b58206f2ee84995fe030075 ``` LANGUAGE: APIDOC CODE: ``` cluster_agent: tx_hash: 0x53fdb9366637434ff685d0aca5e2a68a859b6fcaa4b608a7ecca0713fed0f5b7 index: 0 code_hash: 0xc986099b41d79ca1b2a56ce5874bcda8175440a17298ea5e2bbc3897736b8c21 ``` LANGUAGE: APIDOC CODE: ``` cluster_proxy: tx_hash: 0x0231ea581bbc38965e10a2659da326ae840c038a9d0d6849f458b51d94870104 index: 0 code_hash: 0xbe8b9ce3d05a32c4bb26fe71cd5fc1407ce91e3a8b9e8719be2ab072cef1454b ```