diff --git a/README.rst b/README.rst index e635143e..c90fd46c 100644 --- a/README.rst +++ b/README.rst @@ -98,7 +98,7 @@ Index of ZIPs 219 Disabling Addition of New Value to the Sapling Chain Value Pool Reserved 221 FlyClient - Consensus-Layer Changes Final 222 Transparent Zcash Extensions Draft - 224 Orchard Shielded Protocol Reserved + 224 Orchard Shielded Protocol Draft 225 Version 5 Transaction Format Proposed 243 Transaction Signature Validation for Sapling Final 244 Transaction Identifier Non-Malleability Proposed diff --git a/index.html b/index.html index 5d9767ac..83cf404f 100644 --- a/index.html +++ b/index.html @@ -71,7 +71,7 @@ 219 Disabling Addition of New Value to the Sapling Chain Value Pool Reserved 221 FlyClient - Consensus-Layer Changes Final 222 Transparent Zcash Extensions Draft - 224 Orchard Shielded Protocol Reserved + 224 Orchard Shielded Protocol Draft 225 Version 5 Transaction Format Proposed 243 Transaction Signature Validation for Sapling Final 244 Transaction Identifier Non-Malleability Proposed diff --git a/zip-0224.html b/zip-0224.html index 7ba3cdc9..f39c9d8d 100644 --- a/zip-0224.html +++ b/zip-0224.html @@ -3,6 +3,7 @@ ZIP 224: Orchard Shielded Protocol +
@@ -13,15 +14,351 @@ Owners: Daira Hopwood <daira@electriccoin.co> Sean Bowe <sean@electriccoin.co> Kris Nuttycombe <kris@electriccoin.co> Ying Tong Lai <yingtong@electriccoin.co> -Status: Reserved +Status: Draft Category: Consensus Discussions-To: <https://github.com/zcash/zips/issues/435> -

This ZIP number is reserved. Preliminary technical content relating to Orchard and Halo 2 are currently in:

- +

Abstract

+

This document proposes the Orchard shielded protocol, which defines a new shielded pool with spending keys and payment addresses that are amenable to future scalability improvements.

+
+

Motivation

+

TBD

+
+

Specification

+

The Orchard protocol is specified as an update to the Zcash Protocol Specification 1. Given that it largely follows the design of the Sapling protocol, we provide here a list of differences, with references to their normative specifications and associated design rationale.

+

Curves

+

The Orchard protocol uses the Pallas / Vesta curve cycle, in place of BLS12-381 and its embedded curve Jubjub:

+
    +
  • Pallas is used as the "application curve", on which the Orchard protocol itself is implemented (c/f Jubjub).
  • +
  • Vesta is used as the "circuit curve"; its scalar field (being the base field of Pallas) is the "word" type over which the circuit is implemented (c/f BLS12-381).
  • +
+

We use (version 10 of) the IETF hash-to-curve Internet Draft 25 to implement + \(\mathsf{GroupHash}\) + , instead of the BLAKE2s-based mechanism used for Sapling. We specifically use the "simplified SWU" algorithm, which provides an infallible + \(\mathsf{GroupHash}\) + .

+

The presence of the curve cycle is an explicit design choice. This ZIP only uses half of the cycle (Pallas being an embedded curve of Vesta); the full cycle is expected to be leveraged by future ZIPs.

+
    +
  • Curve specifications: 10
  • +
  • Group hash: 11
  • +
  • Supporting evidence: 26
  • +
+
+

Proving system

+

Orchard uses the Halo 2 proving system with the UltraPLONK arithmetization (UPA), instead of Groth16 and R1CS.

+

This ZIP does not make use of Halo 2's support for recursive proofs, but this is expected to be leveraged by future ZIPs.

+
    +
  • Halo 2 protocol description: TODO
  • +
  • UltraPLONK Arithmetization: 16
  • +
  • Halo 2 explanation and design rationale: 17
  • +
+
+

Circuit

+

Orchard uses a single circuit for both spends and outputs, similar to Sprout. An "action" contains both a single (possibly dummy) note being spent, and a single (possibly dummy) note being created.

+

An Orchard transaction contains a "bundle" of actions, and a single Halo 2 proof that covers all of the actions in the bundle.

+
    +
  • Action description: 4
  • +
  • Circuit statement: 5
  • +
  • Design rationale: 19
  • +
+
+

Commitments

+

The Orchard protocol has equivalent commitment schemes to Sapling. For non-homomorphic commitments, Orchard uses the UPA-efficient Sinsemilla in place of Bowe--Hopwood Pedersen hashes.

+
    +
  • Sinsemilla hash function: 7
  • +
  • Sinsemilla commitments: 9
  • +
  • Design rationale: 20
  • +
+
+

Commitment tree

+

Orchard uses an identical commitment tree structure to Sapling, except that we instantiate it with Sinsemilla instead of a Bowe-Hopwood Pedersen hash.

+
    +
  • Design rationale and considered alternatives: 21
  • +
+
+

Keys and addresses

+

Orchard keys and payment addresses are structurally similar to Sapling, with the following changes:

+
    +
  • The proof authorizing key is removed, and + \(\mathsf{nk}\) + is now a field element.
  • +
  • + \(\mathsf{ivk}\) + is computed as a Sinsemilla commitment instead of a BLAKE2s output.
  • +
  • + \(\mathsf{ovk}\) + is derived from + \(\mathsf{fvk}\) + , instead of being a component of the spending key.
  • +
  • All diversifiers now result in valid payment addresses.
  • +
+

Keys and addresses are encoded using Bech32. Orchard addresses used with the Zcash mainnet have the prefix "zo" (compared to "zc" for Sprout and "zs" for Sapling).

+

Orchard keys may be derived in a hierarchical deterministic (HD) manner. We do not adapt the Sapling HD mechanism from ZIP 32 23 to Orchard; instead, we define a simple hardened-only derivation mechanism.

+
    +
  • Key components diagram: 2
  • +
  • Key components specification: 6
  • +
  • Encodings and HRPs: 12 13 14 15
  • +
  • HD key derivation specification: TODO +
      +
    • Needs to be hierarchical, but output only needs to be uniform 32 bytes.
    • +
    • Probably just BLAKE2b-256(derivation_path), in line with our existing primitives.
    • +
    +
  • +
  • Design rationale: 18
  • +
+
+

Notes

+

Orchard notes have the structure + \((addr, v, \rho, \psi, \mathsf{rcm})\) + . + \(\psi\) + and + \(\mathsf{rcm}\) + are derived from a random seed (as with Sapling after ZIP 212 24).

+
    +
  • Orchard notes: 3
  • +
+
+

Nullifiers

+

Nullifiers for Orchard notes are computed as:

+

+ \(\mathsf{nf} = [F_{\mathsf{nk}}(\rho) + \psi \pmod{p}] \mathcal{G} + \mathsf{cm}\) +

+

where + \(F\) + is instantiated with Poseidon, and + \(\mathcal{G}\) + is a fixed independent base.

+
    +
  • Poseidon: TODO
  • +
  • Design rationale and considered alternatives: 22
  • +
+
+

Signatures

+

Orchard uses RedPallas (RedDSA instantiated with the Pallas curve) as its signature scheme in place of Sapling's RedJubjub (RedDSA instantiated with the Jubjub curve).

+
    +
  • RedPallas: 8
  • +
+
+
+

Additional Rationale

+

TBD

+
+

Security and Privacy Considerations

+

TBD

+
+

Deployment

+

This ZIP is proposed to activate with Network Upgrade 5.

+
+

References

+ + + + + + + +
1Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]
+ + + + + + + +
2Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 3.1: Payment Addresses and Keys
+ + + + + + + +
3Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 3.2: Notes
+ + + + + + + +
4Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 3.7: Action Transfers and their Descriptions
+ + + + + + + +
5Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. 4.17.4: Action Statement (Orchard)
+ + + + + + + +
6Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 4.2.3: Orchard Key Components
+ + + + + + + +
7Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 5.4.1.9: Sinsemilla Hash Function
+ + + + + + + +
8Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 5.4.6: RedDSA, RedJubjub, and RedPallas
+ + + + + + + +
9Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 5.4.7.4: Sinsemilla commitments
+ + + + + + + +
10Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 5.4.8.6: Pallas and Vesta
+ + + + + + + +
11Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 5.4.8.8: Group Hash into Pallas and Vesta
+ + + + + + + +
12Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 5.6.5: Orchard Payment Address
+ + + + + + + +
13Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 5.6.8: Orchard Incoming Viewing Keys
+ + + + + + + +
14TODO
+ + + + + + + +
15TODO
+ + + + + + + +
16The halo2 Book: 1.2 UltraPLONK Arithmetization
+ + + + + + + +
17The halo2 Book: 3.1. Proving system
+ + + + + + + +
18The Orchard Book: 3.1. Keys and addresses
+ + + + + + + +
19The Orchard Book: 3.2. Actions
+ + + + + + + +
20The Orchard Book: 3.3. Commitments
+ + + + + + + +
21The Orchard Book: 3.4. Commitment tree
+ + + + + + + +
22The Orchard Book: 3.5. Nullifiers
+ + + + + + + +
23ZIP 32: Shielded Hierarchical Deterministic Wallets
+ + + + + + + +
24ZIP 212: Allow Recipient to Derive Sapling Ephemeral Secret from Note Plaintext
+ + + + + + + +
25draft-irtf-cfrg-hash-to-curve-10: Hashing to Elliptic Curves
+ + + + + + + +
26Pallas/Vesta supporting evidence
+
\ No newline at end of file diff --git a/zip-0224.rst b/zip-0224.rst index 2e969a3f..910fece8 100644 --- a/zip-0224.rst +++ b/zip-0224.rst @@ -7,14 +7,208 @@ Sean Bowe Kris Nuttycombe Ying Tong Lai - Status: Reserved + Status: Draft Category: Consensus Discussions-To: -This ZIP number is reserved. Preliminary technical content relating to Orchard and Halo 2 -are currently in: -* the `Orchard Book `_; -* the `Halo Book `_; -* zcash/zcash GitHub tickets labeled `A-Orchard `_ - and `A-Halo `_. +Abstract +======== + +This document proposes the Orchard shielded protocol, which defines a new shielded pool +with spending keys and payment addresses that are amenable to future scalability +improvements. + + +Motivation +========== + +TBD + + +Specification +============= + +The Orchard protocol is specified as an update to the Zcash Protocol Specification +[#orchard-spec]_. Given that it largely follows the design of the Sapling protocol, we +provide here a list of differences, with references to their normative specifications +and associated design rationale. + +Curves +------ + +The Orchard protocol uses the Pallas / Vesta curve cycle, in place of BLS12-381 and its +embedded curve Jubjub: + +- Pallas is used as the "application curve", on which the Orchard protocol itself is + implemented (c/f Jubjub). +- Vesta is used as the "circuit curve"; its scalar field (being the base field of Pallas) + is the "word" type over which the circuit is implemented (c/f BLS12-381). + +We use (version 10 of) the IETF hash-to-curve Internet Draft [#ietf-hash-to-curve]_ to +implement :math:`\mathsf{GroupHash}`, instead of the BLAKE2s-based mechanism used for +Sapling. We specifically use the "simplified SWU" algorithm, which provides an infallible +:math:`\mathsf{GroupHash}`. + +The presence of the curve cycle is an explicit design choice. This ZIP only uses half of +the cycle (Pallas being an embedded curve of Vesta); the full cycle is expected to be +leveraged by future ZIPs. + +- Curve specifications: [#spec-pasta]_ +- Group hash: [#spec-pasta-grouphash]_ +- Supporting evidence: [#pasta-evidence]_ + +Proving system +-------------- + +Orchard uses the Halo 2 proving system with the UltraPLONK arithmetization (UPA), instead +of Groth16 and R1CS. + +This ZIP does not make use of Halo 2's support for recursive proofs, but this is expected +to be leveraged by future ZIPs. + +- Halo 2 protocol description: TODO +- UltraPLONK Arithmetization: [#concepts-upa]_ +- Halo 2 explanation and design rationale: [#design-halo2]_ + +Circuit +------- + +Orchard uses a single circuit for both spends and outputs, similar to Sprout. An "action" +contains both a single (possibly dummy) note being spent, and a single (possibly dummy) +note being created. + +An Orchard transaction contains a "bundle" of actions, and a single Halo 2 proof that +covers all of the actions in the bundle. + +- Action description: [#spec-actions]_ +- Circuit statement: [#spec-action-statement]_ +- Design rationale: [#design-actions]_ + +Commitments +----------- + +The Orchard protocol has equivalent commitment schemes to Sapling. For non-homomorphic +commitments, Orchard uses the UPA-efficient Sinsemilla in place of Bowe--Hopwood Pedersen +hashes. + +- Sinsemilla hash function: [#spec-sinsemilla-hash]_ +- Sinsemilla commitments: [#spec-sinsemilla-comm]_ +- Design rationale: [#design-commitments]_ + +Commitment tree +--------------- + +Orchard uses an identical commitment tree structure to Sapling, except that we instantiate +it with Sinsemilla instead of a Bowe-Hopwood Pedersen hash. + +- Design rationale and considered alternatives: [#design-tree]_ + +Keys and addresses +------------------ + +Orchard keys and payment addresses are structurally similar to Sapling, with the following +changes: + +- The proof authorizing key is removed, and :math:`\mathsf{nk}` is now a field element. +- :math:`\mathsf{ivk}` is computed as a Sinsemilla commitment instead of a BLAKE2s output. +- :math:`\mathsf{ovk}` is derived from :math:`\mathsf{fvk}`, instead of being a component + of the spending key. +- All diversifiers now result in valid payment addresses. + +Keys and addresses are encoded using Bech32. Orchard addresses used with the Zcash mainnet +have the prefix "zo" (compared to "zc" for Sprout and "zs" for Sapling). + +Orchard keys may be derived in a hierarchical deterministic (HD) manner. We do not adapt +the Sapling HD mechanism from ZIP 32 [#zip-0032]_ to Orchard; instead, we define a simple +hardened-only derivation mechanism. + +- Key components diagram: [#spec-addrs-keys]_ +- Key components specification: [#spec-keys]_ +- Encodings and HRPs: [#spec-encoding-addr]_ [#spec-encoding-ivk]_ [#spec-encoding-fvk]_ + [#spec-encoding-sk]_ +- HD key derivation specification: TODO + + - Needs to be hierarchical, but output only needs to be uniform 32 bytes. + - Probably just `BLAKE2b-256(derivation_path)`, in line with our existing primitives. + +- Design rationale: [#design-keys]_ + +Notes +----- + +Orchard notes have the structure :math:`(addr, v, \rho, \psi, \mathsf{rcm})`. :math:`\psi` +and :math:`\mathsf{rcm}` are derived from a random seed (as with Sapling after ZIP 212 +[#zip-0212]_). + +- Orchard notes: [#spec-notes]_ + +Nullifiers +---------- + +Nullifiers for Orchard notes are computed as: + +:math:`\mathsf{nf} = [F_{\mathsf{nk}}(\rho) + \psi \pmod{p}] \mathcal{G} + \mathsf{cm}` + +where :math:`F` is instantiated with Poseidon, and :math:`\mathcal{G}` is a fixed +independent base. + +- Poseidon: TODO +- Design rationale and considered alternatives: [#design-nullifiers]_ + +Signatures +---------- + +Orchard uses RedPallas (RedDSA instantiated with the Pallas curve) as its signature scheme +in place of Sapling's RedJubjub (RedDSA instantiated with the Jubjub curve). + +- RedPallas: [#spec-redpallas]_ + + +Additional Rationale +==================== + +TBD + + +Security and Privacy Considerations +=================================== + +TBD + + +Deployment +========== + +This ZIP is proposed to activate with Network Upgrade 5. + + +References +========== + +.. [#orchard-spec] `Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal] `_ +.. [#spec-addrs-keys] `Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 3.1: Payment Addresses and Keys `_ +.. [#spec-notes] `Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 3.2: Notes `_ +.. [#spec-actions] `Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 3.7: Action Transfers and their Descriptions `_ +.. [#spec-action-statement] `Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. 4.17.4: Action Statement (Orchard) `_ +.. [#spec-keys] `Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 4.2.3: Orchard Key Components `_ +.. [#spec-sinsemilla-hash] `Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 5.4.1.9: Sinsemilla Hash Function `_ +.. [#spec-redpallas] `Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 5.4.6: RedDSA, RedJubjub, and RedPallas `_ +.. [#spec-sinsemilla-comm] `Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 5.4.7.4: Sinsemilla commitments `_ +.. [#spec-pasta] `Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 5.4.8.6: Pallas and Vesta `_ +.. [#spec-pasta-grouphash] `Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 5.4.8.8: Group Hash into Pallas and Vesta `_ +.. [#spec-encoding-addr] `Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 5.6.5: Orchard Payment Address `_ +.. [#spec-encoding-ivk] `Zcash Protocol Specification, Version 2021.1.16-gc8c7dd [Orchard proposal]. Section 5.6.8: Orchard Incoming Viewing Keys `_ +.. [#spec-encoding-fvk] TODO +.. [#spec-encoding-sk] TODO +.. [#concepts-upa] `The halo2 Book: 1.2 UltraPLONK Arithmetization `_ +.. [#design-halo2] `The halo2 Book: 3.1. Proving system `_ +.. [#design-keys] `The Orchard Book: 3.1. Keys and addresses `_ +.. [#design-actions] `The Orchard Book: 3.2. Actions `_ +.. [#design-commitments] `The Orchard Book: 3.3. Commitments `_ +.. [#design-tree] `The Orchard Book: 3.4. Commitment tree `_ +.. [#design-nullifiers] `The Orchard Book: 3.5. Nullifiers `_ +.. [#zip-0032] `ZIP 32: Shielded Hierarchical Deterministic Wallets `_ +.. [#zip-0212] `ZIP 212: Allow Recipient to Derive Sapling Ephemeral Secret from Note Plaintext `_ +.. [#ietf-hash-to-curve] `draft-irtf-cfrg-hash-to-curve-10: Hashing to Elliptic Curves `_ +.. [#pasta-evidence] `Pallas/Vesta supporting evidence `_