From f2d0882887ae4c8a83b26b8958fd93badaa8f65d Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Tue, 9 Sep 2025 17:33:41 +0530 Subject: [PATCH 1/8] correcting size of IssueNote in transaction format --- zips/zip-0230.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zips/zip-0230.rst b/zips/zip-0230.rst index 074c0340d..ca0edd29a 100644 --- a/zips/zip-0230.rst +++ b/zips/zip-0230.rst @@ -436,7 +436,7 @@ An issuance action, ``IssueAction``, is the instance of issuing a specific Custo +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ | varies |``nNotes`` |``compactSize`` |The number of notes in the Issuance Action. | +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ -| 147 × ``nNotes`` |``vNotes`` |``IssueNote[nNotes]`` |A sequence of note descriptions within the Issuance Action. | +| 115 × ``nNotes`` |``vNotes`` |``IssueNote[nNotes]`` |A sequence of note descriptions within the Issuance Action. | +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ | 1 |``flagsIssuance`` |``byte`` |An 8-bit value representing a set of flags. Ordered from LSB to MSB: | | | | | | From dee88fd0fc750f51899bf3c4361434e2c964062c Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Tue, 9 Sep 2025 17:45:32 +0530 Subject: [PATCH 2/8] updates to consensus rules to generate asset base for every issue note --- zips/zip-0227.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zips/zip-0227.rst b/zips/zip-0227.rst index 859edacb5..4b0999999 100644 --- a/zips/zip-0227.rst +++ b/zips/zip-0227.rst @@ -471,8 +471,7 @@ If the transaction contains an issuance bundle: - The issuance authorization signature, $\mathsf{issueAuthSig}$, MUST be a valid $\mathsf{IssueAuthSig}$ signature over $\mathsf{SigHash}$, i.e. $\mathsf{IssueAuthSig}.\!\mathsf{Validate}(\mathsf{ik}, \mathsf{SigHash}, \mathsf{issueAuthSig}) = 1$. - For every issuance action description ($\mathsf{IssueAction}_\mathsf{i},\ 1 \leq i \leq \mathtt{nIssueActions}$) in the issuance bundle: - - Every Issue Note in ``IssueAction`` MUST be a valid encoding of the $\mathsf{Note^{Issue}}$ type, and MUST encode the same $\mathsf{AssetBase}$. - - This $\mathsf{AssetBase}$ MUST satisfy the derivation from the issuer identifier and asset description described in the `Specification: Asset Identifier, Asset Digest, and Asset Base`_ section. + - An Issue Note of the $\mathsf{Note^{Issue}}$ type MUST be created for each ``IssueNote`` in the ``vNotes`` field of the ``IssueAction``, where the $\mathsf{AssetBase}$ MUST be computed from the ``assetDescHash`` field of the ``IssueAction`` and the ``issuer`` field of the issuance bundle, as described in the `Specification: Asset Identifier, Asset Digest, and Asset Base`_ section. - It MUST be the case that $\mathsf{issued\_assets}_{\mathsf{OUT}}(\mathsf{AssetBase}).\mathsf{final} \neq 1$. - If $\mathsf{issued\_assets}_{\mathsf{OUT}}(\mathsf{AssetBase}).\mathsf{note_{ref}} = \bot$, then let $\mathsf{new\_note_{ref}}$ be the first Issue Note in the Issuance Action. @@ -480,7 +479,7 @@ If the transaction contains an issuance bundle: - The value of $\mathsf{new\_note_{ref}}$ MUST be $0$. - The node MUST update $\mathsf{issued\_assets}_{\mathsf{OUT}}(\mathsf{AssetBase}).\mathsf{note_{ref}} = \mathsf{new\_note_{ref}}$. - - For every issue note description, $\mathsf{note}_j$ for $1 \leq j \leq \mathtt{nNotes}$ in ``IssueAction``: + - For every Issue Note, $\mathsf{note}_j$ for $1 \leq j \leq \mathtt{nNotes}$ in ``IssueAction``: - The $\text{ρ}$ field of the issue note MUST have been computed as described in the `Computation of ρ`_ section. - It MUST be the case that $\mathsf{issued\_assets}_{\mathsf{OUT}}.\mathsf{balance} + \mathsf{v}_j \leq \mathsf{MAX\_ISSUE}$, where $\mathsf{v}_j$ is the value of $\mathsf{note}_j$. The node then MUST update $\mathsf{issued\_assets}_{\mathsf{OUT}}.\mathsf{balance} = \mathsf{issued\_assets}_{\mathsf{OUT}}.\mathsf{balance} + \mathsf{v}_j$. From 6f9fe54e68c885e34e9fbe841043dba783732a33 Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Tue, 9 Sep 2025 17:54:58 +0530 Subject: [PATCH 3/8] rearranging issuance bundle to allow for serial parsing of the fields --- zips/zip-0230.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zips/zip-0230.rst b/zips/zip-0230.rst index ca0edd29a..c5d95a072 100644 --- a/zips/zip-0230.rst +++ b/zips/zip-0230.rst @@ -155,14 +155,14 @@ Transaction Format +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ | **ZSA Issuance Bundle Fields** | +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ -| varies |``nIssueActions`` |``compactSize`` |The number of issuance actions in the bundle. | -+-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ -| varies |``vIssueActions`` |``IssueAction[nIssueActions]`` |A sequence of issuance action descriptions. | -+-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ | varies |``issuerLength`` |``compactSize`` |The length of the issuer identifier. | +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ | varies |``issuer`` |``byte[issuerLength]`` |The issuer identifier as defined in [#zip-0227-issuer-identifier]_. | +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ +| varies |``nIssueActions`` |``compactSize`` |The number of issuance actions in the bundle. | ++-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ +| varies |``vIssueActions`` |``IssueAction[nIssueActions]`` |A sequence of issuance action descriptions. | ++-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ | varies |``issueAuthSig`` |``IssueAuthSignature`` |The signature of the transaction SIGHASH, signed by the issuer, | | | | |validated as in Issuance Authorization Signature Scheme | | | | |[#zip-0227-issuance-auth-sig]_. | From 42d8c9fd05cb704fcb98989cd24acf2129acb4bf Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Tue, 9 Sep 2025 17:55:30 +0530 Subject: [PATCH 4/8] making changes to the digests to have it match the transaction format order --- zips/zip-0246.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zips/zip-0246.rst b/zips/zip-0246.rst index 9312908dc..154c5fdc4 100644 --- a/zips/zip-0246.rst +++ b/zips/zip-0246.rst @@ -359,8 +359,8 @@ T.5: issuance_digest ```````````````````` A BLAKE2b-256 hash of the following values :: - T.5a: issue_actions_digest (32-byte hash output) - T.5b: issuerIdentifier (field encoding bytes) + T.5a: issuerIdentifier (field encoding bytes) + T.5b: issue_actions_digest (32-byte hash output) The personalization field of this hash is set to:: @@ -376,8 +376,8 @@ T.5a: issue_actions_digest '''''''''''''''''''''''''' A BLAKE2b-256 hash of Issue Action information for all Issuance Actions belonging to the transaction. For each Action, the following elements are included in the hash:: - T.5a.i : notes_digest (32-byte hash output) - T.5a.ii : assetDescHash (field encoding bytes) + T.5a.i : assetDescHash (field encoding bytes) + T.5a.ii : notes_digest (32-byte hash output) T.5a.iii: flagsIssuance (1 byte) The personalization field of this hash is set to:: From 44fc26e62f58ea584d7999b00ea846ce1f3b559b Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Wed, 10 Sep 2025 03:41:04 +0530 Subject: [PATCH 5/8] Apply suggestions from ZIP review Co-authored-by: Jack Grigg --- zips/zip-0246.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zips/zip-0246.rst b/zips/zip-0246.rst index 154c5fdc4..a7f32a626 100644 --- a/zips/zip-0246.rst +++ b/zips/zip-0246.rst @@ -359,8 +359,9 @@ T.5: issuance_digest ```````````````````` A BLAKE2b-256 hash of the following values :: - T.5a: issuerIdentifier (field encoding bytes) - T.5b: issue_actions_digest (32-byte hash output) + T.5a: issuerLength (field encoding bytes) + T.5b: issuer (field encoding bytes) + T.5c: issue_actions_digest (32-byte hash output) The personalization field of this hash is set to:: @@ -377,7 +378,7 @@ T.5a: issue_actions_digest A BLAKE2b-256 hash of Issue Action information for all Issuance Actions belonging to the transaction. For each Action, the following elements are included in the hash:: T.5a.i : assetDescHash (field encoding bytes) - T.5a.ii : notes_digest (32-byte hash output) + T.5a.ii : issue_notes_digest (32-byte hash output) T.5a.iii: flagsIssuance (1 byte) The personalization field of this hash is set to:: From f70cbc2d187865f440356e1150e3d2a8b1d694a7 Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Wed, 10 Sep 2025 03:51:16 +0530 Subject: [PATCH 6/8] rename IssueNote to IssueNoteDescription for clarity --- zips/zip-0227.rst | 6 +++--- zips/zip-0230.rst | 10 +++++----- zips/zip-0246.rst | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/zips/zip-0227.rst b/zips/zip-0227.rst index 4b0999999..9a502e899 100644 --- a/zips/zip-0227.rst +++ b/zips/zip-0227.rst @@ -315,7 +315,7 @@ An Issue Note is a tuple $(\mathsf{d}, \mathsf{pk_d}, \mathsf{v}, \mathsf{AssetB - $\text{ρ}: \mathbb{F}_{q_{\mathbb{P}}}$ is used to derive the nullifier of the note, and is computed as in `Computation of ρ`_. - $\mathsf{rseed}: \mathbb{B}^{[\mathbb{Y}^{32}]}$ MUST be sampled uniformly at random by the issuer. -ZIP 230 [#zip-0230-issue-note]_ defines, in ``IssueNote``, field encodings which together with +ZIP 230 [#zip-0230-issue-note]_ defines, in ``IssueNoteDescription``, field encodings which together with $\mathsf{issuer}$ from the parent `Issuance Bundle`_ and $\mathsf{AssetDescHash}$ from the parent `Issuance Action`_, specify an Issue Note. @@ -471,7 +471,7 @@ If the transaction contains an issuance bundle: - The issuance authorization signature, $\mathsf{issueAuthSig}$, MUST be a valid $\mathsf{IssueAuthSig}$ signature over $\mathsf{SigHash}$, i.e. $\mathsf{IssueAuthSig}.\!\mathsf{Validate}(\mathsf{ik}, \mathsf{SigHash}, \mathsf{issueAuthSig}) = 1$. - For every issuance action description ($\mathsf{IssueAction}_\mathsf{i},\ 1 \leq i \leq \mathtt{nIssueActions}$) in the issuance bundle: - - An Issue Note of the $\mathsf{Note^{Issue}}$ type MUST be created for each ``IssueNote`` in the ``vNotes`` field of the ``IssueAction``, where the $\mathsf{AssetBase}$ MUST be computed from the ``assetDescHash`` field of the ``IssueAction`` and the ``issuer`` field of the issuance bundle, as described in the `Specification: Asset Identifier, Asset Digest, and Asset Base`_ section. + - An Issue Note of the $\mathsf{Note^{Issue}}$ type MUST be created for each ``IssueNoteDescription`` in the ``vNotes`` field of the ``IssueAction``, where the $\mathsf{AssetBase}$ MUST be computed from the ``assetDescHash`` field of the ``IssueAction`` and the ``issuer`` field of the issuance bundle, as described in the `Specification: Asset Identifier, Asset Digest, and Asset Base`_ section. - It MUST be the case that $\mathsf{issued\_assets}_{\mathsf{OUT}}(\mathsf{AssetBase}).\mathsf{final} \neq 1$. - If $\mathsf{issued\_assets}_{\mathsf{OUT}}(\mathsf{AssetBase}).\mathsf{note_{ref}} = \bot$, then let $\mathsf{new\_note_{ref}}$ be the first Issue Note in the Issuance Action. @@ -676,7 +676,7 @@ References .. [#zip-0226-txiddigest] `ZIP 226: Transfer and Burn of Zcash Shielded Assets - TxId Digest `_ .. [#zip-0226-authcommitment] `ZIP 226: Transfer and Burn of Zcash Shielded Assets - Authorizing Data Commitment `_ .. [#zip-0230-issuance-action-description] `ZIP 230: Version 6 Transaction Format: Issuance Action Description (IssueAction) `_ -.. [#zip-0230-issue-note] `ZIP 230: Version 6 Transaction Format: Issue Note (IssueNote) `_ +.. [#zip-0230-issue-note] `ZIP 230: Version 6 Transaction Format: Issue Note Description (IssueNoteDescription) `_ .. [#zip-0230-transaction-format] `ZIP 230: Version 6 Transaction Format: Transaction Format `_ .. [#zip-0244] `ZIP 244: Transaction Identifier Non-Malleability `_ .. [#zip-0246] `ZIP 246: Digests for the Version 6 Transaction Format `_ diff --git a/zips/zip-0230.rst b/zips/zip-0230.rst index c5d95a072..709a3e429 100644 --- a/zips/zip-0230.rst +++ b/zips/zip-0230.rst @@ -436,7 +436,7 @@ An issuance action, ``IssueAction``, is the instance of issuing a specific Custo +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ | varies |``nNotes`` |``compactSize`` |The number of notes in the Issuance Action. | +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ -| 115 × ``nNotes`` |``vNotes`` |``IssueNote[nNotes]`` |A sequence of note descriptions within the Issuance Action. | +| 115 × ``nNotes`` |``vNotes`` |``IssueNoteDescription[nNotes]`` |A sequence of issue note descriptions within the Issuance Action. | +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ | 1 |``flagsIssuance`` |``byte`` |An 8-bit value representing a set of flags. Ordered from LSB to MSB: | | | | | | @@ -444,14 +444,14 @@ An issuance action, ``IssueAction``, is the instance of issuing a specific Custo | | | |* The remaining bits are set to :math:`0\!`. | +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ -The encoding of ``IssueNote`` is described below. +The encoding of ``IssueNoteDescription`` is described below. Note that we allow the number of notes (represented by ``nNotes``) 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. -Issue Note Description (``IssueNote``) --------------------------------------- +Issue Note Description (``IssueNoteDescription``) +------------------------------------------------- -An issuance note, ``IssueNote`` contains the following fields: +An issuance note description, ``IssueNoteDescription`` contains the following fields: +-----------------------------+------------------------------+------------------------------------------------+---------------------------------------------------------------------+ | Bytes | Name | Data Type | Description | diff --git a/zips/zip-0246.rst b/zips/zip-0246.rst index a7f32a626..d3c9b2457 100644 --- a/zips/zip-0246.rst +++ b/zips/zip-0246.rst @@ -389,7 +389,7 @@ The field encodings are specified in ZIP 230 [#zip-0230-issue-actions-field-enco T.5a.i: issue_notes_digest .......................... -A BLAKE2b-256 hash of Note information for all Notes belonging to the Issuance Action. For each Note, the following elements are included in the hash:: +A BLAKE2b-256 hash of Note information for all Issue Note Descriptions belonging to the Issuance Action. For each Note, the following elements are included in the hash:: T.5a.i.1: recipient (field encoding bytes) T.5a.i.2: value (field encoding bytes) From bd5f08748cb55e49238f58945bb76c9acc672f8a Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Wed, 10 Sep 2025 04:02:28 +0530 Subject: [PATCH 7/8] updating consensus rules --- zips/zip-0227.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zips/zip-0227.rst b/zips/zip-0227.rst index 9a502e899..8d2dcb334 100644 --- a/zips/zip-0227.rst +++ b/zips/zip-0227.rst @@ -471,7 +471,8 @@ If the transaction contains an issuance bundle: - The issuance authorization signature, $\mathsf{issueAuthSig}$, MUST be a valid $\mathsf{IssueAuthSig}$ signature over $\mathsf{SigHash}$, i.e. $\mathsf{IssueAuthSig}.\!\mathsf{Validate}(\mathsf{ik}, \mathsf{SigHash}, \mathsf{issueAuthSig}) = 1$. - For every issuance action description ($\mathsf{IssueAction}_\mathsf{i},\ 1 \leq i \leq \mathtt{nIssueActions}$) in the issuance bundle: - - An Issue Note of the $\mathsf{Note^{Issue}}$ type MUST be created for each ``IssueNoteDescription`` in the ``vNotes`` field of the ``IssueAction``, where the $\mathsf{AssetBase}$ MUST be computed from the ``assetDescHash`` field of the ``IssueAction`` and the ``issuer`` field of the issuance bundle, as described in the `Specification: Asset Identifier, Asset Digest, and Asset Base`_ section. + - Every ``IssueNoteDescription`` in the ``IssueAction`` MUST be a valid field encoding as defined in ZIP 230 [#zip-0230-issue-note]_. + - Let an Issue Note (with type $\mathsf{Note^{Issue}}$) be constructed from the fields of each ``IssueNoteDescription``, with the $\mathsf{AssetBase}$ derived from the ``assetDescHash`` field of the ``IssueAction`` and the ``issuer`` field of the issuance bundle, as described in the `Specification: Asset Identifier, Asset Digest, and Asset Base`_ section. - It MUST be the case that $\mathsf{issued\_assets}_{\mathsf{OUT}}(\mathsf{AssetBase}).\mathsf{final} \neq 1$. - If $\mathsf{issued\_assets}_{\mathsf{OUT}}(\mathsf{AssetBase}).\mathsf{note_{ref}} = \bot$, then let $\mathsf{new\_note_{ref}}$ be the first Issue Note in the Issuance Action. From 9b7cdb79282caa7e291c66d3eedc98a709e4dc80 Mon Sep 17 00:00:00 2001 From: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Date: Wed, 10 Sep 2025 04:09:22 +0530 Subject: [PATCH 8/8] fixing render issues --- zips/zip-0230.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/zips/zip-0230.rst b/zips/zip-0230.rst index 709a3e429..60320041a 100644 --- a/zips/zip-0230.rst +++ b/zips/zip-0230.rst @@ -502,6 +502,7 @@ References .. [#zip-0226] `ZIP 226: Transfer and Burn of Zcash Shielded Assets `_ .. [#zip-0227] `ZIP 227: Issuance of Zcash Shielded Assets `_ .. [#zip-0227-issuance-auth-sig] `ZIP 227: Issuance of Zcash Shielded Assets — Issuance Authorization Signature Scheme `_ +.. [#zip-0227-issuer-identifier] `ZIP 227: Issuance of Zcash Shielded Assets — Issuer Identifier `_ .. [#zip-0228] `ZIP 228: Asset Swaps for Zcash Shielded Assets `_ .. [#zip-0244] `ZIP 244: Transaction Identifier Non-Malleability `_ .. [#zip-0246-sighash-info] `ZIP 246: Digests for the Version 6 Transaction Format `_