From e9369affd35b7505341c9ddea333ad36a023dc81 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Wed, 12 Mar 2025 00:11:17 +0530 Subject: [PATCH 1/6] adding the rst changes for the addition of burn fields into the Action Group --- zips/zip-0230.rst | 12 ++++++------ zips/zip-0246.rst | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/zips/zip-0230.rst b/zips/zip-0230.rst index 49ca001a0..bc2251d1b 100644 --- a/zips/zip-0230.rst +++ b/zips/zip-0230.rst @@ -149,11 +149,6 @@ Transaction Format +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ | 8 |``valueBalanceOrchard`` |``int64`` |The net value of Orchard spends minus outputs. | +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ -| varies | ``nAssetBurn`` | ``compactSize`` |The number of Assets burnt. | -+-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ -| 40 × ``nAssetBurn`` | ``vAssetBurn`` | ``AssetBurn[nAssetBurn]`` |A sequence of Asset Burn descriptions, encoded per | -| | | | encoded per `OrchardZSA Asset Burn Description`_. | -+-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ | 64 |``bindingSigOrchard`` |``byte[64]`` |An OrchardZSA binding signature on the SIGHASH transaction hash. | +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ | **OrchardZSA Issuance Fields** | @@ -306,8 +301,13 @@ The OrchardZSA Action Group Description is encoded in a transaction as an instan | 64 × ``nActionsOrchard`` |``vSpendAuthSigsOrchard`` |``byte[64 * nActionsOrchard]`` |Authorizing signatures for each Action of the Action Group in a | | | | |transaction. | +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ +| varies | ``nAssetBurn`` | ``compactSize`` |The number of Assets burnt. | ++-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ +| 40 × ``nAssetBurn`` | ``vAssetBurn`` | ``AssetBurn[nAssetBurn]`` |A sequence of Asset Burn descriptions, encoded per | +| | | | encoded per `OrchardZSA Asset Burn Description`_. | ++-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ -The encoding of ``OrchardZSAAction`` is described below. +The encodings of ``OrchardZSAAction`` and ``AssetBurn`` are described below. * The proofs aggregated in ``proofsOrchardZSA``, and the elements of ``vSpendAuthSigsOrchard``, each have a 1:1 correspondence to the elements of diff --git a/zips/zip-0246.rst b/zips/zip-0246.rst index 30c5d24bb..b6bcdc88e 100644 --- a/zips/zip-0246.rst +++ b/zips/zip-0246.rst @@ -228,8 +228,7 @@ T.4: orchard_digest When OrchardZSA Actions Groups are present in the transaction, this digest is a BLAKE2b-256 hash of the following values:: T.4a: orchard_action_groups_digest (32-byte hash output) - T.4b: orchard_burn_digest (32-byte hash output) - T.4c: valueBalanceOrchard (64-bit signed little-endian) + T.4b: valueBalanceOrchard (64-bit signed little-endian) The personalization field of this hash is set to:: @@ -247,9 +246,10 @@ For each Action Group, the following elements are included in the hash:: T.4a.i : orchard_actions_compact_digest (32-byte hash output) T.4a.ii : orchard_actions_noncompact_digest (32-byte hash output) - T.4a.iii : flagsOrchard (1 byte) - T.4a.iv : anchorOrchard (32 bytes) - T.4a.v : nAGExpiryHeight (4 bytes) + T.4a.iii : orchard_burn_digest (32-byte hash output) + T.4a.iv : flagsOrchard (1 byte) + T.4a.v : anchorOrchard (32 bytes) + T.4a.vi : nAGExpiryHeight (4 bytes) The personalization field of this hash is set to:: @@ -293,8 +293,8 @@ The personalization field of this hash is set to:: The field encodings are specified in ZIP 230 [#zip-0230-orchard-action-field-encodings]_. -T.4b: orchard_burn_digest -''''''''''''''''''''''''' +T.4a.iii: orchard_burn_digest +''''''''''''''''''''''''''''' A BLAKE2b-256 hash of the data from the burn fields of the transaction. For each tuple in the $\mathsf{assetBurn}$ set, the following elements are included in the hash:: From 91a8e539880d4c87c36b40dc0145fa8ba8d90d36 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 18 Mar 2025 12:23:56 +0530 Subject: [PATCH 2/6] fixing order of fields in Action Group --- zips/zip-0230.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zips/zip-0230.rst b/zips/zip-0230.rst index bc2251d1b..140bc0212 100644 --- a/zips/zip-0230.rst +++ b/zips/zip-0230.rst @@ -293,6 +293,11 @@ The OrchardZSA Action Group Description is encoded in a transaction as an instan | | | |transaction including this Action Group cannot be mined, or 0 if | | | | |this Action Group places no constraint on transaction expiry. | +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ +| varies | ``nAssetBurn`` | ``compactSize`` |The number of Assets burnt. | ++-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ +| 40 × ``nAssetBurn`` | ``vAssetBurn`` | ``AssetBurn[nAssetBurn]`` |A sequence of Asset Burn descriptions, encoded per | +| | | | encoded per `OrchardZSA Asset Burn Description`_. | ++-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ | varies |``sizeProofsOrchard`` |``compactSize`` |As defined in Section 7.1 of the Protocol Specification | | | | |[#protocol-txnencoding]_. | +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ @@ -301,11 +306,6 @@ The OrchardZSA Action Group Description is encoded in a transaction as an instan | 64 × ``nActionsOrchard`` |``vSpendAuthSigsOrchard`` |``byte[64 * nActionsOrchard]`` |Authorizing signatures for each Action of the Action Group in a | | | | |transaction. | +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ -| varies | ``nAssetBurn`` | ``compactSize`` |The number of Assets burnt. | -+-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ -| 40 × ``nAssetBurn`` | ``vAssetBurn`` | ``AssetBurn[nAssetBurn]`` |A sequence of Asset Burn descriptions, encoded per | -| | | | encoded per `OrchardZSA Asset Burn Description`_. | -+-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ The encodings of ``OrchardZSAAction`` and ``AssetBurn`` are described below. From 4a419cf6df33bddb587be4ff7903048aa31cce9c Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Tue, 18 Mar 2025 12:26:32 +0530 Subject: [PATCH 3/6] Apply suggestions to ZIP 246 from ZIP review Co-authored-by: Jack Grigg --- zips/zip-0246.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/zips/zip-0246.rst b/zips/zip-0246.rst index b6bcdc88e..84671dc5b 100644 --- a/zips/zip-0246.rst +++ b/zips/zip-0246.rst @@ -246,10 +246,10 @@ For each Action Group, the following elements are included in the hash:: T.4a.i : orchard_actions_compact_digest (32-byte hash output) T.4a.ii : orchard_actions_noncompact_digest (32-byte hash output) - T.4a.iii : orchard_burn_digest (32-byte hash output) - T.4a.iv : flagsOrchard (1 byte) - T.4a.v : anchorOrchard (32 bytes) - T.4a.vi : nAGExpiryHeight (4 bytes) + T.4a.iii : flagsOrchard (1 byte) + T.4a.iv : anchorOrchard (32 bytes) + T.4a.v : nAGExpiryHeight (4 bytes) + T.4a.vi : orchard_burn_digest (32-byte hash output) The personalization field of this hash is set to:: @@ -293,8 +293,8 @@ The personalization field of this hash is set to:: The field encodings are specified in ZIP 230 [#zip-0230-orchard-action-field-encodings]_. -T.4a.iii: orchard_burn_digest -''''''''''''''''''''''''''''' +T.4a.vi: orchard_burn_digest +'''''''''''''''''''''''''''' A BLAKE2b-256 hash of the data from the burn fields of the transaction. For each tuple in the $\mathsf{assetBurn}$ set, the following elements are included in the hash:: From 2258c31accf5c2d25b77232258f0800d925526d4 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 18 Mar 2025 16:11:51 +0530 Subject: [PATCH 4/6] adding rationale for the placement of burn fields inside Action Groups --- zips/zip-0226.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zips/zip-0226.rst b/zips/zip-0226.rst index 74898636d..deb8eadd6 100644 --- a/zips/zip-0226.rst +++ b/zips/zip-0226.rst @@ -344,6 +344,13 @@ OrchardZSA Transaction Structure The transaction format for v6 transactions is described in ZIP 230 [#zip-0230]_. +Rationale for including Burn fields inside OrchardZSA Action Groups +------------------------------------------------------------------- + +Note that the V6 transaction format includes the burn fields of the transaction inside the OrchardZSA Action Group rather than at the transaction level. +This is a design choice that considers the future scenario where Action Groups may be generated by different parties before being bundled together into a transaction. +In such a scenario, the individual parties can burn Assets of their choice in their corresponding Action Groups. +Maintaining the burn fields at the transaction level would provide the ability to burn Assets only to the party performing the bundling of the Action Groups. Modifications relative to ZIP 244 [#zip-0244]_ From bb69fe988758c8600db0783144f13d2c2d1b08f4 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 18 Mar 2025 17:24:25 +0530 Subject: [PATCH 5/6] updating TxId Digest tree --- zips/zip-0246.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zips/zip-0246.rst b/zips/zip-0246.rst index 84671dc5b..8441ad639 100644 --- a/zips/zip-0246.rst +++ b/zips/zip-0246.rst @@ -115,8 +115,8 @@ referenced or described in detail below:: │   │   ├── orchard_actions_noncompact_digest * │   │   ├── flagsOrchard │   │   ├── anchorOrchard - │   │   └── nAGExpiryHeight * - │   ├── orchard_burn_digest * + │   │   ├── nAGExpiryHeight * + │   │   └── orchard_burn_digest * │   └── valueBalanceOrchard ├── issuance_digest * │   ├── issue_actions_digest * From e9782774fc907ce7953f68a70d1c27683835d0c8 Mon Sep 17 00:00:00 2001 From: Vivek Arte Date: Tue, 18 Mar 2025 19:02:16 +0530 Subject: [PATCH 6/6] moving the rationale for the burn field positioning inside action group from ZIP 226 to ZIP 230 --- zips/zip-0226.rst | 7 ------- zips/zip-0230.rst | 9 +++++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/zips/zip-0226.rst b/zips/zip-0226.rst index deb8eadd6..74898636d 100644 --- a/zips/zip-0226.rst +++ b/zips/zip-0226.rst @@ -344,13 +344,6 @@ OrchardZSA Transaction Structure The transaction format for v6 transactions is described in ZIP 230 [#zip-0230]_. -Rationale for including Burn fields inside OrchardZSA Action Groups -------------------------------------------------------------------- - -Note that the V6 transaction format includes the burn fields of the transaction inside the OrchardZSA Action Group rather than at the transaction level. -This is a design choice that considers the future scenario where Action Groups may be generated by different parties before being bundled together into a transaction. -In such a scenario, the individual parties can burn Assets of their choice in their corresponding Action Groups. -Maintaining the burn fields at the transaction level would provide the ability to burn Assets only to the party performing the bundling of the Action Groups. Modifications relative to ZIP 244 [#zip-0244]_ diff --git a/zips/zip-0230.rst b/zips/zip-0230.rst index 140bc0212..16b3845d4 100644 --- a/zips/zip-0230.rst +++ b/zips/zip-0230.rst @@ -321,6 +321,15 @@ We introduce the ``nAGExpiryHeight`` field in this transaction format in order t For the OrchardZSA protocol, which does not make use of an additional expiry height for transactions, we set the value of ``nAGExpiryHeight`` to be ``0`` by consensus. This serves as a default value to represent the situation where there is no expiry, analogous to the convention adopted for ``nExpiryHeight`` in ZIP 203 [#zip-0203]. +Rationale for including Burn fields inside OrchardZSA Action Groups +``````````````````````````````````````````````````````````````````` + +Note that the V6 transaction format includes the burn fields of the transaction inside the OrchardZSA Action Group rather than at the transaction level. +This is a design choice that considers the future scenario where Action Groups may be generated by different parties before being bundled together into a transaction. +In such a scenario, the individual parties can burn Assets of their choice in their corresponding Action Groups. +Maintaining the burn fields at the transaction level would provide the ability to burn Assets only to the party performing the bundling of the Action Groups. + + OrchardZSA Action Description (``OrchardZSAAction``) ----------------------------------------------------