# How about integrate with Plonky2 into Orchard?

**URL:** <https://forum.zcashcommunity.com/t/how-about-integrate-with-plonky2-into-orchard/44879>\
**Category:** Technology\
**Created:** [June 16, 2023, 7:42am UTC](https://forum.zcashcommunity.com/t/how-about-integrate-with-plonky2-into-orchard/44879 "2023-06-16T07:42:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![adust09](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/adust09/32/27985_2.png) [@adust09](https://forum.zcashcommunity.com/u/adust09)\
**Post date:** [June 16, 2023, 7:42am UTC](https://forum.zcashcommunity.com/t/how-about-integrate-with-plonky2-into-orchard/44879/1 "2023-06-16T07:42:35Z")

</div>

I am considering rewriting current Orchard circuit (Halo2) with Plonky2.  
This would have the following two advantages

**1. Recursive Proof**  
When calculating the Commitment tree, the use of Plonky2’s Recursive system is expected to significantly reduce the proof time.  
However, it will be necessary to replace the Sinsemilla Hash with the Poseidon Hash.

**2. Quantum resistance**  
For this, daira has suggested using Plonky2 for the same.

> <https://github.com/zcash/zcash/issues/805#issuecomment-1219687266>
>
> There are three components necessary for a post-quantum Zcash:
> \- a post-quantum… public key encryption scheme;
> \- reanalysis of symmetric crypto parameter choices against quantum attacks;
> \- a practical post-quantum zkSNARK.
> 
> (For spend authorization, there are two options: use a post-quantum public key signature scheme, or incorporate spend authorization fully into the SNARK circuit. So only the three components above are strictly necessary.)
> 
> The first of these is already available, for example using \[New Hope\](https://eprint.iacr.org/2015/1092) \[edit: or \[CRYSTALS-Kyber as suggested below\](https://github.com/zcash/zcash/issues/805#issuecomment-1219687266)\] key exchange in place of Curve25519 elliptic curve key exchange. A complication is that New Hope has larger public keys and larger ciphertexts (2048 bytes each; see section 7.1 of the New Hope paper). The public key size means that a New Hope key can't be encoded directly in an address, but that is not a fundamental obstacle: it might be possible to use an address registration protocol as described in #340, for example. The ciphertext size is quite large compared to the rest of a Pour description (and remember that we need two of them), but not totally impractical. Alternatively some other scheme may have shorter ciphertexts.
> 
> For the zkSNARK, in principle the existence of one-way functions is sufficient for the existence of ZK proof systems. The issue is practicality: practical zkSNARKs use pairing-based cryptography, and it is not clear whether or not that is available for PQ public key cryptosystems.
> 
> Note that even though lacking a PQ-zkSNARK means that arbitrary currency could be forged by a quantum attacker (if quantum computers are ever practical), there is still value in switching to a PQ encryption scheme and ensuring that the symmetric parameter choices are sufficient. This is because a quantum attacker could otherwise break the Curve25519-based encryption (for known addresses) and obtain past transaction metadata.
> 
> It is also useful to reanalyse the symmetric parameter choices in order to check whether Zcash already achieves post-quantum past privacy for payments to addresses that have been kept secret. If this were the case then it would allow Zcash to be used now by people who require that property.

Having said that, is it possible to rewrite Orchard with Plonky2?  
My current understanding is not certain about the following 3 points.

1. Is there a problem with just replacing Poseidon Hash for the Commitment tree calculation, or is there a problem with PRF also using Poseidon Hash?

2. The whole thing is designed around Pallas and Vesta curve, but is there any problem if we define the ZKP part with Plonky2’s Goldilocks Field, so that the defined area of Pallas and Vesta and the defined area of Goldilocks Field coexist?

3. Halo2 allows Recursive system, but as far as I can tell from checking the ZCash specs, it doesn’t seem to get that benefit, why?
