Skip to content

Commit

Permalink
Merge pull request #940 from daira/always-scan-diversifier-index-0
Browse files Browse the repository at this point in the history
Clarify that there may always be funds associated with the P2PKH address at diversifier index 0
  • Loading branch information
daira authored Nov 9, 2024
2 parents c28dbc9 + d905d3a commit c7022a3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rendered/zip-0316.html
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,9 @@
inclusive.</li>
<li>There are no additional constraints on an Orchard diversifier index.</li>
</ul>
<p>Note: A diversifier index of 0 may not generate a valid Sapling diversifier (with probability
<span class="math">\(1/2\)</span>
). Some wallets (either prior to the deployment of ZIP 316, in violation of the above requirement, or because they do not include a Sapling component in their UAs) always generate a Transparent P2PKH address at diversifier index 0. Therefore, <em>all</em> Zcash wallets, whether or not they support Unified Addresses, MUST assume that there may be transparent funds associated with diversifier index 0 for each ZIP 32 account, even in cases where the wallet implementation would not generate a Unified Address with that index for a given account. This is necessary to ensure reliable recovery of funds if key material is imported between wallets.</p>
<p>The following derivations are applied to each component IVK using the diversifier index:</p>
<ul>
<li>For a Sapling IVK, the corresponding Sapling Receiver is obtained as specified in <a id="footnote-reference-36" class="footnote_reference" href="#protocol-saplingkeycomponents">4</a>.</li>
Expand Down
12 changes: 12 additions & 0 deletions zips/zip-0316.rst
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,18 @@ UIVK. That is,

* There are no additional constraints on an Orchard diversifier index.

Note: A diversifier index of 0 may not generate a valid Sapling
diversifier (with probability :math:`1/2`). Some wallets (either prior
to the deployment of ZIP 316, in violation of the above requirement,
or because they do not include a Sapling component in their UAs) always
generate a Transparent P2PKH address at diversifier index 0. Therefore,
*all* Zcash wallets, whether or not they support Unified Addresses,
MUST assume that there may be transparent funds associated with
diversifier index 0 for each ZIP 32 account, even in cases where the
wallet implementation would not generate a Unified Address with that
index for a given account. This is necessary to ensure reliable recovery
of funds if key material is imported between wallets.

The following derivations are applied to each component IVK using the
diversifier index:

Expand Down

0 comments on commit c7022a3

Please sign in to comment.