Skip to content

Commit cc5b418

Browse files
authored
Moving the Burn information into the Action Group (#97)
This shifts the information pertaining to the burning of assets into the OrchardZSA Action Group -- this occurs both in the Transaction Format and the computation of the TxID digest.
1 parent b5b434c commit cc5b418

File tree

4 files changed

+49
-65
lines changed

4 files changed

+49
-65
lines changed

rendered/zip-0226.html

+19-25
Original file line numberDiff line numberDiff line change
@@ -474,20 +474,20 @@ <h4>The
474474
<section id="t-4-orchard-digest"><h4><span class="section-heading">T.4: orchard_digest</span><span class="section-anchor"> <a rel="bookmark" href="#t-4-orchard-digest"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h4>
475475
<p>When OrchardZSA Actions Groups are present in the transaction, this digest is a BLAKE2b-256 hash of the following values:</p>
476476
<pre>T.4a: orchard_action_groups_digest (32-byte hash output) [ADDED FOR ZSA]
477-
T.4b: orchard_zsa_burn_digest (32-byte hash output) [ADDED FOR ZSA]
478477
T.4c: valueBalanceOrchard (64-bit signed little-endian)</pre>
479478
<p>The personalization field of this hash is the same as in ZIP 244 <a id="footnote-reference-55" class="footnote_reference" href="#zip-0244">15</a></p>
480479
<pre>"ZTxIdOrchardHash"</pre>
481480
<p>In the case that the transaction has no OrchardZSA Action Groups, <code>orchard_digest</code> is</p>
482481
<pre>BLAKE2b-256("ZTxIdOrchardHash", [])</pre>
483482
<section id="t-4a-orchard-action-groups-digest"><h5><span class="section-heading">T.4a: orchard_action_groups_digest</span><span class="section-anchor"> <a rel="bookmark" href="#t-4a-orchard-action-groups-digest"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h5>
484483
<p>A BLAKE2b-256 hash of the subset of OrchardZSA Action Groups information for all OrchardZSA Action Groups belonging to the transaction. For each Action Group, the following elements are included in the hash:</p>
485-
<pre>T.4a.i : orchard_actions_compact_digest (32-byte hash output)
486-
T.4a.ii : orchard_actions_memos_digest (32-byte hash output)
487-
T.4a.iii: orchard_actions_noncompact_digest (32-byte hash output)
488-
T.4a.iv : flagsOrchard (1 byte)
489-
T.4a.v : anchorOrchard (32 bytes)
490-
T.4a.vi : nAGExpiryHeight (4 bytes)</pre>
484+
<pre>T.4a.i : orchard_actions_compact_digest (32-byte hash output)
485+
T.4a.ii : orchard_actions_memos_digest (32-byte hash output)
486+
T.4a.iii : orchard_actions_noncompact_digest (32-byte hash output)
487+
T.4a.iv : orchard_zsa_burn_digest (32-byte hash output)
488+
T.4a.v : flagsOrchard (1 byte)
489+
T.4a.vi : anchorOrchard (32 bytes)
490+
T.4a.vii : nAGExpiryHeight (4 bytes)</pre>
491491
<p>The personalization field of this hash is set to:</p>
492492
<pre>"ZTxIdOrcActGHash"</pre>
493493
<section id="t-4a-i-orchard-actions-compact-digest"><h6><span class="section-heading">T.4a.i: orchard_actions_compact_digest</span><span class="section-anchor"> <a rel="bookmark" href="#t-4a-i-orchard-actions-compact-digest"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h6>
@@ -514,24 +514,18 @@ <h4>The
514514
<p>The personalization field of this hash is defined identically to ZIP 244:</p>
515515
<pre>"ZTxIdOrcActNHash"</pre>
516516
</section>
517-
</section>
518-
<section id="t-4b-orchard-zsa-burn-digest"><h5><span class="section-heading">T.4b: orchard_zsa_burn_digest</span><span class="section-anchor"> <a rel="bookmark" href="#t-4b-orchard-zsa-burn-digest"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h5>
519-
<p>A BLAKE2b-256 hash of the data from the burn fields of the transaction. For each tuple in the
520-
<span class="math">\(\mathsf{assetBurn}\)</span>
521-
set, the following elements are included in the hash:</p>
522-
<pre>T.4b.i : assetBase (field encoding bytes)
523-
T.4b.ii: valueBurn (field encoding bytes)</pre>
524-
<p>The personalization field of this hash is set to:</p>
525-
<pre>"ZTxIdOrcBurnHash"</pre>
526-
<p>In case the transaction does not perform the burning of any Assets (i.e. the
527-
<span class="math">\(\mathsf{assetBurn}\)</span>
528-
set is empty), the ''orchard_zsa_burn_digest'' is:</p>
529-
<pre>BLAKE2b-256("ZTxIdOrcBurnHash", [])</pre>
530-
<section id="t-4b-i-assetbase"><h6><span class="section-heading">T.4b.i: assetBase</span><span class="section-anchor"> <a rel="bookmark" href="#t-4b-i-assetbase"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h6>
531-
<p>The Asset Base being burnt encoded as the 32-byte representation of a point on the Pallas curve.</p>
532-
</section>
533-
<section id="t-4b-ii-valueburn"><h6><span class="section-heading">T.4b.ii: valueBurn</span><span class="section-anchor"> <a rel="bookmark" href="#t-4b-ii-valueburn"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h6>
534-
<p>Value of the Asset Base being burnt encoded as little-endian 8-byte representation of 64-bit unsigned integer (e.g. u64 in Rust) raw value.</p>
517+
<section id="t-4a-iv-orchard-zsa-burn-digest"><h6><span class="section-heading">T.4a.iv: orchard_zsa_burn_digest</span><span class="section-anchor"> <a rel="bookmark" href="#t-4a-iv-orchard-zsa-burn-digest"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h6>
518+
<p>A BLAKE2b-256 hash of the data from the burn fields of the transaction. For each tuple in the
519+
<span class="math">\(\mathsf{assetBurn}\)</span>
520+
set, the following elements are included in the hash:</p>
521+
<pre>T.4a.iv.1 : assetBase (field encoding bytes)
522+
T.4a.iv.2 : valueBurn (field encoding bytes)</pre>
523+
<p>The personalization field of this hash is set to:</p>
524+
<pre>"ZTxIdOrcBurnHash"</pre>
525+
<p>In case the transaction does not perform the burning of any Assets (i.e. the
526+
<span class="math">\(\mathsf{assetBurn}\)</span>
527+
set is empty), the ''orchard_zsa_burn_digest'' is:</p>
528+
<pre>BLAKE2b-256("ZTxIdOrcBurnHash", [])</pre>
535529
</section>
536530
</section>
537531
</section>

rendered/zip-0230.html

+13-13
Original file line numberDiff line numberDiff line change
@@ -232,18 +232,6 @@
232232
<td><code>int64</code></td>
233233
<td>The net value of Orchard spends minus outputs.</td>
234234
</tr>
235-
<tr>
236-
<td><code>varies</code></td>
237-
<td><code>nAssetBurn</code></td>
238-
<td><code>compactSize</code></td>
239-
<td>The number of Assets burnt.</td>
240-
</tr>
241-
<tr>
242-
<td><code>40 * nAssetBurn</code></td>
243-
<td><code>vAssetBurn</code></td>
244-
<td><code>AssetBurn[nAssetBurn]</code></td>
245-
<td>A sequence of Asset Burn descriptions, encoded per <a href="#orchardzsa-asset-burn-description">OrchardZSA Asset Burn Description</a>.</td>
246-
</tr>
247235
<tr>
248236
<td><code>64</code></td>
249237
<td><code>bindingSigOrchard</code></td>
@@ -448,9 +436,21 @@
448436
<td><code>byte[64 * nActionsOrchard]</code></td>
449437
<td>Authorizing signatures for each Action of the Action Group in a transaction.</td>
450438
</tr>
439+
<tr>
440+
<td><code>varies</code></td>
441+
<td><code>nAssetBurn</code></td>
442+
<td><code>compactSize</code></td>
443+
<td>The number of Assets burnt.</td>
444+
</tr>
445+
<tr>
446+
<td><code>40 * nAssetBurn</code></td>
447+
<td><code>vAssetBurn</code></td>
448+
<td><code>AssetBurn[nAssetBurn]</code></td>
449+
<td>A sequence of Asset Burn descriptions, encoded per <a href="#orchardzsa-asset-burn-description">OrchardZSA Asset Burn Description</a>.</td>
450+
</tr>
451451
</tbody>
452452
</table>
453-
<p>The encoding of <code>OrchardZSAAction</code> is described below.</p>
453+
<p>The encodings of <code>OrchardZSAAction</code> and <code>AssetBurn</code> are described below.</p>
454454
<ul>
455455
<li>The proofs aggregated in <code>proofsOrchardZSA</code>, and the elements of <code>vSpendAuthSigsOrchard</code>, each have a 1:1 correspondence to the elements of <code>vActionsOrchard</code> and MUST be ordered such that the proof or signature at a given index corresponds to the <code>OrchardZSAAction</code> at the same index.</li>
456456
</ul>

zips/zip-0226.rst

+11-21
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ T.4: orchard_digest
368368
When OrchardZSA Actions Groups are present in the transaction, this digest is a BLAKE2b-256 hash of the following values::
369369

370370
T.4a: orchard_action_groups_digest (32-byte hash output) [ADDED FOR ZSA]
371-
T.4b: orchard_zsa_burn_digest (32-byte hash output) [ADDED FOR ZSA]
372371
T.4c: valueBalanceOrchard (64-bit signed little-endian)
373372

374373
The personalization field of this hash is the same as in ZIP 244 [#zip-0244]_ ::
@@ -385,12 +384,13 @@ T.4a: orchard_action_groups_digest
385384
A BLAKE2b-256 hash of the subset of OrchardZSA Action Groups information for all OrchardZSA Action Groups belonging to the transaction.
386385
For each Action Group, the following elements are included in the hash::
387386

388-
T.4a.i : orchard_actions_compact_digest (32-byte hash output)
389-
T.4a.ii : orchard_actions_memos_digest (32-byte hash output)
390-
T.4a.iii: orchard_actions_noncompact_digest (32-byte hash output)
391-
T.4a.iv : flagsOrchard (1 byte)
392-
T.4a.v : anchorOrchard (32 bytes)
393-
T.4a.vi : nAGExpiryHeight (4 bytes)
387+
T.4a.i : orchard_actions_compact_digest (32-byte hash output)
388+
T.4a.ii : orchard_actions_memos_digest (32-byte hash output)
389+
T.4a.iii : orchard_actions_noncompact_digest (32-byte hash output)
390+
T.4a.iv : orchard_zsa_burn_digest (32-byte hash output)
391+
T.4a.v : flagsOrchard (1 byte)
392+
T.4a.vi : anchorOrchard (32 bytes)
393+
T.4a.vii : nAGExpiryHeight (4 bytes)
394394

395395
The personalization field of this hash is set to::
396396

@@ -447,14 +447,14 @@ The personalization field of this hash is defined identically to ZIP 244::
447447
"ZTxIdOrcActNHash"
448448

449449

450-
T.4b: orchard_zsa_burn_digest
451-
'''''''''''''''''''''''''''''
450+
T.4a.iv: orchard_zsa_burn_digest
451+
................................
452452

453453
A BLAKE2b-256 hash of the data from the burn fields of the transaction. For each tuple in
454454
the $\mathsf{assetBurn}$ set, the following elements are included in the hash::
455455

456-
T.4b.i : assetBase (field encoding bytes)
457-
T.4b.ii: valueBurn (field encoding bytes)
456+
T.4a.iv.1 : assetBase (field encoding bytes)
457+
T.4a.iv.2 : valueBurn (field encoding bytes)
458458

459459
The personalization field of this hash is set to::
460460

@@ -465,16 +465,6 @@ $\mathsf{assetBurn}$ set is empty), the ''orchard_zsa_burn_digest'' is::
465465

466466
BLAKE2b-256("ZTxIdOrcBurnHash", [])
467467

468-
T.4b.i: assetBase
469-
.................
470-
The Asset Base being burnt encoded as the 32-byte representation of a point on the
471-
Pallas curve.
472-
473-
T.4b.ii: valueBurn
474-
..................
475-
Value of the Asset Base being burnt encoded as little-endian 8-byte representation
476-
of 64-bit unsigned integer (e.g. u64 in Rust) raw value.
477-
478468

479469
T.5: issuance_digest
480470
````````````````````

zips/zip-0230.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,6 @@ Transaction Format
178178
+------------------------------------+--------------------------+--------------------------------------------------+---------------------------------------------------------------------------+
179179
|``8`` |``valueBalanceOrchard`` |``int64`` |The net value of Orchard spends minus outputs. |
180180
+------------------------------------+--------------------------+--------------------------------------------------+---------------------------------------------------------------------------+
181-
| ``varies`` | ``nAssetBurn`` | ``compactSize`` | The number of Assets burnt. |
182-
+------------------------------------+--------------------------+--------------------------------------------------+---------------------------------------------------------------------------+
183-
| ``40 * nAssetBurn`` | ``vAssetBurn`` | ``AssetBurn[nAssetBurn]`` | A sequence of Asset Burn descriptions, |
184-
| | | | encoded per `OrchardZSA Asset Burn Description`_. |
185-
+------------------------------------+--------------------------+--------------------------------------------------+---------------------------------------------------------------------------+
186181
|``64`` |``bindingSigOrchard`` |``byte[64]`` |An OrchardZSA binding signature on the SIGHASH transaction hash. |
187182
+------------------------------------+--------------------------+--------------------------------------------------+---------------------------------------------------------------------------+
188183
| **OrchardZSA Issuance Fields** |
@@ -300,8 +295,13 @@ The OrchardZSA Action Group Description is encoded in a transaction as an instan
300295
|``64 * nActionsOrchard`` |``vSpendAuthSigsOrchard`` |``byte[64 * nActionsOrchard]`` |Authorizing signatures for each Action of the Action Group in a |
301296
| | | |transaction. |
302297
+------------------------------------+--------------------------+--------------------------------------------------+---------------------------------------------------------------------+
298+
| ``varies`` | ``nAssetBurn`` | ``compactSize`` | The number of Assets burnt. |
299+
+------------------------------------+--------------------------+--------------------------------------------------+---------------------------------------------------------------------+
300+
| ``40 * nAssetBurn`` | ``vAssetBurn`` | ``AssetBurn[nAssetBurn]`` | A sequence of Asset Burn descriptions, encoded per |
301+
| | | | `OrchardZSA Asset Burn Description`_. |
302+
+------------------------------------+--------------------------+--------------------------------------------------+---------------------------------------------------------------------+
303303

304-
The encoding of ``OrchardZSAAction`` is described below.
304+
The encodings of ``OrchardZSAAction`` and ``AssetBurn`` are described below.
305305

306306
* The proofs aggregated in ``proofsOrchardZSA``, and the elements of
307307
``vSpendAuthSigsOrchard``, each have a 1:1 correspondence to the elements of

0 commit comments

Comments
 (0)