Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OrchardZSA backward compatability 0.8.0 (#104)
This pull request aims to generalize the implementation of the Orchard protocol, providing backward compatibility to support both the new (ZSA) and the original (non-ZSA - Vanilla) Orchard protocol variants. Key modifications and enhancements include: ### 1. Trait and Generic Structures for Note Encryption: - **OrchardDomain Trait:** A new `OrchardDomain` trait in `note_encryption.rs` differentiates between the original Orchard (Vanilla) and Orchard ZSA protocols, simplifying the implementation of the `Domain` trait through abstraction. - **OrchardDomainBase Generic Struct:** Introduced to contain data used for internal calculations in both Orchard variants. - **TransmittedNoteCiphertext Modifications:** This struct is now generic, supporting various lengths of encrypted note ciphertext to accommodate both Orchard variants. ### 2. Trait and Generic Structures for Circuit Generalization: - **OrchardCircuit Trait:** A new `OrchardCircuit` trait in `circuit.rs` provides an interface for different implementations of the PLONK circuit tailored to the specific requirements of the Orchard protocol's variants (Vanilla and ZSA). - **OrchardCircuitBase Generic Struct:** Contains data for internal calculations across both Orchard variants. ### 3. Module Organization: - Introduction of `note_encryption_vanilla.rs`, `note_encryption_zsa.rs` to support the different types of encrypted notes. - Introduction of `circuit_vanilla.rs`, and `circuit_zsa.rs` to support various circuit configurations. ### 4. Test Suite Updates: Updates to unit tests include separate versions for Vanilla and ZSA variants, ensuring thorough validation of the modifications. ### 5. Dependency Adaptation: The adoption of a modified version of the Halo2 Rust crate facilitates support for both Orchard protocol variants, guaranteeing that all tests, including those for non-ZSA functionality, pass successfully. --------- Co-authored-by: Paul <lauxpaul@protonmail.com> Co-authored-by: Dmitry Demin <dmitry@qed-it.com> Co-authored-by: Vivek Arte <46618816+vivek-arte@users.noreply.github.com> Co-authored-by: alexeykoren <2365507+alexeykoren@users.noreply.github.com>
- Loading branch information