Skip to content

[Sapling] specify Pedersen hashes for a collision-resistant hash function inside the SNARK #2234

@zookozcash

Description

@zookozcash

from #2230

Ian Miers noticed that a pedersen hash is an exceptionally good application for this fast ECC. Pedersen hashes have been mentioned in papers spanning decades, but have been largely ignored due to inefficiency. However, in our case they are perfect. Inside the circuit they are very competitive with MiMC (a hash function submitted to Asiacrypt last year) except that a pedersen hash has collision resistance that reduces to discrete log -- far more believable than their construction.

In particular, we select a vector g of n group elements of unknown exponent, and given a vector x of n scalar bits, we compute:

g1x1 g2x2 ... gnxn

It is trivial to see that finding a collision requires defeating discrete log in the group. Further, in our construction we can return the y coordinate of the result, which is a single field scalar. (Recall that in Edwards curves, the x coordinate encodes the sign.) Because the group order is an odd prime, collision resistance still reduces to discrete log.

Metadata

Metadata

Assignees

Labels

A-circuitArea: zk-SNARK circuitsA-cryptoArea: CryptographyC-researchCategory: Engineering notes in support of design choicesI-SECURITYProblems and improvements related to security.I-performanceProblems and improvements with respect to performanceM-requires-nuA network upgrade is required to implement this.NU1-saplingNetwork upgrade: Sapling-specific taskselliptic curvesspecial to Zooko

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions