Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZSA Protocol: Transfer, Issuance and Burn: ZIPs 226, 227, and 230 #854

Merged
merged 22 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
472ebe7
Adding the `orchard_zsa_burn_digest` to the TxId digest. (#53)
vivek-arte Apr 16, 2024
be397c7
Setting transaction to contain issuance fields if and only if a non-z…
vivek-arte May 17, 2024
d8fba69
Updating the spec for clarity and parity with the implementation of t…
vivek-arte Jul 19, 2024
92691d9
Renaming psi' to psi^{nf} in ZIP 226 (#56)
vivek-arte Aug 5, 2024
ddf9a91
Merge branch 'main' into zsa1
vivek-arte Aug 8, 2024
be9d90c
Clarification about protocol behaviour when enableZSAs is set to true…
vivek-arte Aug 11, 2024
993b893
Adding latest zsa1 update
vivek-arte Aug 11, 2024
05766a3
Merging upstream changes and repository restructuring into zsa1 (#58)
vivek-arte Aug 12, 2024
c0c2600
Updating specification of the global issuance state, the issued_asset…
vivek-arte Aug 15, 2024
4003a8f
Adding symbolic link from the rendered folder to the docs folder (#60)
vivek-arte Aug 20, 2024
32516a4
Improved description of the burn mechanism, and rationale for asset d…
vivek-arte Sep 25, 2024
f5a6dd7
commenting out CI token lines to allow CI to build
vivek-arte Sep 25, 2024
4985eac
Merging 'main' branch into 'zsa1' to catch up with upstream changes (…
vivek-arte Sep 26, 2024
0da1b34
commenting out CI token lines to allow CI to build
vivek-arte Sep 25, 2024
0687ce8
Catching up with upstream post NU6 updates (#69)
vivek-arte Sep 27, 2024
d517f5d
Updating references to protocol spec, and fixing some old links (#70)
vivek-arte Sep 29, 2024
993e6dc
[ZSA] Issuance Key Derivation update to match with ZIP 32 (#72)
vivek-arte Oct 8, 2024
20ef938
Applying suggestions from ZIP review
vivek-arte Oct 31, 2024
61d4e20
updating HTML files based on ZIP review
vivek-arte Nov 5, 2024
edc4c98
further html change
vivek-arte Nov 5, 2024
2e8876c
[ZSA] Applying suggestions from ZIP Review (#75)
vivek-arte Nov 5, 2024
aa0de9b
[ZSA] Adding fees details to ZIP 230 (#76)
vivek-arte Nov 5, 2024
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
4 changes: 2 additions & 2 deletions .github/workflows/render.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
with:
token: ${{ secrets.CI_TOKEN }}
# with:
# token: ${{ secrets.CI_TOKEN }}

- name: Compile ZIPs and Zcash Protocol Specification
uses: ./.github/actions/render
Expand Down
1 change: 1 addition & 0 deletions docs
248 changes: 147 additions & 101 deletions rendered/zip-0226.html

Large diffs are not rendered by default.

211 changes: 136 additions & 75 deletions rendered/zip-0227.html

Large diffs are not rendered by default.

97 changes: 71 additions & 26 deletions rendered/zip-0230.html
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,6 @@
<td><code>byte[64 * nActionsOrchard]</code></td>
<td>Authorizing signatures for each Orchard-ZSA Action.</td>
</tr>
<tr>
<td><code>64</code></td>
<td><code>bindingSigOrchard</code></td>
<td><code>byte[64]</code></td>
<td>An Orchard binding signature on the SIGHASH transaction hash.</td>
</tr>
<tr>
<td colspan="4"><strong>Orchard-ZSA Burn Fields</strong></td>
</tr>
<tr>
<td><code>varies</code></td>
<td><code>nAssetBurn</code></td>
Expand All @@ -284,6 +275,12 @@
<td><code>AssetBurn[nAssetBurn]</code></td>
<td>A sequence of Asset Burn descriptions, encoded per <a href="#orchard-zsa-asset-burn-description">Orchard-ZSA Asset Burn Description</a>.</td>
</tr>
<tr>
<td><code>64</code></td>
<td><code>bindingSigOrchard</code></td>
<td><code>byte[64]</code></td>
<td>An Orchard-ZSA binding signature on the SIGHASH transaction hash.</td>
</tr>
<tr>
<td colspan="4"><strong>Orchard-ZSA Issuance Fields</strong></td>
</tr>
Expand Down Expand Up @@ -324,16 +321,19 @@
<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>flagsOrchard</code>, <code>valueBalanceOrchard</code>, <code>anchorOrchard</code>, <code>sizeProofsOrchardZSA</code>, <code>proofsOrchardZSA</code>, and <code>bindingSigOrchard</code> are present if and only if
<span class="math">\(\mathtt{nActionsOrchard} &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 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 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>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>
Expand Down Expand Up @@ -502,10 +502,8 @@
<tr>
<td>8</td>
<td><code>valueBurn</code></td>
<td>
<span class="math">\(\{1 .. 2^{64} - 1\}\)</span>
</td>
<td>The amount being burnt.</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>
Expand All @@ -524,9 +522,9 @@
</thead>
<tbody>
<tr>
<td><code>2</code></td>
<td><code>varies</code></td>
<td><code>assetDescSize</code></td>
<td><code>byte</code></td>
<td><code>compactSize</code></td>
<td>The length of the asset description string in bytes.</td>
</tr>
<tr>
Expand All @@ -539,13 +537,13 @@
<td><code>varies</code></td>
<td><code>nNotes</code></td>
<td><code>compactSize</code></td>
<td>The number of notes in the issuance action.</td>
<td>The number of notes in the Issuance Action.</td>
</tr>
<tr>
<td><code>noteSize * nNotes</code></td>
<td><code>147 * nNotes</code></td>
<td><code>vNotes</code></td>
<td><code>Note[nNotes]</code></td>
<td>A sequence of note descriptions within the issuance action, where <code>noteSize</code> is the size, in bytes, of a Note.</td>
<td><code>IssueNote[nNotes]</code></td>
<td>A sequence of note descriptions within the Issuance Action.</td>
</tr>
<tr>
<td><code>1</code></td>
Expand All @@ -569,7 +567,54 @@
</tr>
</tbody>
</table>
<p>The encodings of each of these elements are defined in ZIP 227 <a id="footnote-reference-9" class="footnote_reference" href="#zip-0227">7</a>.</p>
<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><code>43</code></td>
<td><code>recipient</code></td>
<td><code>byte[43]</code></td>
<td>The raw encoding of an Orchard Raw Payment Address, as per protocol §5.6.4.2 ‘Orchard Raw Payment Addresses’.</td>
</tr>
<tr>
<td><code>8</code></td>
<td><code>value</code></td>
<td><code>uint64</code></td>
<td>The amount being issued in this note.</td>
</tr>
<tr>
<td><code>32</code></td>
<td><code>assetBase</code></td>
<td><code>byte[32]</code></td>
<td>The encoding of the Asset Base
<span class="math">\(\mathsf{AssetBase^{Orchard}}\!\)</span>
, as defined in 'ZIP 227'.</td>
</tr>
<tr>
<td><code>32</code></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 'Notes'.</td>
</tr>
<tr>
<td><code>32</code></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 'Notes'.</td>
</tr>
</tbody>
</table>
</section>
</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>
Expand All @@ -588,31 +633,31 @@
<tbody>
<tr>
<th>2</th>
<td><a href="protocol/protocol.pdf">Zcash Protocol Specification, Version 2023.4.0 or later [NU5 proposal]</a></td>
<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 2023.4.0 [NU5 proposal]. Section 4.4: Spend Descriptions</a></td>
<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 2023.4.0 [NU5 proposal]. Section 4.5: Output Descriptions</a></td>
<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 2023.4.0 [NU5 proposal]. Section 4.6: Action Descriptions</a></td>
<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>
Expand Down
Loading