Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions zips/zip-0230.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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** |
Expand Down Expand Up @@ -298,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]_. |
+-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+
Expand All @@ -307,7 +307,7 @@ The OrchardZSA Action Group Description is encoded in a transaction as an instan
| | | |transaction. |
+-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+

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
Expand All @@ -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``)
----------------------------------------------------

Expand Down
12 changes: 6 additions & 6 deletions zips/zip-0246.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand Down Expand Up @@ -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::

Expand All @@ -250,6 +249,7 @@ For each Action Group, the following elements are included in the hash::
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::

Expand Down Expand Up @@ -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.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::
Expand Down