Skip to content

Commit

Permalink
Renaming idk to imk throughout ZIP 227 (#41)
Browse files Browse the repository at this point in the history
This is a consistent renaming of the issuance derivation key to call it the issuance master key.
  • Loading branch information
vivek-arte authored Oct 3, 2023
1 parent 8c88358 commit ef406db
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
30 changes: 15 additions & 15 deletions zip-0227.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
<section id="specification-issuance-keys-and-issuance-authorization-signature-scheme"><h2><span class="section-heading">Specification: Issuance Keys and Issuance Authorization Signature Scheme</span><span class="section-anchor"> <a rel="bookmark" href="#specification-issuance-keys-and-issuance-authorization-signature-scheme"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h2>
<p>The ZSA Protocol adds the following three keys to the key components <a id="footnote-reference-9" class="footnote_reference" href="#protocol-addressesandkeys">17</a>:</p>
<ol type="1">
<li>The issuance derivation key, denoted as
<span class="math">\(\mathsf{idk}\)</span>
, as the name suggests, is the key that is used to derive the other two keys.</li>
<li>The issuance master key, denoted as
<span class="math">\(\mathsf{imk}\)</span>
, is the key that is used to derive the other two keys.</li>
<li>The issuance authorizing key is the key that is used to sign the issuance transaction, and is denoted as
<span class="math">\(\mathsf{isk}\)</span>
. This key is used to authorize the issuance of a specific Asset Identifier, and is only used by the issuer.</li>
Expand Down Expand Up @@ -106,20 +106,20 @@
is defined as in the Zcash protocol specification <a id="footnote-reference-11" class="footnote_reference" href="#protocol-concretegrouphashpallasandvesta">18</a>.</p>
</section>
<section id="issuance-key-derivation"><h3><span class="section-heading">Issuance Key Derivation</span><span class="section-anchor"> <a rel="bookmark" href="#issuance-key-derivation"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h3>
<p>The issuance derivation key is generated by choosing a bit sequence uniformly at random from
<p>The issuance master key is generated by choosing a bit sequence uniformly at random from
<span class="math">\(\mathbb{B}^{\mathbb{Y}[32]}\)</span>
, like the Orchard spending key <a id="footnote-reference-12" class="footnote_reference" href="#protocol-orchardkeycomponents">20</a>.</p>
<section id="issuance-derivation-key-generation-for-hierarchical-deterministic-wallets"><h4><span class="section-heading">Issuance derivation key generation for hierarchical deterministic wallets</span><span class="section-anchor"> <a rel="bookmark" href="#issuance-derivation-key-generation-for-hierarchical-deterministic-wallets"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h4>
<p>The issuance derivation key is generated using the Orchard master key derivation procedure defined in ZIP 32 <a id="footnote-reference-13" class="footnote_reference" href="#zip-0032-orchard-master">12</a>. We reuse the functions defined there in what follows in this section.</p>
<section id="issuance-master-key-generation-for-hierarchical-deterministic-wallets"><h4><span class="section-heading">Issuance master key generation for hierarchical deterministic wallets</span><span class="section-anchor"> <a rel="bookmark" href="#issuance-master-key-generation-for-hierarchical-deterministic-wallets"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h4>
<p>The issuance master key is generated using the Orchard master key derivation procedure defined in ZIP 32 <a id="footnote-reference-13" class="footnote_reference" href="#zip-0032-orchard-master">12</a>. We reuse the functions defined there in what follows in this section.</p>
<p>Let
<span class="math">\(S\)</span>
be a seed byte sequence of a chosen length, which MUST be at least 32 and at most 252 bytes. We define the master extended issuance key
<span class="math">\(m_{\mathsf{Issuance}} := \mathsf{MasterKeyGen}(\texttt{"ZIP32ZSAIssue_V1"}, S)\)</span>
.</p>
<p>As in ZIP 32 for Orchard <a id="footnote-reference-14" class="footnote_reference" href="#zip-0032-orchard-child-key-derivation">13</a>, we only use hardened child key derivation for the issuance derivation key. We reuse the
<p>As in ZIP 32 for Orchard <a id="footnote-reference-14" class="footnote_reference" href="#zip-0032-orchard-child-key-derivation">13</a>, we only use hardened child key derivation for the issuance master key. We reuse the
<span class="math">\(\mathsf{CDKsk}\)</span>
function for Orchard child key derivation from ZIP 32.</p>
<p>We use the notation of ZIP 32 <a id="footnote-reference-15" class="footnote_reference" href="#zip-0032-orchard-key-path">15</a> for shielded HD paths, and define the issuance derivation key path as
<p>We use the notation of ZIP 32 <a id="footnote-reference-15" class="footnote_reference" href="#zip-0032-orchard-key-path">15</a> for shielded HD paths, and define the issuance master key path as
<span class="math">\(m_\mathsf{Issuance} / purpose' / coin\_type' / account'\)</span>
. We fix the path levels as follows:</p>
<ul>
Expand Down Expand Up @@ -147,20 +147,20 @@
</ul>
<p>From the generated
<span class="math">\((\mathsf{sk}, \mathsf{c})\)</span>
, we set the issuance derivation key to be
<span class="math">\(\mathsf{idk} := \mathsf{sk}\)</span>
, we set the issuance master key to be
<span class="math">\(\mathsf{imk} := \mathsf{sk}\)</span>
.</p>
</section>
<section id="derivation-of-issuance-authorizing-key-and-issuance-validating-key"><h4><span class="section-heading">Derivation of issuance authorizing key and issuance validating key</span><span class="section-anchor"> <a rel="bookmark" href="#derivation-of-issuance-authorizing-key-and-issuance-validating-key"><img width="24" height="24" class="section-anchor" src="assets/images/section-anchor.png" alt=""></a></span></h4>
<p>The issuance authorizing key and issuance validating key are derived from the issuance derivation key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key <a id="footnote-reference-17" class="footnote_reference" href="#protocol-orchardkeycomponents">20</a>, as described below.</p>
<p>The issuance authorizing key and issuance validating key are derived from the issuance master key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key <a id="footnote-reference-17" class="footnote_reference" href="#protocol-orchardkeycomponents">20</a>, as described below.</p>
<ul>
<li>The issuance authorizing key is derived from the issuance derivation key,
<span class="math">\(\mathsf{idk}\)</span>
<li>The issuance authorizing key is derived from the issuance master key,
<span class="math">\(\mathsf{imk}\)</span>
, as a private signature key. The function
<span class="math">\(\mathsf{PRF^{expand}_{idk}}\)</span>
<span class="math">\(\mathsf{PRF^{expand}_{imk}}\)</span>
is as defined in the Zcash protocol specification <a id="footnote-reference-18" class="footnote_reference" href="#protocol-abstractprfs">19</a>:</li>
</ul>
<div class="math">\(\mathsf{isk} := \mathsf{ToScalar}^{\mathsf{Orchard}}(︀ \mathsf{PRF^{expand}_{idk}}([\mathtt{0x0a}]) )\)</div>
<div class="math">\(\mathsf{isk} := \mathsf{ToScalar}^{\mathsf{Orchard}}(︀ \mathsf{PRF^{expand}_{imk}}([\mathtt{0x0a}]) )\)</div>
<ul>
<li>The issuance validating key is derived from the issuance authorizing key,
<span class="math">\(\mathsf{isk}\)</span>
Expand Down
22 changes: 11 additions & 11 deletions zip-0227.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Specification: Issuance Keys and Issuance Authorization Signature Scheme

The ZSA Protocol adds the following three keys to the key components [#protocol-addressesandkeys]_:

1. The issuance derivation key, denoted as :math:`\mathsf{idk}`, as the name suggests, is the key that is used to derive the other two keys.
1. The issuance master key, denoted as :math:`\mathsf{imk}`, is the key that is used to derive the other two keys.

2. The issuance authorizing key is the key that is used to sign the issuance transaction, and is denoted as :math:`\mathsf{isk}`. This key is used to authorize the issuance of a specific Asset Identifier, and is only used by the issuer.

Expand All @@ -107,35 +107,35 @@ Specifically, we instantiate :math:`\mathsf{IssueAuthSig}` as :math:`\mathsf{Red
Issuance Key Derivation
-----------------------

The issuance derivation key is generated by choosing a bit sequence uniformly at random from :math:`\mathbb{B}^{\mathbb{Y}[32]}`, like the Orchard spending key [#protocol-orchardkeycomponents]_.
The issuance master key is generated by choosing a bit sequence uniformly at random from :math:`\mathbb{B}^{\mathbb{Y}[32]}`, like the Orchard spending key [#protocol-orchardkeycomponents]_.

Issuance derivation key generation for hierarchical deterministic wallets
`````````````````````````````````````````````````````````````````````````
Issuance master key generation for hierarchical deterministic wallets
`````````````````````````````````````````````````````````````````````

The issuance derivation key is generated using the Orchard master key derivation procedure defined in ZIP 32 [#zip-0032-orchard-master]_. We reuse the functions defined there in what follows in this section.
The issuance master key is generated using the Orchard master key derivation procedure defined in ZIP 32 [#zip-0032-orchard-master]_. We reuse the functions defined there in what follows in this section.

Let :math:`S` be a seed byte sequence of a chosen length, which MUST be at least 32 and at most 252 bytes.
We define the master extended issuance key :math:`m_{\mathsf{Issuance}} := \mathsf{MasterKeyGen}(\texttt{"ZIP32ZSAIssue_V1"}, S)`.

As in ZIP 32 for Orchard [#zip-0032-orchard-child-key-derivation]_, we only use hardened child key derivation for the issuance derivation key.
As in ZIP 32 for Orchard [#zip-0032-orchard-child-key-derivation]_, we only use hardened child key derivation for the issuance master key.
We reuse the :math:`\mathsf{CDKsk}` function for Orchard child key derivation from ZIP 32.

We use the notation of ZIP 32 [#zip-0032-orchard-key-path]_ for shielded HD paths, and define the issuance derivation key path as :math:`m_\mathsf{Issuance} / purpose' / coin\_type' / account'`. We fix the path levels as follows:
We use the notation of ZIP 32 [#zip-0032-orchard-key-path]_ for shielded HD paths, and define the issuance master key path as :math:`m_\mathsf{Issuance} / purpose' / coin\_type' / account'`. We fix the path levels as follows:

- :math:`purpose`: a constant set to :math:`227` (i.e. :math:`\texttt{0xe3}`). :math:`purpose'` is thus :math:`227'` (or :math:`\texttt{0x800000e3}`) following the BIP 43 recommendation.
- :math:`coin\_type`: Defined as in ZIP 32 [#zip-0032-key-path-levels]_.
- :math:`account`: fixed to index :math:`0`.

From the generated :math:`(\mathsf{sk}, \mathsf{c})`, we set the issuance derivation key to be :math:`\mathsf{idk} := \mathsf{sk}`.
From the generated :math:`(\mathsf{sk}, \mathsf{c})`, we set the issuance master key to be :math:`\mathsf{imk} := \mathsf{sk}`.

Derivation of issuance authorizing key and issuance validating key
``````````````````````````````````````````````````````````````````

The issuance authorizing key and issuance validating key are derived from the issuance derivation key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key [#protocol-orchardkeycomponents]_, as described below.
The issuance authorizing key and issuance validating key are derived from the issuance master key in an analogous manner to the derivation of the Orchard spend authorizing key and Orchard spend validating key from the Orchard spending key [#protocol-orchardkeycomponents]_, as described below.

- The issuance authorizing key is derived from the issuance derivation key, :math:`\mathsf{idk}`, as a private signature key. The function :math:`\mathsf{PRF^{expand}_{idk}}` is as defined in the Zcash protocol specification [#protocol-abstractprfs]_:
- The issuance authorizing key is derived from the issuance master key, :math:`\mathsf{imk}`, as a private signature key. The function :math:`\mathsf{PRF^{expand}_{imk}}` is as defined in the Zcash protocol specification [#protocol-abstractprfs]_:

.. math:: \mathsf{isk} := \mathsf{ToScalar}^{\mathsf{Orchard}}(︀ \mathsf{PRF^{expand}_{idk}}([\mathtt{0x0a}]) )
.. math:: \mathsf{isk} := \mathsf{ToScalar}^{\mathsf{Orchard}}(︀ \mathsf{PRF^{expand}_{imk}}([\mathtt{0x0a}]) )

- The issuance validating key is derived from the issuance authorizing key, :math:`\mathsf{isk}`, as a public verification key:

Expand Down

0 comments on commit ef406db

Please sign in to comment.