From 636f441b93f950496daa337443c217c75ae9b9f9 Mon Sep 17 00:00:00 2001
From: Vivek Arte The transaction format for v6 transactions is described in ZIP 230 14. The transaction format for v6 transactions is described in ZIP 230 13. The transaction digest algorithm defined in ZIP 244 15 is modified by the OrchardZSA protocol to add a new branch for issuance information, along with modifications within the The transaction digest algorithm defined in ZIP 244 14 is modified by the OrchardZSA protocol to add a new branch for issuance information, along with replacement of the A BLAKE2b-256 hash of the following values: The personalization field remains the same as in ZIP 244 15. The personalization field remains the same as in ZIP 244 14. When OrchardZSA Actions Groups are present in the transaction, this digest is a BLAKE2b-256 hash of the following values: The personalization field of this hash is the same as in ZIP 244 15 The personalization field of this hash is the same as for In the case that the transaction has no OrchardZSA Action Groups, In the case that the transaction has no OrchardZSA Action Groups, A BLAKE2b-256 hash of the subset of OrchardZSA Action Groups information for all OrchardZSA Action Groups belonging to the transaction. For each Action Group, the following elements are included in the hash: The personalization field of this hash is set to: A BLAKE2b-256 hash of the subset of OrchardZSA Action information intended to be included in an updated version of the ZIP-307 17 The personalization field of this hash is the same as in ZIP 244: The personalization field of this hash is the same as for A BLAKE2b-256 hash of the subset of Orchard shielded memo field data for all OrchardZSA Actions belonging to the Action Group. For each Action, the following elements are included in the hash: The personalization field of this hash remains identical to ZIP 244: The personalization field of this hash is identical to that for A BLAKE2b-256 hash of the remaining subset of OrchardZSA Action information not intended for inclusion in an updated version of the the ZIP 307 17 The personalization field of this hash is defined identically to ZIP 244: The personalization field of this hash is defined just as for In case the transaction does not perform the burning of any Assets (i.e. the
\(\mathsf{assetBurn}\)
- set is empty), the ''orchard_zsa_burn_digest'' is:The
OrchardZSA Transaction Structure
- ![]()
TxId Digest
- ![]()
orchard_digest to account for the inclusion of the Asset Base. The details of these changes are described in this section, and highlighted using the [UPDATED FOR ZSA] or [ADDED FOR ZSA] text label. We omit the details of the sections that do not change for the OrchardZSA protocol.orchard_digest with a new orchard_zsa_digest to account for the inclusion of the Asset Base and the updated transaction format. The details of these changes are described in this section, and highlighted using the [UPDATED FOR ZSA] or [ADDED FOR ZSA] text label. We omit the details of the sections that do not change for the OrchardZSA protocol.txid_digest
![]()
T.1: header_digest (32-byte hash output)
T.2: transparent_digest (32-byte hash output)
T.3: sapling_digest (32-byte hash output)
-T.4: orchard_digest (32-byte hash output) [UPDATED FOR ZSA]
+T.4: orchard_zsa_digest (32-byte hash output) [ADDED FOR ZSA]
T.5: issuance_digest (32-byte hash output) [ADDED FOR ZSA]
- T.4: orchard_digest
+ ![]()
T.4: orchard_zsa_digest
![]()
T.4a: orchard_action_groups_digest (32-byte hash output) [ADDED FOR ZSA]
-T.4c: valueBalanceOrchard (64-bit signed little-endian)
- T.4a: orchard_zsa_action_groups_digest (32-byte hash output)
+T.4b: valueBalanceOrchard (64-bit signed little-endian)
+ orchard_digest in ZIP 244 14"ZTxIdOrchardHash"
- orchard_digest isorchard_zsa_digest isBLAKE2b-256("ZTxIdOrchardHash", [])
- T.4a: orchard_action_groups_digest
+ ![]()
T.4a: orchard_zsa_action_groups_digest
![]()
T.4a.i : orchard_actions_compact_digest (32-byte hash output)
-T.4a.ii : orchard_actions_memos_digest (32-byte hash output)
-T.4a.iii : orchard_actions_noncompact_digest (32-byte hash output)
+
T.4a.i : orchard_zsa_actions_compact_digest (32-byte hash output)
+T.4a.ii : orchard_zsa_actions_memos_digest (32-byte hash output)
+T.4a.iii : orchard_zsa_actions_noncompact_digest (32-byte hash output)
T.4a.iv : orchard_zsa_burn_digest (32-byte hash output)
-T.4a.v : flagsOrchard (1 byte)
-T.4a.vi : anchorOrchard (32 bytes)
-T.4a.vii : nAGExpiryHeight (4 bytes)
+T.4a.v : flagsOrchard (1 byte)
+T.4a.vi : anchorOrchard (32 bytes)
+T.4a.vii : nAGExpiryHeight (4 bytes)"ZTxIdOrcActGHash"
- T.4a.i: orchard_actions_compact_digest
+ ![]()
T.4a.i: orchard_zsa_actions_compact_digest
![]()
CompactBlock format for all OrchardZSA Actions belonging to the Action Group. For each Action, the following elements are included in the hash:T.4a.i.1 : nullifier (field encoding bytes)
T.4a.i.2 : cmx (field encoding bytes)
T.4a.i.3 : ephemeralKey (field encoding bytes)
-T.4a.i.4 : encCiphertext[..84] (First 84 bytes of field encoding) [UPDATED FOR ZSA]
- orchard_actions_compact_digest in ZIP 244:"ZTxIdOrcActCHash"
T.4a.ii: orchard_actions_memos_digest
+ ![]()
T.4a.ii: orchard_zsa_actions_memos_digest
![]()
T.4a.ii.1: encCiphertext[84..596] (contents of the encrypted memo field) [UPDATED FOR ZSA]
- T.4a.ii.1: encCiphertext[84..596] (contents of the encrypted memo field)
+ orchard_actions_memos_digest in ZIP 244:"ZTxIdOrcActMHash"
T.4a.iii: orchard_actions_noncompact_digest
+ ![]()
T.4a.iii: orchard_zsa_actions_noncompact_digest
![]()
CompactBlock format, for all OrchardZSA Actions belonging to the Action Group. For each Action, the following elements are included in the hash:T.4a.iii.1 : cv (field encoding bytes)
T.4a.iii.2 : rk (field encoding bytes)
-T.4a.iii.3 : encCiphertext[596..] (post-memo suffix of field encoding) [UPDATED FOR ZSA]
+T.4a.iii.3 : encCiphertext[596..] (post-memo suffix of field encoding)
T.4a.iii.4 : outCiphertext (field encoding bytes)
- orchard_actions_noncompact_digest in ZIP 244:"ZTxIdOrcActNHash"
T.4a.iv: orchard_zsa_burn_digest
@@ -524,7 +524,7 @@ ![]()
The
"ZTxIdOrcBurnHash"
orchard_zsa_burn_digest is:
BLAKE2b-256("ZTxIdOrcBurnHash", [])
@@ -535,10 +535,34 @@ The details of the changes to this algorithm are in ZIP 227 11.
+The per-input transaction digest algorithm to generate the signature digest in ZIP 244 15 is modified so that a signature digest is produced for each transparent input, each Sapling input, each OrchardZSA Action, and additionally for each Issuance Action. The modifications replace the orchard_digest in ZIP 244 with a new orchard_zsa_digest, and add a new branch, issuance_digest, for the Issuance Action information.
The overall structure of the hash is as follows. We highlight the changes for the OrchardZSA protocol via the [ADDED FOR ZSA] text label, and we omit the descriptions of the sections that do not change for the OrchardZSA protocol:
signature_digest +├── header_digest +├── transparent_sig_digest +├── sapling_digest +├── orchard_zsa_digest [ADDED FOR ZSA] +└── issuance_digest [ADDED FOR ZSA]+
A BLAKE2b-256 hash of the following values
+S.1: header_digest (32-byte hash output) +S.2: transparent_sig_digest (32-byte hash output) +S.3: sapling_digest (32-byte hash output) +S.4: orchard_zsa_digest (32-byte hash output) [ADDED FOR ZSA] +S.5: issuance_digest (32-byte hash output) [ADDED FOR ZSA]+
The personalization field remains the same as in ZIP 244 14, namely:
+"ZcashTxHash_" || CONSENSUS_BRANCH_ID+
ZcashTxHash_ has 1 underscore character.
Identical to that specified for the transaction identifier.
+Identical to the issuance_digest specified for the transaction identifier in ZIP 227 zip-0227-txiddigest.
The details of the computation of this value are in ZIP 227 12.
+The details of the computation of this value are in ZIP 227 11.
The fee mechanism for the upgrades proposed in this ZIP will follow the mechanism described in ZIP 317 for the OrchardZSA protocol upgrade, and are described in ZIP 227 13.
+The fee mechanism for the upgrades proposed in this ZIP will follow the mechanism described in ZIP 317 for the OrchardZSA protocol upgrade, and are described in ZIP 227 12.
In order to have backward compatibility with the ZEC notes, we have designed the circuit to support both ZEC and OrchardZSA notes. As we specify above, there are three main reasons we can do this:
@@ -696,43 +720,43 @@| 11 | -ZIP 227: Issuance of Zcash Shielded Assets: Signature Digest | +ZIP 227: Issuance of Zcash Shielded Assets: Authorizing Data Commitment |
|---|
| 12 | -ZIP 227: Issuance of Zcash Shielded Assets: Authorizing Data Commitment | +ZIP 227: Issuance of Zcash Shielded Assets: OrchardZSA Fee Calculation |
|---|
| 13 | -ZIP 227: Issuance of Zcash Shielded Assets: OrchardZSA Fee Calculation | +ZIP 230: Version 6 Transaction Format |
|---|
| 14 | -ZIP 230: Version 6 Transaction Format | +ZIP 244: Transaction Identifier Non-Malleability |
|---|
| 15 | -ZIP 244: Transaction Identifier Non-Malleability | +ZIP 244: Transaction Identifier Non-Malleability: Signature Digest |
|---|
The complete encoding of these fields into an IssueNote is defined in ZIP 230 16.
The complete encoding of these fields into an IssueNote is defined in ZIP 230 17.
Let \(\mathsf{Note^{Issue}}\) be the type of an Issue Note, i.e.
@@ -378,7 +378,7 @@The \(\mathsf{finalize}\) boolean is set by the Issuer to signal that there will be no further issuance of the specific Custom Asset. As we will see in Specification: Consensus Rule Changes, transactions that attempt to issue further amounts of a Custom Asset that has previously been finalized will be rejected.
-The complete encoding of these fields into an IssueAction is defined in ZIP 230 15.
The complete encoding of these fields into an IssueAction is defined in ZIP 230 16.
An issuance bundle is the aggregate of all the issuance-related information. Specifically, contains all the issuance actions and the issuer signature on the transaction SIGHASH that validates the issuance itself. It contains the following fields:
@@ -395,7 +395,7 @@ \(\mathsf{isk}\!\) , that validates the issuance. -The issuance bundle is added within the transaction format as a new bundle. The detailed encoding of the issuance bundle as a part of the V6 transaction format is defined in ZIP 230 17.
+The issuance bundle is added within the transaction format as a new bundle. The detailed encoding of the issuance bundle as a part of the V6 transaction format is defined in ZIP 230 18.
We define a function @@ -760,7 +760,7 @@
This section details the construction of the subtree of hashes in the transaction digest that corresponds to issuance transaction data. Details of the overall changes to the transaction digest due to the OrchardZSA protocol can be found in ZIP 226 13. As in ZIP 244 19, the digests are all personalized BLAKE2b-256 hashes, and in cases where no elements are available for hashing, a personalized hash of the empty byte array is used.
+This section details the construction of the subtree of hashes in the transaction digest that corresponds to issuance transaction data. Details of the overall changes to the transaction digest due to the OrchardZSA protocol can be found in ZIP 226 13. As in ZIP 244 20, the digests are all personalized BLAKE2b-256 hashes, and in cases where no elements are available for hashing, a personalized hash of the empty byte array is used.
A new issuance transaction digest algorithm is defined that constructs the subtree of the transaction digest tree of hashes for the issuance portion of a transaction. Each branch of the subtree will correspond to a specific subset of issuance transaction data. The overall structure of the hash is as follows; each name referenced here will be described in detail below:
issuance_digest ├── issue_actions_digest @@ -775,7 +775,7 @@ T.5b: issuanceValidatingKey (32 bytes)
The personalization field of this hash is set to:
"ZTxIdSAIssueHash"-
In case the transaction has no issuance components, ''issuance_digest'' is:
+In case the transaction has no issuance components, issuance_digest is:
BLAKE2b-256("ZTxIdSAIssueHash", [])
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:
@@ -793,7 +793,7 @@ T.5a.i.5: rseed (field encoding bytes)The personalization field of this hash is set to:
"ZTxIdIAcNoteHash"-
In case the transaction has no Issue Notes, ''issue_notes_digest'' is:
+In case the transaction has no Issue Notes, issue_notes_digest is:
BLAKE2b-256("ZTxIdIAcNoteHash", [])
This is the raw encoding of an Orchard shielded payment address as defined in the protocol specification 32.
@@ -830,29 +830,10 @@The per-input transaction digest algorithm to generate the signature digest in ZIP 244 20 is modified so that a signature digest is produced for each transparent input, each Sapling input, each Orchard action, and additionally for each Issuance Action. For Issuance Actions, this algorithm has the exact same output as the transaction digest algorithm, thus the txid may be signed directly.
-The overall structure of the hash is as follows. We highlight the changes for the OrchardZSA protocol via the [ADDED FOR ZSA] text label, and we omit the descriptions of the sections that do not change for the OrchardZSA protocol:
signature_digest -├── header_digest -├── transparent_sig_digest -├── sapling_digest -├── orchard_digest -└── issuance_digest [ADDED FOR ZSA]-
A BLAKE2b-256 hash of the following values
-S.1: header_digest (32-byte hash output) -S.2: transparent_sig_digest (32-byte hash output) -S.3: sapling_digest (32-byte hash output) -S.4: orchard_digest (32-byte hash output) -S.5: issuance_digest (32-byte hash output) [ADDED FOR ZSA]-
The personalization field remains the same as in ZIP 244 19.
-Identical to that specified for the transaction identifier.
-The changes to the signature digest are specified in ZIP 226 14.
In addition to the parameters defined in the Fee calculation section of ZIP 317 21, the OrchardZSA protocol upgrade defines the following additional parameters:
+In addition to the parameters defined in the Fee calculation section of ZIP 317 21, the OrchardZSA protocol upgrade defines the following additional parameters:
The other inputs to this formula are taken from transaction fields defined in the Zcash protocol specification 33 and the global state. They are defined in the Fee calculation section of ZIP 317 21. Note that +
The other inputs to this formula are taken from transaction fields defined in the Zcash protocol specification 33 and the global state. They are defined in the Fee calculation section of ZIP 317 21. Note that \(nOrchardActions\!\) , that is used in the computation of \(logical\_actions\!\) @@ -962,7 +943,7 @@
For bridging purposes, the secure method of off-boarding Assets is to burn an Asset with the burning mechanism in ZIP 226 10. Users should be aware of issuers that demand the Assets be sent to a specific address on the Zcash chain to be redeemed elsewhere, as this may not reflect the real reserve value of the specific Wrapped Asset.
+For bridging purposes, the secure method of off-boarding Assets is to burn an Asset with the burning mechanism in ZIP 226 10. Users should be aware of issuers that demand the Assets be sent to a specific address on the Zcash chain to be redeemed elsewhere, as this may not reflect the real reserve value of the specific Wrapped Asset.
The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317, and is described in ZIP 230 18.
+The fee mechanism described in this ZIP will follow the mechanism described in ZIP 317, and is described in ZIP 230 19.
| 14 | -ZIP 226: Transfer and Burn of Zcash Shielded Assets - Authorizing Data Commitment | +ZIP 226: Transfer and Burn of Zcash Shielded Assets: Signature Digest |
|---|
| 15 | -ZIP 230: Version 6 Transaction Format: Issuance Action Description (IssueAction) | +ZIP 226: Transfer and Burn of Zcash Shielded Assets - Authorizing Data Commitment |
|---|
| 16 | -ZIP 230: Version 6 Transaction Format: Issue Note (IssueNote) | +ZIP 230: Version 6 Transaction Format: Issuance Action Description (IssueAction) |
|---|
| 17 | -ZIP 230: Version 6 Transaction Format: Transaction Format | +ZIP 230: Version 6 Transaction Format: Issue Note (IssueNote) |
|---|
| 18 | -ZIP 230: Version 6 Transaction Format: OrchardZSA Fee Calculation | +ZIP 230: Version 6 Transaction Format: Transaction Format |
|---|
| 19 | -ZIP 244: Transaction Identifier Non-Malleability | +ZIP 230: Version 6 Transaction Format: OrchardZSA Fee Calculation |
|---|
| 20 | -ZIP 244: Transaction Identifier Non-Malleability: Signature Digest | +ZIP 244: Transaction Identifier Non-Malleability |
|---|
The transaction format for v6 transactions is described in ZIP 230 13.
The transaction digest algorithm defined in ZIP 244 14 is modified by the OrchardZSA protocol to add a new branch for issuance information, along with replacement of the orchard_digest with a new orchard_zsa_digest to account for the inclusion of the Asset Base and the updated transaction format. The details of these changes are described in this section, and highlighted using the [UPDATED FOR ZSA] or [ADDED FOR ZSA] text label. We omit the details of the sections that do not change for the OrchardZSA protocol.
The transaction digest algorithm defined in ZIP 244 14 is modified by the OrchardZSA protocol to add a new branch for issuance information, along with replacement of the orchard_digest with a new orchard_zsa_digest to account for the inclusion of the Asset Base and the updated transaction format. The details of these changes are described in this section, and highlighted using the [ADDED FOR ZSA] text label. We omit the details of the sections that do not change for the OrchardZSA protocol.
A BLAKE2b-256 hash of the following values:
T.1: header_digest (32-byte hash output) @@ -562,30 +562,30 @@The