Skip to content

feat: zk#9

Merged
markosg04 merged 16 commits intomainfrom
feat/zk
Feb 27, 2026
Merged

feat: zk#9
markosg04 merged 16 commits intomainfrom
feat/zk

Conversation

@markosg04
Copy link
Collaborator

@markosg04 markosg04 commented Jan 23, 2026

Introduces a hiding version of the Dory protocol

markosg04 and others added 11 commits February 27, 2026 12:46
* feat: add ZK support for Jolt integration

- Add ArkDoryProof y_com/y_blinding field accessors
- Add ArkGT/ArkG1 serialization for transcript binding
- Fix typo in transcript.rs
- Fix clippy warnings in derive crate

* fix: remove y_blinding from proof serialization

y_blinding was never used by verifier but was being serialized,
leaking the blinding factor. Now returned separately from prove().

* fix: update tests for new prove/create_evaluation_proof return type

Destructure (proof, _) tuple from prove() and create_evaluation_proof()
which now return (DoryProof, Option<F>). Also add #[cfg(feature =
"disk-persistence")] guards to tests using load_setup/save_setup.

* fix: use separate URS paths for ZK and non-ZK modes

ZK mode serializes additional fields (h1_g2_fin) making the URS format
incompatible. Now uses dory_{n}_zk.urs for ZK mode.

* chore: format code for CI compatibility

* fix: update examples and benches for new prove return type

* style: add empty .rustfmt.toml for CI consistency
@markosg04 markosg04 marked this pull request as ready for review February 27, 2026 21:19
@markosg04 markosg04 merged commit 78ddee8 into main Feb 27, 2026
7 checks passed
Copy link

@moodlezoup moodlezoup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work! just some minor comments

- **Performance-optimized**: Vectorized operations, optional prepared point caching, and parallelization with Rayon
- **Flexible matrix layouts**: Supports both square and non-square matrices (nu ≤ sigma)
- **Homomorphic properties**: Commitment linearity enables proof aggregation
- **Zero-knowledge mode**: Toggable hiding proofs

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this what you mean?

Suggested change
- **Zero-knowledge mode**: Toggable hiding proofs
- **Zero-knowledge mode**: Toggleable hiding proofs

Comment on lines +40 to +49
#[cfg(feature = "zk")]
pub e2: Option<G2>,
#[cfg(feature = "zk")]
pub y_com: Option<G1>,
#[cfg(feature = "zk")]
pub sigma1_proof: Option<Sigma1Proof<G1, G2, G1::Scalar>>,
#[cfg(feature = "zk")]
pub sigma2_proof: Option<Sigma2Proof<G1::Scalar, GT>>,
#[cfg(feature = "zk")]
pub scalar_product_proof: Option<ScalarProductProof<G1, G2, G1::Scalar, GT>>,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc comments here would be good

Comment on lines +60 to +63
assert_eq!(proof.nu, decoded.nu);
assert_eq!(proof.sigma, decoded.sigma);
assert_eq!(proof.first_messages.len(), decoded.first_messages.len());
assert_eq!(proof.second_messages.len(), decoded.second_messages.len());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for this and the other roundtrip tests in this file, can we just do assert_eq!(proof, decoded)? Would be more robust

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, this is cool

@0xAndoroid 0xAndoroid deleted the feat/zk branch March 3, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants