Skip to content

Commit cbd44be

Browse files
Added some latex beautifying and minor rephrasing
1 parent 93af631 commit cbd44be

File tree

2 files changed

+51
-41
lines changed

2 files changed

+51
-41
lines changed

rendered/draft-approval.html

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<p>The terms "Asset" and "ZSA" in this document are to be interpreted as described in ZIP 227 <a id="footnote-reference-4" class="footnote_reference" href="#zip-0227">5</a>.</p>
2727
</section>
2828
<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>
29-
<p>This ZIP proposes transaction user controls - a mechanism allowing recipients of shielded funds to actively participate in the transfer of Assets by approving or rejecting incoming transactions.</p>
29+
<p>This ZIP specifies user controls for transactions - a mechanism allowing recipients of shielded funds to actively participate in the transfer of Assets by approving or rejecting incoming transactions.</p>
3030
</section>
3131
<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>
3232
<p>In the current version of Zcash, fund transfers occur without the explicit consent of recipients. While this simplicity offers convenience, it creates significant challenges for users of the network (e.g. individuals or businesses). The goal of this ZIP is to design a mechanism where the recipient of shielded funds on Zcash (for any type of ZSA) can confirm (or ‘approve’) the receipt of the funds on chain. This enhancement addresses crucial needs in the Zcash ecosystem, particularly at a time when privacy-preserving assets face increased scrutiny from major cryptocurrency exchanges. The proposed controls offer robust safeguarding solutions while maintaining Zcash’s core privacy features.</p>
@@ -57,42 +57,42 @@
5757
<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>
5858
<p>Most of the protocol is kept the same as the Orchard protocol released with NU5, except for the following.</p>
5959
<section id="approval-signature"><h3><span class="section-heading">Approval Signature</span><span class="section-anchor"> <a rel="bookmark" href="#approval-signature"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h3>
60-
<p>Given the Orchard address of the recipient of the output note of an Orchard Action (in the form:
61-
<span class="math">\(d | pk_d\!\)</span>
62-
, see <a id="footnote-reference-7" class="footnote_reference" href="#protocol-raw-address">9</a>), and given that
63-
<span class="math">\(g_d\)</span>
64-
is a Pallas curve point, derived from
65-
<span class="math">\(d\)</span>
66-
(see <a id="footnote-reference-8" class="footnote_reference" href="#protocol-diversify-hash">10</a>) - the approval signature derivation goes as follows:</p>
60+
<p>Let
61+
<span class="math">\((\mathsf{d}, \mathsf{pk_d})\)</span>
62+
be the Orchard shielded payment address of the recipient of the output note of an Orchard Action <a id="footnote-reference-7" class="footnote_reference" href="#protocol-raw-address">9</a>. Let
63+
<span class="math">\(\mathsf{g_d}\)</span>
64+
be derived from the diversifier
65+
<span class="math">\(\mathsf{d}\)</span>
66+
as in §5.4.1.6 of the protocol specification <a id="footnote-reference-8" class="footnote_reference" href="#protocol-diversify-hash">10</a>. The approval signature is derived as follows:</p>
6767
<ol type="1">
6868
<li>The sender sends the
69-
<span class="math">\(OrchardActionDescription\)</span>
69+
<span class="math">\(\mathtt{OrchardActionDescription}\)</span>
7070
(the preimage of the message to be signed, as per <a id="footnote-reference-9" class="footnote_reference" href="#protocol-actions">8</a>) for the recipient to sign.</li>
7171
<li>
7272
<dl>
7373
<dt>The recipient executes the following steps:</dt>
7474
<dd>
7575
<ul>
7676
<li>
77-
<span class="math">\(m \gets H(OrchardActionDescription)\)</span>
77+
<span class="math">\(m \gets H(\mathtt{OrchardActionDescription})\)</span>
7878
</li>
7979
<li>
8080
<span class="math">\(r \overset{R}{\leftarrow} \mathbb{Z}_{r_{\mathbb{P}}}\!\)</span>
8181
, where
8282
<span class="math">\(\mathbb{Z}_{r_{\mathbb{P}}}\)</span>
8383
is the scalar field of Pallas <a id="footnote-reference-10" class="footnote_reference" href="#protocol-pallas-vesta">11</a>, and where
8484
<span class="math">\(\overset{R}{\leftarrow}\)</span>
85-
denotes a variable assignment uniformly at random from a given set.</li>
85+
denotes a variable assignment uniformly at random from a given set <a id="footnote-reference-11" class="footnote_reference" href="#protocol-notation">16</a>.</li>
8686
<li>
87-
<span class="math">\(u \gets [r]g_d\!\)</span>
88-
, a Pallas point</li>
87+
<span class="math">\(u \gets [r] \mathsf{g_d}\)</span>
88+
</li>
8989
<li>
90-
<span class="math">\(C \gets H(g_d, pk_d, u, m) \mod r_{\mathbb{P}}\!\)</span>
90+
<span class="math">\(C \gets H(g_d || pk_d || u || m) \mod r_{\mathbb{P}}\!\)</span>
9191
, an element of Pallas' scalar field, and where
9292
<span class="math">\(H\)</span>
9393
is a secure hash function (e.g. SHA256 or Blake2)</li>
9494
<li>
95-
<span class="math">\(s \gets r + C * ivk \mod r_{\mathbb{P}}\!\)</span>
95+
<span class="math">\(s \gets r + C \cdot \mathsf{ivk} \mod r_{\mathbb{P}}\!\)</span>
9696
, an element of Pallas' scalar field</li>
9797
<li>
9898
<span class="math">\(\sigma_{approval} \gets (u, s)\)</span>
@@ -113,28 +113,30 @@
113113
<section id="rationale-for-approval-signature"><h4><span class="section-heading">Rationale for Approval Signature</span><span class="section-anchor"> <a rel="bookmark" href="#rationale-for-approval-signature"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h4>
114114
<p>To prove that the correct recipient of the output notes of an Orchard Action approves (the transfer of funds represented by) the Action, we want to show that the approval signature has been generated with a signing key that is derived from the spending key of the recipient of the output notes of the Action. In other words, we want to prove that the approval signature is generated by the network user who "knows" the spending key of the output notes of the Action. Doing so means that only the recipient of the note created in the Orchard Action can approve the payment.</p>
115115
<p>To achieve this, we look into the key structure of Zcash Orchard. We know that the Orchard address is of the form:
116-
<span class="math">\(d | pk_d\!\)</span>
116+
<span class="math">\((\mathsf{d}, \mathsf{pk_d})\!\)</span>
117117
. These 2 fields, the diversifier and the diversified address, are used by the sender when sending notes.</p>
118118
<p>Looking at the Orchard key components derivations, we know that
119-
<span class="math">\(pk_d\)</span>
119+
<span class="math">\(\mathsf{pk_d}\)</span>
120120
is derived as:
121-
<span class="math">\(pk_d := KAOrchard.DerivePublic(ivk, g_d) = [ivk]g_d\!\)</span>
122-
, see <a id="footnote-reference-11" class="footnote_reference" href="#protocol-orchard-keys">12</a> and <a id="footnote-reference-12" class="footnote_reference" href="#protocol-key-agreement">13</a></p>
121+
<span class="math">\(\mathsf{pk_d} =mathsf{KAOrchard.DerivePublic}(\mathsf{ivk}, \mathsf{g_d}) = [\mathsf{ivk}]\mathsf{g_d}\)</span>
122+
[#protocol-orchard-keys]_```</p>
123123
<p>Given that
124-
<span class="math">\(ivk\)</span>
124+
<span class="math">\(\mathsf{ivk}\)</span>
125125
is derived from the spending key of the recipient of the funds, we can prove that the recipient of the funds in an Orchard Action is approving the receipt of the funds, by using a proof of knowledge of
126-
<span class="math">\(ivk\!\)</span>
126+
<span class="math">\(\mathsf{ivk}\!\)</span>
127127
. Such proof of knowledge of
128-
<span class="math">\(ivk\)</span>
128+
<span class="math">\(\mathsf{ivk}\)</span>
129129
can be obtained by using the Non-Interactive Schnorr Protocol.</p>
130130
<p>In fact, such proof of knowledge of
131-
<span class="math">\(ivk\)</span>
131+
<span class="math">\(\mathsf{ivk}\)</span>
132132
can be obtained by using a Schnorr Signature on the Action (the message) with
133-
<span class="math">\(ivk\)</span>
133+
<span class="math">\(\mathsf{ivk}\)</span>
134134
as signing/secret key and
135-
<span class="math">\(g_d\)</span>
135+
<span class="math">\(\mathsf{g_d}\)</span>
136136
as group generator.</p>
137-
<p><strong>Note:</strong> Zcash Orchard already uses a Schnorr-based signature scheme instantiated with the Pallas curve (see RedPallas <a id="footnote-reference-13" class="footnote_reference" href="#protocol-redpallas">15</a>). As of NU6, RedPallas is used to instantiate
137+
<p><strong>Note:</strong> Zcash Orchard already uses a Schnorr-based signature scheme instantiated with the Pallas curve,
138+
<span class="math">\(\mathsf{RedPallas}\)</span>
139+
<a id="footnote-reference-12" class="footnote_reference" href="#protocol-redpallas">15</a>. As of NU6, RedPallas is used to instantiate
138140
<span class="math">\(SpendAuthSig^{Orchard}\)</span>
139141
and
140142
<span class="math">\(BindingSig^{Orchard}\!\)</span>
@@ -149,7 +151,7 @@
149151
<span class="math">\(\sigma_{approval}\)</span>
150152
</li>
151153
<li>
152-
<span class="math">\(OrchardActionDescription\)</span>
154+
<span class="math">\(\mathtt{OrchardActionDescription}\)</span>
153155
</li>
154156
</ul>
155157
<p>Witness:</p>
@@ -164,7 +166,7 @@
164166
<p>Circuit:</p>
165167
<ul>
166168
<li>
167-
<span class="math">\(C’ \gets H(g_d, pk_d, \sigma_{approval}.u, H(OrchardActionDescription))\)</span>
169+
<span class="math">\(C’ \gets H(g_d || pk_d || \sigma_{approval}.u || H(\mathtt{OrchardActionDescription}))\)</span>
168170
</li>
169171
<li>
170172
<span class="math">\(LHS \gets [\sigma_{approval}.s]g_d\)</span>
@@ -192,7 +194,7 @@
192194
<p>In this case, the Zcash miners could verify the recipient's approval by doing (for each Action in the transaction):</p>
193195
<ol type="1">
194196
<li>
195-
<span class="math">\(C’ \gets H(g_d, pk_d, \sigma_{approval}.u, H(OrchardActionDescription))\)</span>
197+
<span class="math">\(C’ \gets H(g_d, pk_d, \sigma_{approval}.u, H(\mathtt{OrchardActionDescription}))\)</span>
196198
</li>
197199
<li>
198200
<span class="math">\(LHS \gets [\sigma_{approval}.sigma]g_d\)</span>
@@ -234,7 +236,7 @@
234236
</section>
235237
</section>
236238
<section id="modifications-to-the-transaction-format"><h3><span class="section-heading">Modifications to the Transaction Format</span><span class="section-anchor"> <a rel="bookmark" href="#modifications-to-the-transaction-format"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h3>
237-
<p>In order to support this ZIP, the transaction format, as specified in <a id="footnote-reference-14" class="footnote_reference" href="#protocol-tx-encoding">14</a>, must be extended to add the approval signatures, as follows:</p>
239+
<p>In order to support this ZIP, the transaction format, as specified in <a id="footnote-reference-13" class="footnote_reference" href="#protocol-tx-encoding">14</a>, must be extended to add the approval signatures, as follows:</p>
238240
<table>
239241
<thead>
240242
<tr>
@@ -264,7 +266,7 @@
264266
<ol type="1">
265267
<li>Block a payment and deny to have received the "approval request", then accuse the sender to have failed to settle a contractual obligation.</li>
266268
<li>Gain information: By receiving the
267-
<span class="math">\(OrchardActionDescription\)</span>
269+
<span class="math">\(\mathtt{OrchardActionDescription}\)</span>
268270
to approve, recipients gets to see the
269271
<span class="math">\(nullifier\)</span>
270272
of the input note of the Orchard Action before the rest of the network.</li>
@@ -392,6 +394,14 @@
392394
</tr>
393395
</tbody>
394396
</table>
397+
<table id="protocol-notation" class="footnote">
398+
<tbody>
399+
<tr>
400+
<th>16</th>
401+
<td><cite>Zcash Protocol Specification, Version 2024.5.1 [NU6]. 2 Notation</cite> &lt;<a href="https://zips.z.cash/protocol/protocol.pdf#notation">https://zips.z.cash/protocol/protocol.pdf#notation</a>&gt;</td>
402+
</tr>
403+
</tbody>
404+
</table>
395405
</section>
396406
</section>
397407
</body>

zips/draft-approval.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ Most of the protocol is kept the same as the Orchard protocol released with NU5,
7373
Approval Signature
7474
------------------
7575

76-
Given the Orchard address of the recipient of the output note of an Orchard Action (in the form: $d | pk_d$, see [#protocol-raw-address]_), and given that $g_d$ is a Pallas curve point, derived from $d$ (see [#protocol-diversify-hash]_) - the approval signature derivation goes as follows:
76+
Let $(\mathsf{d}, \mathsf{pk_d})$ be the Orchard shielded payment address of the recipient of the output note of an Orchard Action [#protocol-raw-address]_. Let $\mathsf{g_d}$ be derived from the diversifier $\mathsf{d}$ as in §5.4.1.6 of the protocol specification [#protocol-diversify-hash]_. The approval signature is derived as follows:
7777

78-
1. The sender sends the $OrchardActionDescription$ (the preimage of the message to be signed, as per [#protocol-actions]_) for the recipient to sign.
78+
1. The sender sends the $\mathtt{OrchardActionDescription}$ (the preimage of the message to be signed, as per [#protocol-actions]_) for the recipient to sign.
7979
2. The recipient executes the following steps:
80-
- $m \gets H(OrchardActionDescription)$
81-
- $r \overset{R}{\leftarrow} \mathbb{Z}_{r_{\mathbb{P}}}$, where $\mathbb{Z}_{r_{\mathbb{P}}}$ is the scalar field of Pallas [#protocol-pallas-vesta]_, and where $\overset{R}{\leftarrow}$ denotes a variable assignment uniformly at random from a given set.
80+
- $m \gets H(\mathtt{OrchardActionDescription})$
81+
- $r \overset{R}{\leftarrow} \mathbb{Z}_{r_{\mathbb{P}}}$, where $\mathbb{Z}_{r_{\mathbb{P}}}$ is the scalar field of Pallas [#protocol-pallas-vesta]_, and where $\overset{R}{\leftarrow}$ denotes a variable assignment uniformly at random from a given set [#protocol-notation]_.
8282
- $u \gets [r] \mathsf{g_d}$
83-
- $C \gets H(g_d, pk_d, u, m) \mod r_{\mathbb{P}}$, an element of Pallas' scalar field, and where $H$ is a secure hash function (e.g. SHA256 or Blake2)
84-
- $s \gets r + C \cdot ivk \mod r_{\mathbb{P}}$, an element of Pallas' scalar field
83+
- $C \gets H(g_d || pk_d || u || m) \mod r_{\mathbb{P}}$, an element of Pallas' scalar field, and where $H$ is a secure hash function (e.g. SHA256 or Blake2)
84+
- $s \gets r + C \cdot \mathsf{ivk} \mod r_{\mathbb{P}}$, an element of Pallas' scalar field
8585
- $\sigma_{approval} \gets (u, s)$
8686

8787
, and sends $\sigma_{approval}$ to the sender (off-chain).
@@ -118,7 +118,7 @@ The following steps are added to the Orchard Action statement:
118118
Instance:
119119

120120
- $\sigma_{approval}$
121-
- $OrchardActionDescription$
121+
- $\mathtt{OrchardActionDescription}$
122122

123123
Witness:
124124

@@ -127,7 +127,7 @@ Witness:
127127

128128
Circuit:
129129

130-
- $C’ \gets H(g_d, pk_d, \sigma_{approval}.u, H(OrchardActionDescription))$
130+
- $C’ \gets H(g_d || pk_d || \sigma_{approval}.u || H(\mathtt{OrchardActionDescription}))$
131131
- $LHS \gets [\sigma_{approval}.s]g_d$
132132
- $RHS \gets \sigma_{approval}.u + [C']pk_d$
133133
- $LHS - RHS = 0$
@@ -144,7 +144,7 @@ Indeed, both $g_d$ and $pk_d$ of the recipient are needed by the Zcash validator
144144

145145
In this case, the Zcash miners could verify the recipient's approval by doing (for each Action in the transaction):
146146

147-
1. $C’ \gets H(g_d, pk_d, \sigma_{approval}.u, H(OrchardActionDescription))$
147+
1. $C’ \gets H(g_d, pk_d, \sigma_{approval}.u, H(\mathtt{OrchardActionDescription}))$
148148
2. $LHS \gets [\sigma_{approval}.sigma]g_d$
149149
3. $RHS \gets \sigma_{approval}.u + [C']pk_d$
150150
4. $LHS \stackrel{?}{=} RHS$. If not, reject transaction.
@@ -189,7 +189,7 @@ By empowering recipients to approve (or not) incoming transactions, we also give
189189
This could be done maliciously to, for instance:
190190

191191
1. Block a payment and deny to have received the "approval request", then accuse the sender to have failed to settle a contractual obligation.
192-
2. Gain information: By receiving the $OrchardActionDescription$ to approve, recipients gets to see the $nullifier$ of the input note of the Orchard Action before the rest of the network.
192+
2. Gain information: By receiving the $\mathtt{OrchardActionDescription}$ to approve, recipients gets to see the $nullifier$ of the input note of the Orchard Action before the rest of the network.
193193

194194
References
195195
==========

0 commit comments

Comments
 (0)