zips/rendered/zip-0230.html

781 lines
50 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<title>ZIP 230: Version 6 Transaction Format</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css" integrity="sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js" integrity="sha384-7zkQWkzuo3B5mTepMUcHkMB5jZaolc2xDwL6VFqjFALcbeS9Ggm/Yr2r3Dy4lfFg" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="css/style.css"></head>
<body>
<section>
<pre>ZIP: 230
Title: Version 6 Transaction Format
Owners: Daira-Emma Hopwood &lt;daira-emma@electriccoin.co&gt;
Jack Grigg &lt;jack@electriccoin.co&gt;
Sean Bowe &lt;sean@electriccoin.co&gt;
Kris Nuttycombe &lt;kris@electriccoin.co&gt;
Pablo Kogan &lt;pablo@qed-it.com&gt;
Vivek Arte &lt;vivek@qed-it.com&gt;
Original-Authors: Greg Pfeil
Deirdre Connolly
Credits: Ying Tong Lai
Status: Draft
Category: Consensus
Created: 2023-04-18
License: MIT
Discussions-To: &lt;<a href="https://github.com/zcash/zips/issues/686">https://github.com/zcash/zips/issues/686</a>&gt;</pre>
<section id="terminology"><h2><span class="section-heading">Terminology</span><span class="section-anchor"> <a rel="bookmark" href="#terminology"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h2>
<p>The key words "MUST", "SHOULD", and "MAY" in this document are to be interpreted as described in BCP 14 <a id="footnote-reference-1" class="footnote_reference" href="#bcp14">1</a> when, and only when, they appear in all capitals.</p>
<p>The terms "Zcash Shielded Asset", "OrchardZSA", "ZSA" and "Asset" in this document are to be interpreted as described in ZIP 226 <a id="footnote-reference-2" class="footnote_reference" href="#zip-0226">9</a>.</p>
<p>The term "Issuance" and "Issuance Action" in this document are to be interpreted as described in ZIP 227 <a id="footnote-reference-3" class="footnote_reference" href="#zip-0227">10</a>.</p>
<p>The character § is used when referring to sections of the Zcash Protocol Specification <a id="footnote-reference-4" class="footnote_reference" href="#protocol">2</a>.</p>
</section>
<section id="abstract"><h2><span class="section-heading">Abstract</span><span class="section-anchor"> <a rel="bookmark" href="#abstract"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h2>
<p>This proposal defines a new Zcash peer-to-peer transaction format, which supports the changes being deployed in Network Upgrade 7 <a id="footnote-reference-5" class="footnote_reference" href="#zip-0254">13</a>. It follows the same design pattern as the v5 transaction format <a id="footnote-reference-6" class="footnote_reference" href="#zip-0225">8</a>.</p>
</section>
<section id="motivation"><h2><span class="section-heading">Motivation</span><span class="section-anchor"> <a rel="bookmark" href="#motivation"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h2>
<p>The OrchardZSA protocol requires serialized data elements that are distinct from any previous Zcash transaction. Since ZIP 244 was activated in NU5, the v5 and later serialized transaction formats are not consensus-critical. Thus, this ZIP defines format that can easily accommodate future extensions, where elements or a given pool are kept separate.</p>
</section>
<section id="requirements"><h2><span class="section-heading">Requirements</span><span class="section-anchor"> <a rel="bookmark" href="#requirements"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h2>
<p>The new format must fully support the OrchardZSA protocol.</p>
<p>The new format should lend itself to future extension or pruning to add or remove value pools.</p>
<p>The computation of the non-malleable transaction identifier hash must include all newly incorporated elements except those that attest to transaction validity.</p>
<p>The computation of the commitment to authorizing data for a transaction must include all newly incorporated elements that attest to transaction validity.</p>
</section>
<section id="non-requirements"><h2><span class="section-heading">Non-requirements</span><span class="section-anchor"> <a rel="bookmark" href="#non-requirements"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h2>
<p>More general forms of extensibility, such as definining a key/value format that allows for parsers that are unaware of some components, are not required.</p>
</section>
<section id="specification"><h2><span class="section-heading">Specification</span><span class="section-anchor"> <a rel="bookmark" href="#specification"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h2>
<p>All fields in this specification are encoded as little-endian.</p>
<p>The Zcash transaction format for transaction version 6 is as follows:</p>
<section id="transaction-format"><h3><span class="section-heading">Transaction Format</span><span class="section-anchor"> <a rel="bookmark" href="#transaction-format"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h3>
<table>
<thead>
<tr>
<th>Bytes</th>
<th>Name</th>
<th>Data Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="4"><strong>Common Transaction Fields</strong></td>
</tr>
<tr>
<td>4</td>
<td><code>header</code></td>
<td><code>uint32</code></td>
<td>
<p>Contains:</p>
<ul>
<li><code>fOverwintered</code> flag (bit 31, always set)</li>
<li><code>version</code> (bits 30 .. 0) transaction version.</li>
</ul>
</td>
</tr>
<tr>
<td>4</td>
<td><code>nVersionGroupId</code></td>
<td><code>uint32</code></td>
<td>Version group ID (nonzero).</td>
</tr>
<tr>
<td>4</td>
<td><code>nConsensusBranchId</code></td>
<td><code>uint32</code></td>
<td>Consensus branch ID (nonzero).</td>
</tr>
<tr>
<td>4</td>
<td><code>lock_time</code></td>
<td><code>uint32</code></td>
<td>Unix-epoch UTC time or block height, encoded as in Bitcoin.</td>
</tr>
<tr>
<td>4</td>
<td><code>nExpiryHeight</code></td>
<td><code>uint32</code></td>
<td>A block height in the range {1 .. 499999999} after which the transaction will expire, or 0 to disable expiry. <a id="footnote-reference-7" class="footnote_reference" href="#zip-0203">7</a></td>
</tr>
<tr>
<td>8</td>
<td><code>fee</code></td>
<td><code>uint64</code></td>
<td>The fee to be paid by this transaction, in zatoshis.</td>
</tr>
<tr>
<td>8</td>
<td><code>burnAmount</code></td>
<td><code>uint64</code></td>
<td>The value to be burned in this transaction, in zatoshis.</td>
</tr>
<tr>
<td colspan="4"><strong>Transparent Transaction Fields</strong></td>
</tr>
<tr>
<td>varies</td>
<td><code>tx_in_count</code></td>
<td><code>compactSize</code></td>
<td>Number of transparent inputs in <code>tx_in</code>.</td>
</tr>
<tr>
<td>varies</td>
<td><code>tx_in</code></td>
<td><code>tx_in</code></td>
<td>Transparent inputs, encoded as in Bitcoin.</td>
</tr>
<tr>
<td>varies</td>
<td><code>tx_out_count</code></td>
<td><code>compactSize</code></td>
<td>Number of transparent outputs in <code>tx_out</code>.</td>
</tr>
<tr>
<td>varies</td>
<td><code>tx_out</code></td>
<td><code>tx_out</code></td>
<td>Transparent outputs, encoded as in Bitcoin.</td>
</tr>
<tr>
<td colspan="4"><strong>Sapling Transaction Fields</strong></td>
</tr>
<tr>
<td>varies</td>
<td><code>nSpendsSapling</code></td>
<td><code>compactSize</code></td>
<td>Number of Sapling Spend descriptions in <code>vSpendsSapling</code>.</td>
</tr>
<tr>
<td>96 × <code>nSpendsSapling</code></td>
<td><code>vSpendsSapling</code></td>
<td><code>SpendDescriptionV5[nSpendsSapling]</code></td>
<td>A sequence of Sapling Spend descriptions, encoded per protocol §7.3 Spend Description Encoding and Consensus (unchanged from V5).</td>
</tr>
<tr>
<td>varies</td>
<td><code>nOutputsSapling</code></td>
<td><code>compactSize</code></td>
<td>Number of Sapling Output Decriptions in <code>vOutputsSapling</code>.</td>
</tr>
<tr>
<td>276 × <code>nOutputsSapling</code></td>
<td><code>vOutputsSapling</code></td>
<td><code>OutputDescriptionV6[nOutputsSapling]</code></td>
<td>A sequence of Sapling Output descriptions, encoded per protocol §7.4 Output Description Encoding and Consensus.</td>
</tr>
<tr>
<td>8</td>
<td><code>valueBalanceSapling</code></td>
<td><code>int64</code></td>
<td>The net value of Sapling Spends minus Outputs</td>
</tr>
<tr>
<td>32</td>
<td><code>anchorSapling</code></td>
<td><code>byte[32]</code></td>
<td>A root of the Sapling note commitment tree at some block height in the past.</td>
</tr>
<tr>
<td>192 × <code>nSpendsSapling</code></td>
<td><code>vSpendProofsSapling</code></td>
<td><code>byte[192 * nSpendsSapling]</code></td>
<td>Encodings of the zk-SNARK proofs for each Sapling Spend.</td>
</tr>
<tr>
<td>64 × <code>nSpendsSapling</code></td>
<td><code>vSpendAuthSigsSapling</code></td>
<td><code>byte[64 * nSpendsSapling]</code></td>
<td>Authorizing signatures for each Sapling Spend.</td>
</tr>
<tr>
<td>192 × <code>nOutputsSapling</code></td>
<td><code>vOutputProofsSapling</code></td>
<td><code>byte[192 * nOutputsSapling]</code></td>
<td>Encodings of the zk-SNARK proofs for each Sapling Output.</td>
</tr>
<tr>
<td>64</td>
<td><code>bindingSigSapling</code></td>
<td><code>byte[64]</code></td>
<td>A Sapling binding signature on the SIGHASH transaction hash.</td>
</tr>
<tr>
<td colspan="4"><strong>Orchard Transaction Fields</strong></td>
</tr>
<tr>
<td>varies</td>
<td><code>nActionGroupsOrchard</code></td>
<td><code>compactSize</code></td>
<td>The number of Action Group descriptions in <code>vActionGroupsOrchard</code>.</td>
</tr>
<tr>
<td>varies</td>
<td><code>vActionGroupsOrchard</code></td>
<td><code>ActionGroupDescription[nActionGroupsOrchard]</code></td>
<td>A sequence of Action Group descriptions, encoded as per the <a href="#orchardzsa-action-group-description">OrchardZSA Action Group Description</a>.</td>
</tr>
<tr>
<td>8</td>
<td><code>valueBalanceOrchard</code></td>
<td><code>int64</code></td>
<td>The net value of Orchard spends minus outputs.</td>
</tr>
<tr>
<td>64</td>
<td><code>bindingSigOrchard</code></td>
<td><code>byte[64]</code></td>
<td>An OrchardZSA binding signature on the SIGHASH transaction hash.</td>
</tr>
<tr>
<td colspan="4"><strong>ZSA Issuance Fields</strong></td>
</tr>
<tr>
<td>varies</td>
<td><code>nIssueActions</code></td>
<td><code>compactSize</code></td>
<td>The number of issuance actions in the bundle.</td>
</tr>
<tr>
<td>varies</td>
<td><code>vIssueActions</code></td>
<td><code>IssueAction[nIssueActions]</code></td>
<td>A sequence of issuance action descriptions.</td>
</tr>
<tr>
<td>32</td>
<td><code>ik</code></td>
<td><code>byte[32]</code></td>
<td>The issuance validating key of the issuer, used to validate the signature.</td>
</tr>
<tr>
<td>64</td>
<td><code>issueAuthSig</code></td>
<td><code>byte[64]</code></td>
<td>The signature of the transaction SIGHASH, signed by the issuer, validated as in Issuance Authorization Signature Scheme <a id="footnote-reference-8" class="footnote_reference" href="#zip-0227">10</a>.</td>
</tr>
<tr>
<td colspan="4"><strong>Memo Bundle Fields</strong></td>
</tr>
<tr>
<td>1</td>
<td><code>fAllPruned</code></td>
<td><code>uint8</code></td>
<td>1 if all chunks have been pruned, otherwise 0.</td>
</tr>
<tr>
<td>32</td>
<td><code>nonceOrHash</code></td>
<td><code>byte[32]</code></td>
<td>The nonce for deriving encryption keys, or the overall hash.</td>
</tr>
<tr>
<td>varies</td>
<td><code>nMemoChunks</code></td>
<td><code>compactSize</code></td>
<td>The number of memo chunks.</td>
</tr>
<tr>
<td>varies</td>
<td><code>pruned</code></td>
<td><code>byte[</code>
<span class="math">\(\mathsf{ceiling}(\mathtt{nMemoChunks}/8)\)</span>
<code>]</code></td>
<td>Bitflags indicating the type of each entry in <code>vMemoChunks</code>.</td>
</tr>
<tr>
<td>varies</td>
<td><code>vMemoChunks</code></td>
<td><code>MemoChunk[nMemoChunks]</code></td>
<td>A sequence of encrypted memo chunks.</td>
</tr>
</tbody>
</table>
<ul>
<li>The fields <code>valueBalanceSapling</code> and <code>bindingSigSapling</code> are present if and only if
<span class="math">\(\mathtt{nSpendsSapling} + \mathtt{nOutputsSapling} &gt; 0\!\)</span>
. If <code>valueBalanceSapling</code> is not present, then
<span class="math">\(\mathsf{v^{balanceSapling}}\)</span>
is defined to be
<span class="math">\(0\!\)</span>
.</li>
<li>The field <code>anchorSapling</code> is present if and only if
<span class="math">\(\mathtt{nSpendsSapling} &gt; 0\!\)</span>
.</li>
<li>The elements of <code>vSpendProofsSapling</code> and <code>vSpendAuthSigsSapling</code> have a 1:1 correspondence to the elements of <code>vSpendsSapling</code> and MUST be ordered such that the proof or signature at a given index corresponds to the <code>SpendDescriptionV6</code> at the same index.</li>
<li>The elements of <code>vOutputProofsSapling</code> have a 1:1 correspondence to the elements of <code>vOutputsSapling</code> and MUST be ordered such that the proof at a given index corresponds to the <code>OutputDescriptionV6</code> at the same index.</li>
<li>The fields <code>valueBalanceOrchard</code> and <code>bindingSigOrchard</code> are present if and only if
<span class="math">\(\mathtt{nActionGroupsOrchard} &gt; 0\!\)</span>
. If <code>valueBalanceOrchard</code> is not present, then
<span class="math">\(\mathsf{v^{balanceOrchard}}\)</span>
is defined to be
<span class="math">\(0\!\)</span>
.</li>
<li>The fields <code>ik</code> and <code>issueAuthSig</code> are present if and only if
<span class="math">\(\mathtt{nIssueActions} &gt; 0\!\)</span>
.</li>
<li>For coinbase transactions, the <code>enableSpendsOrchard</code> and <code>enableZSAs</code> bits MUST be set to
<span class="math">\(0\!\)</span>
.</li>
<li>The fields <code>nMemoChunks</code>, <code>pruned</code>, and <code>vMemoChunks</code> are present if and only if <code>fAllPruned == 0</code>.</li>
<li>If <code>fAllPruned == 0</code>, then:
<ul>
<li><code>nonceOrHash</code> contains the ZIP 231 nonce for deriving encryption keys.</li>
<li>Each bit of <code>pruned</code>, in little-endian order, indicates the type of the corresponding entry in <code>vMemoChunks</code>.
<ul>
<li>A bit value of 0 indicates that the entry will be of type <code>byte[272]</code> representing an encrypted memo chunk.</li>
<li>A bit value of 1 indicates the entry will be a <code>byte[32]</code> and contains the ZIP 246 <code>memo_chunk_digest</code> for a pruned chunk.</li>
</ul>
</li>
</ul>
</li>
<li>If <code>fAllPruned == 1</code>, then:
<ul>
<li><code>nonceOrHash</code> contains the ZIP 246 <code>memo_digest</code> for the pruned memo bundle.</li>
</ul>
</li>
</ul>
<p>The encodings of <code>tx_in</code>, and <code>tx_out</code> are as in a version 4 transaction (i.e. unchanged from Canopy). The encodings of <code>SpendDescriptionV6</code>, <code>OutputDescriptionV6</code> , <code>ActionGroupDescription</code>, <code>AssetBurn</code> and <code>IssueAction</code> are described below. The encoding of Sapling Spends and Outputs has changed relative to prior versions in order to better separate data that describe the effects of the transaction from the proofs of and commitments to those effects, and for symmetry with this separation in the Orchard-related parts of the transaction format.</p>
</section>
<section id="sapling-output-description-outputdescriptionv6"><h3><span class="section-heading">Sapling Output Description (<code>OutputDescriptionV6</code>)</span><span class="section-anchor"> <a rel="bookmark" href="#sapling-output-description-outputdescriptionv6"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h3>
<table>
<thead>
<tr>
<th>Bytes</th>
<th>Name</th>
<th>Data Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>32</td>
<td><code>cv</code></td>
<td><code>byte[32]</code></td>
<td>A value commitment to the net value of the output note.</td>
</tr>
<tr>
<td>32</td>
<td><code>cmu</code></td>
<td><code>byte[32]</code></td>
<td>The
<span class="math">\(u\!\)</span>
-coordinate of the note commitment for the output note.</td>
</tr>
<tr>
<td>32</td>
<td><code>ephemeralKey</code></td>
<td><code>byte[32]</code></td>
<td>An encoding of an ephemeral Jubjub public key.</td>
</tr>
<tr>
<td>100</td>
<td><code>encCiphertext</code></td>
<td><code>byte[100]</code></td>
<td>The encrypted contents of the note plaintext.</td>
</tr>
<tr>
<td>80</td>
<td><code>outCiphertext</code></td>
<td><code>byte[80]</code></td>
<td>The encrypted contents of the byte string created by concatenation of the transmission key with the ephemeral secret key.</td>
</tr>
</tbody>
</table>
<p>The encodings of each of these elements are defined in §7.4 Output Description Encoding and Consensus of the Zcash Protocol Specification <a id="footnote-reference-9" class="footnote_reference" href="#protocol-outputdesc">4</a>.</p>
</section>
<section id="orchardzsa-action-group-description"><h3><span class="section-heading">OrchardZSA Action Group Description</span><span class="section-anchor"> <a rel="bookmark" href="#orchardzsa-action-group-description"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h3>
<p>The OrchardZSA Action Group Description is encoded in a transaction as an instance of an <code>ActionGroupDescription</code> type:</p>
<table>
<thead>
<tr>
<th>Bytes</th>
<th>Name</th>
<th>Data Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>varies</td>
<td><code>nActionsOrchard</code></td>
<td><code>compactSize</code></td>
<td>The number of Action descriptions in <code>vActionsOrchard</code>. This MUST have a value strictly greater than <code>0</code>.</td>
</tr>
<tr>
<td>372 × <code>nActionsOrchard</code></td>
<td><code>vActionsOrchard</code></td>
<td><code>OrchardZSAAction[nActionsOrchard]</code></td>
<td>A sequence of OrchardZSA Action descriptions in the Action Group.</td>
</tr>
<tr>
<td>1</td>
<td><code>flagsOrchard</code></td>
<td><code>byte</code></td>
<td>As defined in Section 7.1 of the Protocol Specification <a id="footnote-reference-10" class="footnote_reference" href="#protocol-txnencoding">6</a>.</td>
</tr>
<tr>
<td>32</td>
<td><code>anchorOrchard</code></td>
<td><code>byte[32]</code></td>
<td>As defined in Section 7.1 of the Protocol Specification <a id="footnote-reference-11" class="footnote_reference" href="#protocol-txnencoding">6</a>.</td>
</tr>
<tr>
<td>4</td>
<td><code>nAGExpiryHeight</code></td>
<td><code>uint32</code></td>
<td>A block height in the range {1 .. 499999999} after which any transaction including this Action Group cannot be mined, or 0 if this Action Group places no constraint on transaction expiry.</td>
</tr>
<tr>
<td>varies</td>
<td><code>nAssetBurn</code></td>
<td><code>compactSize</code></td>
<td>The number of Assets burnt.</td>
</tr>
<tr>
<td>40 × <code>nAssetBurn</code></td>
<td><code>vAssetBurn</code></td>
<td><code>AssetBurn[nAssetBurn]</code></td>
<td>
<dl>
<dt>A sequence of Asset Burn descriptions, encoded per</dt>
<dd>encoded per <a href="#orchardzsa-asset-burn-description">OrchardZSA Asset Burn Description</a>.</dd>
</dl>
</td>
</tr>
<tr>
<td>varies</td>
<td><code>sizeProofsOrchard</code></td>
<td><code>compactSize</code></td>
<td>As defined in Section 7.1 of the Protocol Specification <a id="footnote-reference-12" class="footnote_reference" href="#protocol-txnencoding">6</a>.</td>
</tr>
<tr>
<td><code>sizeProofsOrchard</code></td>
<td><code>proofsOrchard</code></td>
<td><code>byte[sizeProofsOrchard]</code></td>
<td>The aggregated zk-SNARK proof for all Actions in the Action Group.</td>
</tr>
<tr>
<td>64 × <code>nActionsOrchard</code></td>
<td><code>vSpendAuthSigsOrchard</code></td>
<td><code>byte[64 * nActionsOrchard]</code></td>
<td>Authorizing signatures for each Action of the Action Group in a transaction.</td>
</tr>
</tbody>
</table>
<p>The encodings of <code>OrchardZSAAction</code> and <code>AssetBurn</code> are described below.</p>
<ul>
<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>
<li>If thee value of <code>nAGExpiryHeight</code> is nonzero, it MUST be consistent with the <code>nExpiryHeight</code> of the overall transaction.</li>
<li>In NU7, <code>nExpiryHeight</code> MUST be set to <code>0</code>; this restriction is expected to be lifted in a future network upgrade.</li>
</ul>
<section id="rationale-for-nagexpiryheight"><h4><span class="section-heading">Rationale for nAGExpiryHeight</span><span class="section-anchor"> <a rel="bookmark" href="#rationale-for-nagexpiryheight"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h4>
<p>We introduce the <code>nAGExpiryHeight</code> field in this transaction format in order to be forward compatible with Swaps over ZSAs, as proposed in ZIP 228 <a id="footnote-reference-13" class="footnote_reference" href="#zip-0228">11</a>. For the OrchardZSA protocol, which does not make use of an additional expiry height for transactions, we set the value of <code>nAGExpiryHeight</code> to be <code>0</code> by consensus. This serves as a default value to represent the situation where there is no expiry, analogous to the convention adopted for <code>nExpiryHeight</code> in ZIP 203 [#zip-0203].</p>
</section>
<section id="rationale-for-including-burn-fields-inside-orchardzsa-action-groups"><h4><span class="section-heading">Rationale for including Burn fields inside OrchardZSA Action Groups</span><span class="section-anchor"> <a rel="bookmark" href="#rationale-for-including-burn-fields-inside-orchardzsa-action-groups"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h4>
<p>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.</p>
</section>
</section>
<section id="orchardzsa-action-description-orchardzsaaction"><h3><span class="section-heading">OrchardZSA Action Description (<code>OrchardZSAAction</code>)</span><span class="section-anchor"> <a rel="bookmark" href="#orchardzsa-action-description-orchardzsaaction"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h3>
<table>
<thead>
<tr>
<th>Bytes</th>
<th>Name</th>
<th>Data Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>32</td>
<td><code>cv</code></td>
<td><code>byte[32]</code></td>
<td>A value commitment to the net value of the input note minus the output note.</td>
</tr>
<tr>
<td>32</td>
<td><code>nullifier</code></td>
<td><code>byte[32]</code></td>
<td>The nullifier of the input note.</td>
</tr>
<tr>
<td>32</td>
<td><code>rk</code></td>
<td><code>byte[32]</code></td>
<td>The randomized validating key for the element of <code>spendAuthSigsOrchard</code> corresponding to this Action.</td>
</tr>
<tr>
<td>32</td>
<td><code>cmx</code></td>
<td><code>byte[32]</code></td>
<td>The
<span class="math">\(x\!\)</span>
-coordinate of the note commitment for the output note.</td>
</tr>
<tr>
<td>32</td>
<td><code>ephemeralKey</code></td>
<td><code>byte[32]</code></td>
<td>An encoding of an ephemeral Pallas public key.</td>
</tr>
<tr>
<td>132</td>
<td><code>encCiphertext</code></td>
<td><code>byte[132]</code></td>
<td>The encrypted contents of the note plaintext.</td>
</tr>
<tr>
<td>80</td>
<td><code>outCiphertext</code></td>
<td><code>byte[80]</code></td>
<td>The encrypted contents of the byte string created by concatenation of the transmission key with the ephemeral secret key.</td>
</tr>
</tbody>
</table>
<p>The encodings of each of these elements are defined in §7.5 Action Description Encoding and Consensus of the Zcash Protocol Specification <a id="footnote-reference-14" class="footnote_reference" href="#protocol-actiondesc">5</a>.</p>
</section>
<section id="orchardzsa-asset-burn-description"><h3><span class="section-heading">OrchardZSA Asset Burn Description</span><span class="section-anchor"> <a rel="bookmark" href="#orchardzsa-asset-burn-description"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h3>
<p>An OrchardZSA Asset Burn description is encoded in a transaction as an instance of an <code>AssetBurn</code> type:</p>
<table>
<thead>
<tr>
<th>Bytes</th>
<th>Name</th>
<th>Data Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>32</td>
<td><code>AssetBase</code></td>
<td><code>byte[32]</code></td>
<td>For the OrchardZSA protocol, this is the encoding of the Asset Base
<span class="math">\(\mathsf{AssetBase^{Orchard}}\!\)</span>
.</td>
</tr>
<tr>
<td>8</td>
<td><code>valueBurn</code></td>
<td><code>uint64</code></td>
<td>The amount being burnt. The value is checked by consensus to be non-zero.</td>
</tr>
</tbody>
</table>
<p>The encodings of each of these elements are defined in ZIP 226 <a id="footnote-reference-15" class="footnote_reference" href="#zip-0226">9</a>.</p>
</section>
<section id="issuance-action-description-issueaction"><h3><span class="section-heading">Issuance Action Description (<code>IssueAction</code>)</span><span class="section-anchor"> <a rel="bookmark" href="#issuance-action-description-issueaction"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h3>
<p>An issuance action, <code>IssueAction</code>, is the instance of issuing a specific Custom Asset, and contains the following fields:</p>
<table>
<thead>
<tr>
<th>Bytes</th>
<th>Name</th>
<th>Data Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>32</td>
<td><code>assetDescHash</code></td>
<td><code>byte[32]</code></td>
<td>A hash of the description of the Custom Asset.</td>
</tr>
<tr>
<td>varies</td>
<td><code>nNotes</code></td>
<td><code>compactSize</code></td>
<td>The number of notes in the Issuance Action.</td>
</tr>
<tr>
<td>147 × <code>nNotes</code></td>
<td><code>vNotes</code></td>
<td><code>IssueNote[nNotes]</code></td>
<td>A sequence of note descriptions within the Issuance Action.</td>
</tr>
<tr>
<td>1</td>
<td><code>flagsIssuance</code></td>
<td><code>byte</code></td>
<td>
<p>An 8-bit value representing a set of flags. Ordered from LSB to MSB:</p>
<ul>
<li>
<span class="math">\(\mathsf{finalize}\)</span>
</li>
<li>The remaining bits are set to
<span class="math">\(0\!\)</span>
.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>The encoding of <code>IssueNote</code> is described below. Note that we allow the number of notes (represented by <code>nNotes</code>) to be zero. This allows for issuers to create Issuance Actions to only finalize an issued Asset, without needing them to simultaneously issue more of that Asset.</p>
</section>
<section id="issue-note-description-issuenote"><h3><span class="section-heading">Issue Note Description (<code>IssueNote</code>)</span><span class="section-anchor"> <a rel="bookmark" href="#issue-note-description-issuenote"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h3>
<p>An issuance note, <code>IssueNote</code> contains the following fields:</p>
<table>
<thead>
<tr>
<th>Bytes</th>
<th>Name</th>
<th>Data Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>43</td>
<td><code>recipient</code></td>
<td><code>byte[43]</code></td>
<td>The encoding of a recipient's diversified payment address, as
<span class="math">\(\mathsf{LEBS2OSP}_{88}(\mathsf{d})\|
\mathsf{LEBS2OSP}_{256}(\mathsf{repr}_{\mathbb{P}}
(\mathsf{pk}_\mathsf{d}))\!\)</span>
, where
<span class="math">\(\mathsf{d}\)</span>
is the diversifier and
<span class="math">\(\mathsf{pk_d}\)</span>
is the diversified transmission key. <strong>Non Normative Note</strong>: This is the same as the encoding of an Orchard Raw Payment Address, as defined in the protocol specification §5.6.4.2 Orchard Raw Payment Addresses.</td>
</tr>
<tr>
<td>8</td>
<td><code>value</code></td>
<td><code>uint64</code></td>
<td>The amount being issued in this note.</td>
</tr>
<tr>
<td>32</td>
<td><code>rho</code></td>
<td><code>byte[32]</code></td>
<td>This is defined and encoded in the same manner as for Orchard notes in protocol §3.2.1 'Note Plaintexts and Memo Fields'.</td>
</tr>
<tr>
<td>32</td>
<td><code>rseed</code></td>
<td><code>byte[32]</code></td>
<td>The <code>rseed</code> field of the note, encoded as for Orchard notes in protocol §3.2.1 'Note Plaintexts and Memo Fields'.</td>
</tr>
</tbody>
</table>
</section>
</section>
<section id="deployment"><h2><span class="section-heading">Deployment</span><span class="section-anchor"> <a rel="bookmark" href="#deployment"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h2>
<p>Version 6 transactions are proposed to be allowed on the network starting from Network Upgrade 7. <a id="footnote-reference-16" class="footnote_reference" href="#zip-0254">13</a></p>
</section>
<section id="reference-implementation"><h2><span class="section-heading">Reference implementation</span><span class="section-anchor"> <a rel="bookmark" href="#reference-implementation"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h2>
<p>TODO</p>
</section>
<section id="references"><h2><span class="section-heading">References</span><span class="section-anchor"> <a rel="bookmark" href="#references"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h2>
<table id="bcp14" class="footnote">
<tbody>
<tr>
<th>1</th>
<td><a href="https://www.rfc-editor.org/info/bcp14">Information on BCP 14 — "RFC 2119: Key words for use in RFCs to Indicate Requirement Levels" and "RFC 8174: Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words"</a></td>
</tr>
</tbody>
</table>
<table id="protocol" class="footnote">
<tbody>
<tr>
<th>2</th>
<td><a href="protocol/protocol.pdf">Zcash Protocol Specification, Version 2024.5.1 or later [NU6]</a></td>
</tr>
</tbody>
</table>
<table id="protocol-spenddesc" class="footnote">
<tbody>
<tr>
<th>3</th>
<td><a href="protocol/protocol.pdf#spenddesc">Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.4: Spend Descriptions</a></td>
</tr>
</tbody>
</table>
<table id="protocol-outputdesc" class="footnote">
<tbody>
<tr>
<th>4</th>
<td><a href="protocol/protocol.pdf#outputdesc">Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.5: Output Descriptions</a></td>
</tr>
</tbody>
</table>
<table id="protocol-actiondesc" class="footnote">
<tbody>
<tr>
<th>5</th>
<td><a href="protocol/protocol.pdf#actiondesc">Zcash Protocol Specification, Version 2024.5.1 [NU6]. Section 4.6: Action Descriptions</a></td>
</tr>
</tbody>
</table>
<table id="protocol-txnencoding" class="footnote">
<tbody>
<tr>
<th>6</th>
<td><a href="protocol/protocol.pdf#txnencoding">Zcash Protocol Specification, Version 2022.3.8. Section 7.1: Transaction Encoding and Consensus</a></td>
</tr>
</tbody>
</table>
<table id="zip-0203" class="footnote">
<tbody>
<tr>
<th>7</th>
<td><a href="zip-0203.html">ZIP 203: Transaction Expiry</a></td>
</tr>
</tbody>
</table>
<table id="zip-0225" class="footnote">
<tbody>
<tr>
<th>8</th>
<td><a href="zip-0225.html">ZIP 225: Version 5 Transaction Format</a></td>
</tr>
</tbody>
</table>
<table id="zip-0226" class="footnote">
<tbody>
<tr>
<th>9</th>
<td><a href="zip-0226.html">ZIP 226: Transfer and Burn of Zcash Shielded Assets</a></td>
</tr>
</tbody>
</table>
<table id="zip-0227" class="footnote">
<tbody>
<tr>
<th>10</th>
<td><a href="zip-0227.html">ZIP 227: Issuance of Zcash Shielded Assets</a></td>
</tr>
</tbody>
</table>
<table id="zip-0228" class="footnote">
<tbody>
<tr>
<th>11</th>
<td><a href="zip-0228.html">ZIP 228: Asset Swaps for Zcash Shielded Assets</a></td>
</tr>
</tbody>
</table>
<table id="zip-0244" class="footnote">
<tbody>
<tr>
<th>12</th>
<td><a href="zip-0244.html">ZIP 244: Transaction Identifier Non-Malleability</a></td>
</tr>
</tbody>
</table>
<table id="zip-0254" class="footnote">
<tbody>
<tr>
<th>13</th>
<td><a href="zip-0254">ZIP 254: Deployment of the NU7 Network Upgrade</a></td>
</tr>
</tbody>
</table>
</section>
</section>
</body>
</html>