From 0fc45a53cae22d5f8410657bbbbaa251750e2e4a Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Tue, 2 Mar 2021 17:58:12 -0700 Subject: [PATCH 1/6] Proposal to remove Sprout fields from the V5 transaction format. --- zip-0225.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/zip-0225.rst b/zip-0225.rst index e622f3421..82cf89b99 100644 --- a/zip-0225.rst +++ b/zip-0225.rst @@ -438,6 +438,26 @@ The personalization field of this hash is set to:: "ZTxAuthOrchaHash" +Alternatives +============ + +A possible modification to this proposal is to entirely remove the Sprout-related fields +``nJoinSplit``, ``vJoinSplit``, ``joinSplitPubKey``, and ``joinSplitSig`` from the V5 +transaction format. While this would effectively prohibit migration transactions that +directly move funds from the Sprout pool to the Orchard pool, Sprout -> Transparent and +Sprout -> Sapling transactions would still be supported when using the V4 transaction +format. This proposal is appealing from the perspective that it would reduce the +complexity of the NU5 upgrade in the following ways:: + +* V5 parsing and serialization code would not need to take these fields into account. +* ZIP 244 [#zip_0244]_ transaction identifier, signature hash, and authorizing + data commitment computations could be simplified to exclude consideration of + these fields. + +This change would mean that in the future, removing the support for the V4 transaction +format would also effectively end support for Sprout transactions on the zcash network, +though it might be possible to restore limited support for migration via a future ZIP 222 +[#zip_0222] extension or by other means not yet determined. Reference implementation ======================== From 9a4b2e9afe98d8b88c3da3c6600fc450ace561e6 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Tue, 2 Mar 2021 20:24:28 -0700 Subject: [PATCH 2/6] Update zip-0225.rst Co-authored-by: Daira Hopwood --- zip-0225.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zip-0225.rst b/zip-0225.rst index 82cf89b99..b5280aa5e 100644 --- a/zip-0225.rst +++ b/zip-0225.rst @@ -445,7 +445,7 @@ A possible modification to this proposal is to entirely remove the Sprout-relate ``nJoinSplit``, ``vJoinSplit``, ``joinSplitPubKey``, and ``joinSplitSig`` from the V5 transaction format. While this would effectively prohibit migration transactions that directly move funds from the Sprout pool to the Orchard pool, Sprout -> Transparent and -Sprout -> Sapling transactions would still be supported when using the V4 transaction +Sprout -> Sapling migration transactions would still be supported when using the V4 transaction format. This proposal is appealing from the perspective that it would reduce the complexity of the NU5 upgrade in the following ways:: From fbddfafef431233962d167e53941c50b66d8548e Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Wed, 17 Mar 2021 11:28:13 -0600 Subject: [PATCH 3/6] Update the alternatives section of ZIP-0225 to reflect the adopted alternative. --- zip-0225.rst | 127 ++++++++++++++++++++++++++------------------------- 1 file changed, 66 insertions(+), 61 deletions(-) diff --git a/zip-0225.rst b/zip-0225.rst index b5280aa5e..c130e8e19 100644 --- a/zip-0225.rst +++ b/zip-0225.rst @@ -100,19 +100,6 @@ Transaction Format +-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ |``varies`` |``tx_out`` |``tx_out`` |Transparent outputs, encoded as in Bitcoin. | +-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ -| **Sprout Transaction Fields** | -+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ -|``varies`` |``nJoinSplit`` |``compactSize`` |The number of JoinSplit descriptions in ``vJoinSplit``. | -+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ -|``1698 * nJoinSplit`` |``vJoinSplit`` |``JSDescriptionGroth16[nJoinSplit]`` |A sequence of JoinSplit descrptions using Groth16 proofs, | -| | | |encoded per §7.2 ‘JoinSplit Description Encoding and Consensus’. | -+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ -|``32`` |``joinSplitPubKey`` |``byte[32]`` |An encoding of a JoinSplitSig public validating key. | -+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ -|``64`` |``joinSplitSig`` |``byte[64]`` |A signature on a prefix of the transaction encoding, | -| | | |to be verfied using joinSplitPubKey as specified in §4.11 | -| | | |‘Non-malleability (Sprout)’. | -+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ | **Sapling Transaction Fields** | +-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ |``varies`` |``nSpendsSapling`` |``compactSize`` |Number of Sapling Spend descriptions in ``vSpendsSapling``. | @@ -173,9 +160,6 @@ Transaction Format present if and only if ``nActionsOrchard > 0``. If ``valueBalanceOrchard`` is not present, then ``valueBalanceOrchard`` is defined to be 0. -* The ``joinSplitPubKey`` and ``joinSplitSig`` fields are present if and only if - ``nJoinSplit > 0``. - * The elements of ``vSpendProofsSapling`` and ``vSpendAuthSigsSapling`` have a 1:1 correspondence to the elements of ``vSpendsSapling`` and MUST be ordered such that the proof or signature at a given index corresponds to the ``SpendDescriptionV5`` at the @@ -192,13 +176,12 @@ Transaction Format * For coinbase transactions, the ``spendsEnabledOrchard`` bit MUST be set to ``0``. -The encodings of ``tx_in``, ``tx_out``, and ``JSDescriptionGroth16``, are as in a -version 4 transaction (i.e. unchanged from Canopy). The encodings of ``SpendDescriptionV5``, -``OutputDescriptionV5`` and ``OrchardAction`` are described below. The encoding of Sapling -Spends and Outputs has changed relative to prior versions in order to better separate data -that describe the effects of the transaction from the proofs of and commitments to those -effects, and for symmetry with this separation in the Orchard-related parts of the -transaction format. +The encodings of ``tx_in``, and ``tx_out`` are as in a version 4 transaction (i.e. +unchanged from Canopy). The encodings of ``SpendDescriptionV5``, ``OutputDescriptionV5`` +and ``OrchardAction`` are described below. The encoding of Sapling Spends and Outputs has +changed relative to prior versions in order to better separate data that describe the +effects of the transaction from the proofs of and commitments to those effects, and for +symmetry with this separation in the Orchard-related parts of the transaction format. Sapling Spend Description (``SpendDescriptionV5``) -------------------------------------------------- @@ -281,7 +264,6 @@ are as in ZIP 244:: txid_digest ├── header_digest ├── transparent_digest - ├── sprout_digest ├── sapling_digest └── orchard_digest @@ -293,9 +275,8 @@ to be a BLAKE2b-256 hash of the following values :: T.1: header_digest (32-byte hash output) T.2: transparent_digest (32-byte hash output) - T.3: sprout_digest (32-byte hash output) - T.4: sapling_digest (32-byte hash output) - T.5: orchard_digest (32-byte hash output) + T.3: sapling_digest (32-byte hash output) + T.4: orchard_digest (32-byte hash output) The personalization field of this hash is unmodified from ZIP 244. @@ -304,17 +285,17 @@ The personalization field of this hash is unmodified from ZIP 244. A BLAKE2b-256 hash of the following values :: - T.5c: anchorOrchard (32 bytes) - T.5b: orchard_actions_compact_digest (32-byte hash output) - T.5c: orchard_actions_memos_digest (32-byte hash output) - T.5d: orchard_actions_noncompact_digest (32-byte hash output) - T.5e: valueBalanceOrchard (64-bit signed little-endian) + T.4c: anchorOrchard (32 bytes) + T.4b: orchard_actions_compact_digest (32-byte hash output) + T.4c: orchard_actions_memos_digest (32-byte hash output) + T.4d: orchard_actions_noncompact_digest (32-byte hash output) + T.4e: valueBalanceOrchard (64-bit signed little-endian) The personalization field of this hash is set to:: "ZTxIdOrchardHash" -T.5b: orchard_actions_compact_digest +T.4b: orchard_actions_compact_digest """""""""""""""""""""""""""""""""""" A BLAKE2b-256 hash of the subset of Orchard Action information intended to be included in @@ -322,29 +303,29 @@ an updated version of the ZIP-307 [#zip-0307]_ ``CompactBlock`` format for all O Actions belonging to the transaction. For each Action, the following elements are included in the hash:: - T.5b.i : nullifier (field encoding bytes) - T.5b.ii : cmx (field encoding bytes) - T.5b.iii: ephemeralKey (field encoding bytes) - T.5b.iv : encCiphertext[..52] (First 52 bytes of field encoding) + T.4b.i : nullifier (field encoding bytes) + T.4b.ii : cmx (field encoding bytes) + T.4b.iii: ephemeralKey (field encoding bytes) + T.4b.iv : encCiphertext[..52] (First 52 bytes of field encoding) The personalization field of this hash is set to:: "ZTxIdOrcOutCHash" -T.5c: orchard_actions_memos_digest +T.4c: orchard_actions_memos_digest """""""""""""""""""""""""""""""""" A BLAKE2b-256 hash of the subset of Orchard shielded memo field data for all Orchard Actions belonging to the transaction. For each Action, the following elements are included in the hash:: - T.5c.i: encCiphertext[52..564] (contents of the encrypted memo field) + T.4c.i: encCiphertext[52..564] (contents of the encrypted memo field) The personalization field of this hash is set to:: "ZTxIdOrcOutMHash" -T.5d: orchard_actions_noncompact_digest +T.4d: orchard_actions_noncompact_digest """"""""""""""""""""""""""""""""""""""" A BLAKE2b-256 hash of the remaining subset of Orchard Action information **not** intended @@ -352,10 +333,10 @@ for inclusion in an updated version of the the ZIP 307 [#zip-0307]_ ``CompactBlo format, for all Orchard Actions belonging to the transaction. For each Action, the following elements are included in the hash:: - T.5d.i : cv (field encoding bytes) - T.5d.ii : rk (field encoding bytes) - T.5d.iii: encCiphertext[564..] (post-memo suffix of field encoding) - T.5d.iv : outCiphertext (field encoding bytes) + T.4d.i : cv (field encoding bytes) + T.4d.ii : rk (field encoding bytes) + T.4d.iii: encCiphertext[464..] (post-memo suffix of field encoding) + T.4d.iv : outCiphertext (field encoding bytes) The personalization field of this hash is set to:: @@ -383,13 +364,12 @@ A BLAKE2b-256 hash of the following values :: S.1: header_digest (32-byte hash output) S.2: transparent_digest (32-byte hash output) - S.3: sprout_digest (32-byte hash output) - S.4: sapling_digest (32-byte hash output) - S.5: orchard_digest (32-byte hash output) + S.3: sapling_digest (32-byte hash output) + S.4: orchard_digest (32-byte hash output) The personalization field of this hash is unmodified from ZIP 244 -S.5: orchard_digest +S.4: orchard_digest """"""""""""""""""" Identical to that specified for the transaction identifier. @@ -441,23 +421,48 @@ The personalization field of this hash is set to:: Alternatives ============ -A possible modification to this proposal is to entirely remove the Sprout-related fields -``nJoinSplit``, ``vJoinSplit``, ``joinSplitPubKey``, and ``joinSplitSig`` from the V5 -transaction format. While this would effectively prohibit migration transactions that -directly move funds from the Sprout pool to the Orchard pool, Sprout -> Transparent and -Sprout -> Sapling migration transactions would still be supported when using the V4 transaction -format. This proposal is appealing from the perspective that it would reduce the -complexity of the NU5 upgrade in the following ways:: +The original version of ZIP-225 included Sprout-related fields ``nJoinSplit``, +``vJoinSplit``, ``joinSplitPubKey``, and ``joinSplitSig`` in the V5 +transaction format. The Electric Coin Company and Zcash Foundation teams have +elected to remove these fields from the V5 transaction format as part of the +continuing process of deprecation of the Sprout shielded pool. As a consequence +of these fields being removed:: + +* This effectively prohibits migration transactions that would directly move funds from + the Sprout pool to the Orchard pool. Sprout -> Transparent and Sprout -> Sapling + migration transactions will still be supported when using the V4 transaction format. -* V5 parsing and serialization code would not need to take these fields into account. +Removing these fields reduces the complexity of the NU5 upgrade in the following ways:: + +* V5 parsing and serialization code does not need to take these fields into account. * ZIP 244 [#zip_0244]_ transaction identifier, signature hash, and authorizing - data commitment computations could be simplified to exclude consideration of + data commitment computations are simplified by excluding consideration of these fields. -This change would mean that in the future, removing the support for the V4 transaction -format would also effectively end support for Sprout transactions on the zcash network, -though it might be possible to restore limited support for migration via a future ZIP 222 -[#zip_0222] extension or by other means not yet determined. +Having removed these fields means that that in the future, removing the support for the V4 +transaction format will also effectively end support for Sprout transactions on the zcash +network, though it might be possible to restore limited support for migration via a future +ZIP 222 [#zip_0222] extension or by other means not yet determined. + +The original definitions for the transaction fields that have been removed are:: + ++-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ +| **Sprout Transaction Fields** | ++-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ +|``varies`` |``nJoinSplit`` |``compactSize`` |The number of JoinSplit descriptions in ``vJoinSplit``. | ++-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ +|``1698 * nJoinSplit`` |``vJoinSplit`` |``JSDescriptionGroth16[nJoinSplit]`` |A sequence of JoinSplit descrptions using Groth16 proofs, | +| | | |encoded per §7.2 ‘JoinSplit Description Encoding and Consensus’. | ++-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ +|``32`` |``joinSplitPubKey`` |``byte[32]`` |An encoding of a JoinSplitSig public validating key. | ++-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ +|``64`` |``joinSplitSig`` |``byte[64]`` |A signature on a prefix of the transaction encoding, | +| | | |to be verfied using joinSplitPubKey as specified in §4.11 | +| | | |‘Non-malleability (Sprout)’. | ++-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+ + +* The ``joinSplitPubKey`` and ``joinSplitSig`` fields were specified to be + present if and only if ``nJoinSplit > 0``. Reference implementation ======================== From 9627ad7c497d300793333b7bcc7ee22ed18453fc Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Wed, 17 Mar 2021 11:54:07 -0600 Subject: [PATCH 4/6] Fix zip-0222 reference. --- zip-0225.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zip-0225.rst b/zip-0225.rst index c130e8e19..2c065aa24 100644 --- a/zip-0225.rst +++ b/zip-0225.rst @@ -442,7 +442,7 @@ Removing these fields reduces the complexity of the NU5 upgrade in the following Having removed these fields means that that in the future, removing the support for the V4 transaction format will also effectively end support for Sprout transactions on the zcash network, though it might be possible to restore limited support for migration via a future -ZIP 222 [#zip_0222] extension or by other means not yet determined. +ZIP 222 [#zip-0222]_ extension or by other means not yet determined. The original definitions for the transaction fields that have been removed are:: @@ -478,5 +478,6 @@ References .. [#protocol-spenddesc] `Zcash Protocol Specification, Version 2021.1.17 or later. Section 4.4: Spend Descriptions `_ .. [#protocol-outputdesc] `Zcash Protocol Specification, Version 2021.1.17 or later. Section 4.5: Output Descriptions `_ .. [#protocol-actiondesc] `Zcash Protocol Specification, Version 2021.1.17 or later. Section 4.6: Action Descriptions `_ +.. [#zip-0222] `ZIP 222: Transparent Zcash Extensions `_ .. [#zip-0244] `ZIP 244: Transaction Identifier Non-Malleability `_ .. [#zip-0307] `ZIP 307: Light Client Protocol for Payment Detection `_ From 09597dd1ee0dad990392e0017205c0f2277337d1 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Wed, 17 Mar 2021 11:54:51 -0600 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: Daira Hopwood --- zip-0225.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zip-0225.rst b/zip-0225.rst index 2c065aa24..1a2f11e46 100644 --- a/zip-0225.rst +++ b/zip-0225.rst @@ -335,7 +335,7 @@ the following elements are included in the hash:: T.4d.i : cv (field encoding bytes) T.4d.ii : rk (field encoding bytes) - T.4d.iii: encCiphertext[464..] (post-memo suffix of field encoding) + T.4d.iii: encCiphertext[564..] (post-memo suffix of field encoding) T.4d.iv : outCiphertext (field encoding bytes) The personalization field of this hash is set to:: @@ -439,8 +439,8 @@ Removing these fields reduces the complexity of the NU5 upgrade in the following data commitment computations are simplified by excluding consideration of these fields. -Having removed these fields means that that in the future, removing the support for the V4 -transaction format will also effectively end support for Sprout transactions on the zcash +Removal of these fields means that that in the future, removing the support for the V4 +transaction format will also effectively end support for Sprout transactions on the Zcash network, though it might be possible to restore limited support for migration via a future ZIP 222 [#zip-0222]_ extension or by other means not yet determined. From 6abc86fb989a632877d8a6dbb931a416b2f5cb5d Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Wed, 17 Mar 2021 18:08:29 +0000 Subject: [PATCH 6/6] ZIP 225: regenerate HTML. Signed-off-by: Daira Hopwood --- zip-0225.html | 167 +++++++++++++++++++++++++++++++------------------- 1 file changed, 104 insertions(+), 63 deletions(-) diff --git a/zip-0225.html b/zip-0225.html index fe363d7b6..4e4c8db21 100644 --- a/zip-0225.html +++ b/zip-0225.html @@ -21,7 +21,7 @@

Abstract

This proposal defines an update to the Zcash peer-to-peer transaction format to include support for data elements required to support the Orchard protocol 2. The new transaction format defines well-bounded regions of the serialized form to serve each of the existing pools of funds, and adds and describes a new region containing Orchard-specific elements.

-

This ZIP also depends upon and defines modifications to the computation of the values TxId Digest, Signature Digest, and Authorizing Data Commitment defined by ZIP 244 6.

+

This ZIP also depends upon and defines modifications to the computation of the values TxId Digest, Signature Digest, and Authorizing Data Commitment defined by ZIP 244 7.

Motivation

The new Orchard shielded pool requires serialized data elements that are distinct from any previous Zcash transaction. In addition, with the activation of ZIP 244, the serialized transaction format will no longer be consensus-critical. It makes sense at this point to define a format that can readily accommodate future extension in a systematic fashion, where elements required for support for a given pool are kept separate.

@@ -112,33 +112,6 @@ tx_out Transparent outputs, encoded as in Bitcoin. - - Sprout Transaction Fields - - - varies - nJoinSplit - compactSize - The number of JoinSplit descriptions in vJoinSplit. - - - 1698 * nJoinSplit - vJoinSplit - JSDescriptionGroth16[nJoinSplit] - A sequence of JoinSplit descrptions using Groth16 proofs, encoded per §7.2 ‘JoinSplit Description Encoding and Consensus’. - - - 32 - joinSplitPubKey - byte[32] - An encoding of a JoinSplitSig public validating key. - - - 64 - joinSplitSig - byte[64] - A signature on a prefix of the transaction encoding, to be verfied using joinSplitPubKey as specified in §4.11 ‘Non-malleability (Sprout)’. - Sapling Transaction Fields @@ -275,13 +248,12 @@
  • The valueBalanceSapling, anchorSapling, and bindingSigSapling fields are present if and only if nSpendsSapling + nOutputsSapling > 0. If valueBalanceSapling is not present, then valueBalanceSapling is defined to be 0.
  • The valueBalanceOrchard, anchorOrchard, and bindingSigOrchard fields are present if and only if nActionsOrchard > 0. If valueBalanceOrchard is not present, then valueBalanceOrchard is defined to be 0.
  • -
  • The joinSplitPubKey and joinSplitSig fields are present if and only if nJoinSplit > 0.
  • The elements of vSpendProofsSapling and vSpendAuthSigsSapling have a 1:1 correspondence to the elements of vSpendsSapling and MUST be ordered such that the proof or signature at a given index corresponds to the SpendDescriptionV5 at the same index.
  • The elements of vOutputProofsSapling have a 1:1 correspondence to the elements of vOutputsSapling and MUST be ordered such that the proof at a given index corresponds to the OutputDescriptionV5 at the same index.
  • The proofs aggregated in proofsOrchard, and the elements of vSpendAuthSigsOrchard, each have a 1:1 correspondence to the elements of vActionsOrchard and MUST be ordered such that the proof or signature at a given index corresponds to the OrchardAction at the same index.
  • For coinbase transactions, the spendsEnabledOrchard bit MUST be set to 0.
-

The encodings of tx_in, tx_out, and JSDescriptionGroth16, are as in a version 4 transaction (i.e. unchanged from Canopy). The encodings of SpendDescriptionV5, OutputDescriptionV5 and OrchardAction are described below. The encoding of Sapling Spends and Outputs has changed relative to prior versions in order to better separate data that describe the effects of the transaction from the proofs of and commitments to those effects, and for symmetry with this separation in the Orchard-related parts of the transaction format.

+

The encodings of tx_in, and tx_out are as in a version 4 transaction (i.e. unchanged from Canopy). The encodings of SpendDescriptionV5, OutputDescriptionV5 and OrchardAction are described below. The encoding of Sapling Spends and Outputs has changed relative to prior versions in order to better separate data that describe the effects of the transaction from the proofs of and commitments to those effects, and for symmetry with this separation in the Orchard-related parts of the transaction format.

Sapling Spend Description (SpendDescriptionV5)

@@ -420,59 +392,57 @@

Modifications to ZIP 244

TxId Digest

-

The tree of hashes defined by ZIP 244 6 is re-structured to include a new branch for Orchard hashes. The orchard_digest branch is the only new addition to the tree; header_digest, transparent_digest, sprout_digest, and sapling_digest are as in ZIP 244:

+

The tree of hashes defined by ZIP 244 7 is re-structured to include a new branch for Orchard hashes. The orchard_digest branch is the only new addition to the tree; header_digest, transparent_digest, sprout_digest, and sapling_digest are as in ZIP 244:

txid_digest
 ├── header_digest
 ├── transparent_digest
-├── sprout_digest
 ├── sapling_digest
 └── orchard_digest
txid_digest

The top hash of the txid_digest tree is modified from the ZIP 244 structure to be a BLAKE2b-256 hash of the following values

T.1: header_digest      (32-byte hash output)
 T.2: transparent_digest (32-byte hash output)
-T.3: sprout_digest      (32-byte hash output)
-T.4: sapling_digest     (32-byte hash output)
-T.5: orchard_digest     (32-byte hash output)
+T.3: sapling_digest (32-byte hash output) +T.4: orchard_digest (32-byte hash output)

The personalization field of this hash is unmodified from ZIP 244.

2: orchard_digest

A BLAKE2b-256 hash of the following values

-
T.5c: anchorOrchard                       (32 bytes)
-T.5b: orchard_actions_compact_digest      (32-byte hash output)
-T.5c: orchard_actions_memos_digest        (32-byte hash output)
-T.5d: orchard_actions_noncompact_digest   (32-byte hash output)
-T.5e: valueBalanceOrchard                 (64-bit signed little-endian)
+
T.4c: anchorOrchard                       (32 bytes)
+T.4b: orchard_actions_compact_digest      (32-byte hash output)
+T.4c: orchard_actions_memos_digest        (32-byte hash output)
+T.4d: orchard_actions_noncompact_digest   (32-byte hash output)
+T.4e: valueBalanceOrchard                 (64-bit signed little-endian)

The personalization field of this hash is set to:

"ZTxIdOrchardHash"
-
T.5b: orchard_actions_compact_digest
-

A BLAKE2b-256 hash of the subset of Orchard Action information intended to be included in an updated version of the ZIP-307 7 CompactBlock format for all Orchard Actions belonging to the transaction. For each Action, the following elements are included in the hash:

-
T.5b.i  : nullifier            (field encoding bytes)
-T.5b.ii : cmx                  (field encoding bytes)
-T.5b.iii: ephemeralKey         (field encoding bytes)
-T.5b.iv : encCiphertext[..52]  (First 52 bytes of field encoding)
+
T.4b: orchard_actions_compact_digest
+

A BLAKE2b-256 hash of the subset of Orchard Action information intended to be included in an updated version of the ZIP-307 8 CompactBlock format for all Orchard Actions belonging to the transaction. For each Action, the following elements are included in the hash:

+
T.4b.i  : nullifier            (field encoding bytes)
+T.4b.ii : cmx                  (field encoding bytes)
+T.4b.iii: ephemeralKey         (field encoding bytes)
+T.4b.iv : encCiphertext[..52]  (First 52 bytes of field encoding)

The personalization field of this hash is set to:

"ZTxIdOrcOutCHash"
-
T.5c: orchard_actions_memos_digest
+
T.4c: orchard_actions_memos_digest

A BLAKE2b-256 hash of the subset of Orchard shielded memo field data for all Orchard Actions belonging to the transaction. For each Action, the following elements are included in the hash:

-
T.5c.i: encCiphertext[52..564] (contents of the encrypted memo field)
+
T.4c.i: encCiphertext[52..564] (contents of the encrypted memo field)

The personalization field of this hash is set to:

"ZTxIdOrcOutMHash"
-
T.5d: orchard_actions_noncompact_digest
-

A BLAKE2b-256 hash of the remaining subset of Orchard Action information not intended for inclusion in an updated version of the the ZIP 307 7 CompactBlock format, for all Orchard Actions belonging to the transaction. For each Action, the following elements are included in the hash:

-
T.5d.i  : cv                    (field encoding bytes)
-T.5d.ii : rk                    (field encoding bytes)
-T.5d.iii: encCiphertext[564..]  (post-memo suffix of field encoding)
-T.5d.iv : outCiphertext         (field encoding bytes)
+
T.4d: orchard_actions_noncompact_digest
+

A BLAKE2b-256 hash of the remaining subset of Orchard Action information not intended for inclusion in an updated version of the the ZIP 307 8 CompactBlock format, for all Orchard Actions belonging to the transaction. For each Action, the following elements are included in the hash:

+
T.4d.i  : cv                    (field encoding bytes)
+T.4d.ii : rk                    (field encoding bytes)
+T.4d.iii: encCiphertext[564..]  (post-memo suffix of field encoding)
+T.4d.iv : outCiphertext         (field encoding bytes)

The personalization field of this hash is set to:

"ZTxIdOrcOutNHash"

Signature Digest

-

The signature digest creation algorithm defined by ZIP 244 6 is modified to include a new branch for Orchard hashes. The orchard_digest branch is the only new addition to the tree; header_digest, transparent_digest, sprout_digest, and sapling_digest are as in ZIP 244:

+

The signature digest creation algorithm defined by ZIP 244 7 is modified to include a new branch for Orchard hashes. The orchard_digest branch is the only new addition to the tree; header_digest, transparent_digest, sprout_digest, and sapling_digest are as in ZIP 244:

signature_digest
 ├── header_digest
 ├── transparent_digest
@@ -483,24 +453,23 @@
                         

A BLAKE2b-256 hash of the following values

S.1: header_digest      (32-byte hash output)
 S.2: transparent_digest (32-byte hash output)
-S.3: sprout_digest      (32-byte hash output)
-S.4: sapling_digest     (32-byte hash output)
-S.5: orchard_digest     (32-byte hash output)
+S.3: sapling_digest (32-byte hash output) +S.4: orchard_digest (32-byte hash output)

The personalization field of this hash is unmodified from ZIP 244

-
S.5: orchard_digest
+
S.4: orchard_digest

Identical to that specified for the transaction identifier.

Authorizing Data Commitment

-

The tree of hashes defined by ZIP 244 6 for authorizing data commitments is re-structured to include a new branch for Orchard Actions. The orchard_digest branch is the only new addition to the tree; transparent_digest, and sprout_digest sapling_digest are as in ZIP 244:

+

The tree of hashes defined by ZIP 244 7 for authorizing data commitments is re-structured to include a new branch for Orchard Actions. The orchard_digest branch is the only new addition to the tree; transparent_digest, and sprout_digest sapling_digest are as in ZIP 244:

auth_digest
 ├── transparent_scripts_digest
 ├── sprout_auth_digest
 ├── sapling_auth_digest
 └── orchard_auth_digest
auth_digest
-

The tree of hashes defined by ZIP 244 6 for authorizing data commitments is re-structured to include a new branch for Orchard authorizing data. The orchard_auth_digest branch is the only new addition to the tree; transparent_auth_digest, sprout_auth_digest, and sapling_auth_digest are as in ZIP 244:

+

The tree of hashes defined by ZIP 244 7 for authorizing data commitments is re-structured to include a new branch for Orchard authorizing data. The orchard_auth_digest branch is the only new addition to the tree; transparent_auth_digest, sprout_auth_digest, and sapling_auth_digest are as in ZIP 244:

A.1: transparent_scripts_digest (32-byte hash output)
 A.2: sprout_auth_digest         (32-byte hash output)
 A.3: sapling_auth_digest        (32-byte hash output)
@@ -518,6 +487,70 @@
                 
+

Alternatives

+

The original version of ZIP-225 included Sprout-related fields nJoinSplit, vJoinSplit, joinSplitPubKey, and joinSplitSig in the V5 transaction format. The Electric Coin Company and Zcash Foundation teams have elected to remove these fields from the V5 transaction format as part of the continuing process of deprecation of the Sprout shielded pool. As a consequence of these fields being removed:

+
* This effectively prohibits migration transactions that would directly move funds from
+
+

System Message: ERROR/3 (zip-0225.rst line 432)

+

Unexpected indentation.

+
+
+

the Sprout pool to the Orchard pool. Sprout -> Transparent and Sprout -> Sapling migration transactions will still be supported when using the V4 transaction format.

+
+

Removing these fields reduces the complexity of the NU5 upgrade in the following ways:

+
* V5 parsing and serialization code does not need to take these fields into account.
+* ZIP 244 [#zip_0244]_ transaction identifier, signature hash, and authorizing
+
+

System Message: ERROR/3 (zip-0225.rst line 439)

+

Unexpected indentation.

+
+
+

data commitment computations are simplified by excluding consideration of these fields.

+
+

Removal of these fields means that that in the future, removing the support for the V4 transaction format will also effectively end support for Sprout transactions on the Zcash network, though it might be possible to restore limited support for migration via a future ZIP 222 6 extension or by other means not yet determined.

+

The original definitions for the transaction fields that have been removed are:

+
+-----------------------------+--------------------------+----------------------------------------+---------------------------------------------------------------------+
+
+

System Message: ERROR/3 (zip-0225.rst line 450)

+

Inconsistent literal block quoting.

+
+
Sprout Transaction Fields |
+
+

System Message: WARNING/2 (zip-0225.rst line 451)

+

Line block ends without a blank line.

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
variesnJoinSplitcompactSizeThe number of JoinSplit descriptions in vJoinSplit.
1698 * nJoinSplitvJoinSplitJSDescriptionGroth16[nJoinSplit]A sequence of JoinSplit descrptions using Groth16 proofs, encoded per §7.2 ‘JoinSplit Description Encoding and Consensus’.
32joinSplitPubKeybyte[32]An encoding of a JoinSplitSig public validating key.
64joinSplitSigbyte[64]A signature on a prefix of the transaction encoding, to be verfied using joinSplitPubKey as specified in §4.11 ‘Non-malleability (Sprout)’.
+
    +
  • The joinSplitPubKey and joinSplitSig fields were specified to be present if and only if nJoinSplit > 0.
  • +
+

Reference implementation

TBD

@@ -562,10 +595,18 @@ - +
+ + + +
6ZIP 222: Transparent Zcash Extensions
+ + + + @@ -573,7 +614,7 @@
7 ZIP 244: Transaction Identifier Non-Malleability
- +
78 ZIP 307: Light Client Protocol for Payment Detection