From b806fd6727ba3f2543d7b4685a46dafd01771528 Mon Sep 17 00:00:00 2001 From: liyukun Date: Wed, 10 Jan 2024 10:27:26 +0800 Subject: [PATCH 1/5] docs: add rfc to describe cluster proxy/agent --- RFC_PROXY_AGENT.md | 302 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 302 insertions(+) create mode 100644 RFC_PROXY_AGENT.md diff --git a/RFC_PROXY_AGENT.md b/RFC_PROXY_AGENT.md new file mode 100644 index 0000000..1f5fb31 --- /dev/null +++ b/RFC_PROXY_AGENT.md @@ -0,0 +1,302 @@ +# Public Cluster verification problems + +## Original Problems/Purpose + +In the original design of the Spore Protocol, if one wants to create a spore with a Cluster ID, then it must follow: + +1. The referenced Cluster Cell must be found in the `CellDeps`. +2. The referenced Cluster Cell must be found in the `Inputs`. +3. The referenced Cluster Cell must be found in the `Outputs`. + +This is for verifying the ownership of the referenced Cluster Cell, avoiding vicious behavious happened to one’s private Cluster. + +While this guarantees unexpected minting will not happen to a certain Cluster, it also brings a problem for Clusters that support public minting — those using specific lock to achieve this. That is, there might be a bottleneck when the Cluster contains many popular Spore cells and there's only one Cluster cell available to construct transactions. + +More specificly, if two person wants to mint different Spores into a Cluster named `Cluster A`, and they accidently send their mint transaction at the same time, then one of their transaction will be rejected because of the Cluster was consumed and recreated, the rejected one also needs to reconstruct its transaction in order to continue minting. + +## Solution details + +### Step1: Creating Cluster Proxy Cell + +In this stage, the **owner** needs to create a special cell, here we called it **Cluster Proxy Cell** + +A Cluster Proxy Cell’s structure is like below: + +```yaml +Cluster Proxy Cell: + Data: REFERENCED_CLUSTER_ID + Type: + code_hash: CLUSTER_PROXY_TYPE_HASH + args: [] + Lock: + +``` + +The Type args can be: + +- args: +- args: + +Where `cluster_proxy_id = hash(Inputs[0], Output_Index)` + +Below is a transaction shows how to create a Cluster Proxy Cell, by putting a Cluster Cell to Inputs & Outputs: + +```yaml +# Method 1, direct input +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 +``` + +Or you can use an **Input Cell** with same Lock to the Cluster Cell to achieve this + +```yaml +# Method 2, use lock proxy +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> +``` + +### Step2: Create Cluster Agent Cell + +Once the Cluster owner created the Cluster Proxy Cell, anyone who is able to unlock the Cluster Proxy Cell is able to create a special type cell called: Cluster Agent Cell. Holder of this Cluster Agent Cell can mint Spore in a regular process and put it into the referenced Cluster. + +```yaml +Cluster Agent Cell: + Data: Type Hash of Referenced Cluster Proxy + Type: + code_hash: CLUSTER_AGENT_TYPE_HASH + args: REFERENCED_CLUSTER_ID + Lock: + +``` + +Below shows the methods about how to create a Cluster Proxy Agent Cell: + +```yaml +# Method 1, direct input +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> +``` + +Or you can make a payment to the Cluster Proxy owner to achieve the same: (By transfering capacity to the same lock address with Cluster Proxy) + +```yaml +# Method 2, with payment appearance +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> +``` + +In here, payment cell is just an example showcase, it can be any unlockable cell and is not limited in just one cell. + +### Step3: Mint Spore with Cluster Agent + +Holder of the Cluster Agent Cell can now mint Spore using this Cell. Valid methods are listed below. + +1. **Mint with direct input** + +```yaml +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 +``` + +1. **Mint with Lock Proxy** + +```yaml +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: + +``` + +1. **Mint with Signature** + +```yaml +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: + +``` From 2f8ccec4f0a20b1abba527396df27f49f42d4ee0 Mon Sep 17 00:00:00 2001 From: liyukun Date: Fri, 12 Jan 2024 23:10:39 +0800 Subject: [PATCH 2/5] chore: confirm suggestions --- RFC_PROXY_AGENT.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/RFC_PROXY_AGENT.md b/RFC_PROXY_AGENT.md index 1f5fb31..bd888d0 100644 --- a/RFC_PROXY_AGENT.md +++ b/RFC_PROXY_AGENT.md @@ -27,7 +27,7 @@ Cluster Proxy Cell: Data: REFERENCED_CLUSTER_ID Type: code_hash: CLUSTER_PROXY_TYPE_HASH - args: [] + args: [] Lock: ``` @@ -35,7 +35,7 @@ Cluster Proxy Cell: The Type args can be: - args: -- args: +- args: Where `cluster_proxy_id = hash(Inputs[0], Output_Index)` @@ -69,7 +69,7 @@ Outputs: Data: CLUSTER_ID_A Type: code_hash: CLUSTER_PROXY_TYPE_HASH - args: CLUSTER_PROXY_ID_A + args: CLUSTER_PROXY_ID_A Lock: # for example, acp ``` @@ -98,7 +98,7 @@ Outputs: Data: CLUSTER_ID_A Type: code_hash: CLUSTER_PROXY_TYPE_HASH - args: CLUSTER_PROXY_ID + args: CLUSTER_PROXY_ID Lock: # for example, acp <...any other cells> @@ -113,7 +113,7 @@ Cluster Agent Cell: Data: Type Hash of Referenced Cluster Proxy Type: code_hash: CLUSTER_AGENT_TYPE_HASH - args: REFERENCED_CLUSTER_ID + args: REFERENCED_CLUSTER_ID Lock: ``` @@ -129,7 +129,7 @@ CellDeps: Data: CLUSTER_ID_A Type: code_hash: CLUSTER_PROXY_TYPE_HASH - args: CLUSTER_PROXY_ID + args: CLUSTER_PROXY_ID Lock: Inputs: @@ -137,7 +137,7 @@ Inputs: Data: CLUSTER_ID_A Type: code_hash: CLUSTER_PROXY_TYPE_HASH - args: CLUSTER_PROXY_ID + args: CLUSTER_PROXY_ID Lock: <...any other cells> @@ -146,7 +146,7 @@ Outputs: Data: Hash(ClusterProxyCell.Type) Type: code_hash: CLUSTER_AGENT_TYPE_HASH - args: CLUSTER_ID_A + args: CLUSTER_ID_A Lock: @@ -154,7 +154,7 @@ Outputs: Data: CLUSTER_ID_A Type: code_hash: CLUSTER_PROXY_TYPE_HASH - args: CLUSTER_PROXY_ID + args: CLUSTER_PROXY_ID Lock: <...any other cells> @@ -170,7 +170,7 @@ CellDeps: Data: CLUSTER_ID_A Type: code_hash: CLUSTER_PROXY_TYPE_HASH - args: + args: Lock: code_hash: CODE_HASH_A args: PUBKEY_A @@ -184,7 +184,7 @@ Outputs: Data: Hash(ClusterProxyCell.Type) Type: code_hash: CLUSTER_AGENT_TYPE_HASH - args: CLUSTER_ID_A + args: CLUSTER_ID_A Lock: @@ -223,20 +223,20 @@ Outputs: 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 + 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 + args: CLUSTER_ID_A Lock: # for example, acp ``` -1. **Mint with Lock Proxy** +2. **Mint with Lock Proxy** ```yaml CellDeps: @@ -264,13 +264,13 @@ Outputs: 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 + code_hash: SPORE_TYPE_DATA_HASH # hash of Spore's type script data hash + args: SPORE_ID Lock: ``` -1. **Mint with Signature** +3. **Mint with Signature** (not implemented) ```yaml CellDeps: @@ -293,8 +293,8 @@ Outputs: 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 + code_hash: SPORE_V1_DATA_HASH # hash of Spore's type script data hash + args: SPORE_ID Lock: Witnesses: From 8829125cfaa200f435dbd087ebd062d1371294b8 Mon Sep 17 00:00:00 2001 From: liyukun Date: Fri, 12 Jan 2024 23:27:36 +0800 Subject: [PATCH 3/5] chore: enable recommended changes from doc reviewer --- RFC_PROXY_AGENT.md | 50 +++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/RFC_PROXY_AGENT.md b/RFC_PROXY_AGENT.md index bd888d0..ee67dc0 100644 --- a/RFC_PROXY_AGENT.md +++ b/RFC_PROXY_AGENT.md @@ -1,24 +1,22 @@ -# Public Cluster verification problems +# Public Cluster Verification Problems -## Original Problems/Purpose +## Original Problems -In the original design of the Spore Protocol, if one wants to create a spore with a Cluster ID, then it must follow: +In the original design of the Spore Protocol, the creation of a Spore with a Cluster ID required the following conditions: 1. The referenced Cluster Cell must be found in the `CellDeps`. 2. The referenced Cluster Cell must be found in the `Inputs`. 3. The referenced Cluster Cell must be found in the `Outputs`. -This is for verifying the ownership of the referenced Cluster Cell, avoiding vicious behavious happened to one’s private Cluster. +This verification process ensures ownership of the referenced Cluster Cell, preventing malicious activities on one's private Cluster. -While this guarantees unexpected minting will not happen to a certain Cluster, it also brings a problem for Clusters that support public minting — those using specific lock to achieve this. That is, there might be a bottleneck when the Cluster contains many popular Spore cells and there's only one Cluster cell available to construct transactions. +However, while this approach prevents unintended minting in a certain Cluster, it brings a problem for Clusters that support public minting — those using specific lock to achieve this. That is, there might be a bottleneck when the Cluster contains multiple popular Spore cells, and there is only one Cluster cell available to construct transactions. -More specificly, if two person wants to mint different Spores into a Cluster named `Cluster A`, and they accidently send their mint transaction at the same time, then one of their transaction will be rejected because of the Cluster was consumed and recreated, the rejected one also needs to reconstruct its transaction in order to continue minting. +More specifically, if two person attempt to mint different Spores into a Cluster, say Cluster A, and their minting transactions are accidentally sent at the same time, then one of them will be rejected because the target Cluster was consumed and recreated by the other. The rejected one must then be reconstructed to continue the minting process. -## Solution details +## Solution -### Step1: Creating Cluster Proxy Cell - -In this stage, the **owner** needs to create a special cell, here we called it **Cluster Proxy Cell** +At this stage, the **owner** needs to create a special cell, here we called it **Cluster Proxy Cell** A Cluster Proxy Cell’s structure is like below: @@ -39,10 +37,13 @@ The Type args can be: Where `cluster_proxy_id = hash(Inputs[0], Output_Index)` -Below is a transaction shows how to create a Cluster Proxy Cell, by putting a Cluster Cell to Inputs & Outputs: +### Step1: Creating Cluster Proxy Cell + +Creating a Cluster Proxy Cell can be done in two ways. The first method is putting a Cluster Cell to Inputs & Outputs, as shown below: + +#### Method 1. Use Direct Input ```yaml -# Method 1, direct input CellDeps: @@ -74,10 +75,11 @@ Outputs: # for example, acp ``` -Or you can use an **Input Cell** with same Lock to the Cluster Cell to achieve this +The other method is using an Input Cell with same Lock to the Cluster Cell to create a Cluster Proxy Cell. + +#### Method 2. Use Lock Proxy ```yaml -# Method 2, use lock proxy CellDeps: Cluster Cell A: @@ -118,10 +120,11 @@ Cluster Agent Cell: ``` -Below shows the methods about how to create a Cluster Proxy Agent Cell: +There are two ways to create a Cluster Proxy Agent Cell. + +#### Method 1. Direct Input ```yaml -# Method 1, direct input CellDeps: @@ -160,10 +163,11 @@ Outputs: <...any other cells> ``` -Or you can make a payment to the Cluster Proxy owner to achieve the same: (By transfering capacity to the same lock address with Cluster Proxy) +# Method 2. Use Payment Appearance + +Alternatively, you can make a payment to the Cluster Proxy owner to create a Cluster Agent Cell. This method essentially involves transferring capacity to the same lock address with the Cluster Proxy. ```yaml -# Method 2, with payment appearance CellDeps: Cluster Proxy Cell: @@ -196,13 +200,13 @@ Outputs: <...any other cells> ``` -In here, payment cell is just an example showcase, it can be any unlockable cell and is not limited in just one cell. +Here, the payment cell serves merely as an example; it can be any unlockable cell and is not limited to only one cell. ### Step3: Mint Spore with Cluster Agent -Holder of the Cluster Agent Cell can now mint Spore using this Cell. Valid methods are listed below. +The Cluster Agent Cell holder can mint Spore using three valid methods listed below. -1. **Mint with direct input** +#### Method 1. Mint With Direct Input ```yaml CellDeps: @@ -236,7 +240,7 @@ Outputs: # for example, acp ``` -2. **Mint with Lock Proxy** +#### Method 2. Mint With Lock Proxy ```yaml CellDeps: @@ -270,7 +274,7 @@ Outputs: ``` -3. **Mint with Signature** (not implemented) +#### Method 3. Mint With Signature (Not Implemented) ```yaml CellDeps: From f6db56e2964e351d90ee4895c47b80d2037b23b2 Mon Sep 17 00:00:00 2001 From: Sss_is_me <107824088+linnnsss@users.noreply.github.com> Date: Mon, 15 Jan 2024 13:46:03 +0800 Subject: [PATCH 4/5] Update RFC_PROXY_AGENT.md improve language clarity --- RFC_PROXY_AGENT.md | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/RFC_PROXY_AGENT.md b/RFC_PROXY_AGENT.md index ee67dc0..4b97cc1 100644 --- a/RFC_PROXY_AGENT.md +++ b/RFC_PROXY_AGENT.md @@ -8,15 +8,13 @@ In the original design of the Spore Protocol, the creation of a Spore with a Clu 2. The referenced Cluster Cell must be found in the `Inputs`. 3. The referenced Cluster Cell must be found in the `Outputs`. -This verification process ensures ownership of the referenced Cluster Cell, preventing malicious activities on one's private Cluster. +This verification process ensures ownership of the referenced Cluster Cell, preventing malicious activities on one's private Cluster. However, while this approach prevents unintended minting in a private Cluster, challenges persist in public Clusters supporting public minting. This is especially true for those utilizing a specific lock, as it may lead to unintended minting. Specifically, there might be a bottleneck when the Cluster contains multiple popular Spore cells, and there is only one Cluster cell available to construct transactions. -However, while this approach prevents unintended minting in a certain Cluster, it brings a problem for Clusters that support public minting — those using specific lock to achieve this. That is, there might be a bottleneck when the Cluster contains multiple popular Spore cells, and there is only one Cluster cell available to construct transactions. - -More specifically, if two person attempt to mint different Spores into a Cluster, say Cluster A, and their minting transactions are accidentally sent at the same time, then one of them will be rejected because the target Cluster was consumed and recreated by the other. The rejected one must then be reconstructed to continue the minting process. +To elaborate furtehr, if two individuals attempt to mint different Spores into a Cluster, say `Cluster A`, and their minting transactions are accidentally sent at the same time, then one of them will be rejected because the target Cluster was consumed and recreated by the other. The rejected transaction must then be reconstructed to continue the minting process. ## Solution -At this stage, the **owner** needs to create a special cell, here we called it **Cluster Proxy Cell** +At this stage, the **owner** needs to create a special cell, here we called it **Cluster Proxy Cell**. A Cluster Proxy Cell’s structure is like below: @@ -35,9 +33,9 @@ The Type args can be: - args: - args: -Where `cluster_proxy_id = hash(Inputs[0], Output_Index)` +where `cluster_proxy_id = hash(Inputs[0], Output_Index)`. -### Step1: Creating Cluster Proxy Cell +### Step 1: Create Cluster Proxy Cell Creating a Cluster Proxy Cell can be done in two ways. The first method is putting a Cluster Cell to Inputs & Outputs, as shown below: @@ -75,7 +73,7 @@ Outputs: # for example, acp ``` -The other method is using an Input Cell with same Lock to the Cluster Cell to create a Cluster Proxy Cell. +The other method is using an **Input Cell** with same Lock to the Cluster Cell to create a Cluster Proxy Cell, shown below: #### Method 2. Use Lock Proxy @@ -106,9 +104,9 @@ Outputs: <...any other cells> ``` -### Step2: Create Cluster Agent Cell +### Step 2: Create Cluster Agent Cell -Once the Cluster owner created the Cluster Proxy Cell, anyone who is able to unlock the Cluster Proxy Cell is able to create a special type cell called: Cluster Agent Cell. Holder of this Cluster Agent Cell can mint Spore in a regular process and put it into the referenced Cluster. +Once the Cluster owner created the Cluster Proxy Cell, anyone able to unlock the Cluster Proxy Cell can create a special type cell: Cluster Agent Cell. The holder of this Cluster Agent Cell can mint Spore in a regular process and put it into the referenced Cluster. ```yaml Cluster Agent Cell: @@ -163,7 +161,7 @@ Outputs: <...any other cells> ``` -# Method 2. Use Payment Appearance +#### Method 2. Use Payment Appearance Alternatively, you can make a payment to the Cluster Proxy owner to create a Cluster Agent Cell. This method essentially involves transferring capacity to the same lock address with the Cluster Proxy. @@ -202,7 +200,7 @@ Outputs: Here, the payment cell serves merely as an example; it can be any unlockable cell and is not limited to only one cell. -### Step3: Mint Spore with Cluster Agent +### Step 3: Mint Spore with Cluster Agent The Cluster Agent Cell holder can mint Spore using three valid methods listed below. From 3ad0569f720fc66143d3f57273c30ad396481a85 Mon Sep 17 00:00:00 2001 From: liyukun Date: Tue, 16 Jan 2024 14:43:11 +0800 Subject: [PATCH 5/5] chore: minor change --- RFC_PROXY_AGENT.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/RFC_PROXY_AGENT.md b/RFC_PROXY_AGENT.md index 4b97cc1..ac5118e 100644 --- a/RFC_PROXY_AGENT.md +++ b/RFC_PROXY_AGENT.md @@ -8,13 +8,13 @@ In the original design of the Spore Protocol, the creation of a Spore with a Clu 2. The referenced Cluster Cell must be found in the `Inputs`. 3. The referenced Cluster Cell must be found in the `Outputs`. -This verification process ensures ownership of the referenced Cluster Cell, preventing malicious activities on one's private Cluster. However, while this approach prevents unintended minting in a private Cluster, challenges persist in public Clusters supporting public minting. This is especially true for those utilizing a specific lock, as it may lead to unintended minting. Specifically, there might be a bottleneck when the Cluster contains multiple popular Spore cells, and there is only one Cluster cell available to construct transactions. +This verification process ensures ownership of the referenced Cluster Cell, preventing malicious activities on one's private Cluster. -To elaborate furtehr, if two individuals attempt to mint different Spores into a Cluster, say `Cluster A`, and their minting transactions are accidentally sent at the same time, then one of them will be rejected because the target Cluster was consumed and recreated by the other. The rejected transaction must then be reconstructed to continue the minting process. +While this design prevents minting in a private Cluster when ownership is absent, challenges remain in public Clusters. In public mining, ownership is nullified upon a customized lock (e.g., [anyone-can-pay](https://github.com/nervosnetwork/rfcs/blob/master/rfcs/0026-anyone-can-pay/0026-anyone-can-pay.md)) is introduced. However, this gives rise to the issue of cell competition: if two minting transactions are accidentally sent simultaneously, one will be rejected. The target Cluster gets consumed and recreated by one transaction, requiring reconstruction of the rejected transaction to proceed with minting. ## Solution -At this stage, the **owner** needs to create a special cell, here we called it **Cluster Proxy Cell**. +At this stage, the **owner** needs to create a special cell, here we called it **Cluster Proxy Cell** A Cluster Proxy Cell’s structure is like below: @@ -33,9 +33,9 @@ The Type args can be: - args: - args: -where `cluster_proxy_id = hash(Inputs[0], Output_Index)`. +Where `cluster_proxy_id = hash(Inputs[0], Output_Index)` -### Step 1: Create Cluster Proxy Cell +### Step1: Creating Cluster Proxy Cell Creating a Cluster Proxy Cell can be done in two ways. The first method is putting a Cluster Cell to Inputs & Outputs, as shown below: @@ -73,7 +73,7 @@ Outputs: # for example, acp ``` -The other method is using an **Input Cell** with same Lock to the Cluster Cell to create a Cluster Proxy Cell, shown below: +The other method is using an Input Cell with same Lock to the Cluster Cell to create a Cluster Proxy Cell. #### Method 2. Use Lock Proxy @@ -104,9 +104,9 @@ Outputs: <...any other cells> ``` -### Step 2: Create Cluster Agent Cell +### Step2: Create Cluster Agent Cell -Once the Cluster owner created the Cluster Proxy Cell, anyone able to unlock the Cluster Proxy Cell can create a special type cell: Cluster Agent Cell. The holder of this Cluster Agent Cell can mint Spore in a regular process and put it into the referenced Cluster. +Once the Cluster owner created the Cluster Proxy Cell, anyone who is able to unlock the Cluster Proxy Cell is able to create a special type cell called: Cluster Agent Cell. Holder of this Cluster Agent Cell can mint Spore in a regular process and put it into the referenced Cluster. ```yaml Cluster Agent Cell: @@ -161,7 +161,7 @@ Outputs: <...any other cells> ``` -#### Method 2. Use Payment Appearance +# Method 2. Use Payment Appearance Alternatively, you can make a payment to the Cluster Proxy owner to create a Cluster Agent Cell. This method essentially involves transferring capacity to the same lock address with the Cluster Proxy. @@ -200,7 +200,7 @@ Outputs: Here, the payment cell serves merely as an example; it can be any unlockable cell and is not limited to only one cell. -### Step 3: Mint Spore with Cluster Agent +### Step3: Mint Spore with Cluster Agent The Cluster Agent Cell holder can mint Spore using three valid methods listed below.