anoma / vamp-ir

Vamp-IR is a proof-system-agnostic language for writing arithmetic circuits
https://anoma.github.io/VampIR-Book/
Apache License 2.0
155 stars 44 forks source link

Deploy a VampIR circuit to Ethereum #29

Open lopeetall opened 1 year ago

lopeetall commented 1 year ago

We'd like to have an entry point for ZK developers to get familiar with VampIR. Having a way to easily deploy a VampIR circuit to Ethereum would be a great way to show how VampIR can be used.

In order to do this, VampIR must compile to some backend ZK proof system library which can create a proof, and there must be a verifier matching this proof system as a smart contract on Ethereum.

lopeetall commented 1 year ago

VampIR currently compiles to zk-garage/plonk and Halo2, so the easiest path to EVM would be to find a verifier contract written in Solidity for Halo2.

Scroll appears to have one here: verifier.sol I'm not sure if there are any others.

lopeetall commented 1 year ago

Alternatively, we could write a synthesis to a new backend that is known to have a solidity verifier. Snarkyjs/Circom or Bellman would be good choices here. Snarkyjs can supposedly generate a solidity Verifier for both Plonk and Groth16. We might be able to save some time writing the synthesis (and get better efficiency) by mapping VampIR aliases directly to gadgets in those libraries.

lopeetall commented 1 year ago

ZKSync has a Plonk verifier in Solidity: https://github.com/matter-labs/solidity_plonk_verifier/blob/master/Verifier.sol