Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ristretto to Montgomery #314

Closed
vlopes11 opened this issue Feb 11, 2020 · 1 comment
Closed

Ristretto to Montgomery #314

vlopes11 opened this issue Feb 11, 2020 · 1 comment

Comments

@vlopes11
Copy link

Considering RistrettoPoint as a subgroup of edwards, the EdwardsPoint::to_montgomery method have an equivalent implementation for RistrettoPoint.

A use-case is described here:
zcash/zcash#3924 (comment)

@hdevalence
Copy link
Contributor

Hi there, I think I might not have been very clear in that comment (or assumed additional context), sorry!

The Ristretto group isn't just a subgroup of the Edwards points, and there's no conversion between Ristretto points and Montgomery points. What is possible is for a Ristretto implementation to implement Ristretto using Montgomery points instead of Edwards points internally, while still remaining wire-compatible with other Ristretto implementations. In other words, Ristretto implementations can choose which curve model (or even which curve) they want to use internally without breaking compatibility.

What this would look like is, instead of using the encoding/decoding formulas in the spec that decode to an internal Edwards point representation, an implementation could use different formulas that decode to an internal Montgomery point representation, if it was faster or better for some other reason to use Montgomery points. What are those formulas? They are obtained by tracing out maps in the conceptual diagram, but landing on M_{B,A} instead of E, and working out the explicit formulas.

The context for zcash/zcash#3924 (comment) was that Montgomery formulas are faster in the cost model for ZK proofs, so a ZK proof implementation can use Ristretto with a circuit-friendly model inside of the proof and a machine-friendly model outside of the proof. But this implementation is a software implementation, and the Edwards points used internally are very fast, so there is no reason to use an internal representation based on Montgomery points instead.

Does that help?

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

No branches or pull requests

2 participants