HackMD
    • Create new note
    • Create a note from template
    • Sharing Link copied
    • /edit
    • View mode
      • Edit mode
      • View mode
      • Book mode
      • Slide mode
      Edit mode View mode Book mode Slide mode
    • Customize slides
    • Note Permission
    • Read
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • Write
      • Only me
      • Signed-in users
      • Everyone
      Only me Signed-in users Everyone
    • Commenting & Invitee
    • Publishing
      Please check the box to agree to the Community Guidelines.
      Everyone on the web can find and read all notes of this public team.
      After the note is published, everyone on the web can find and read this note.
      See all published notes on profile page.
    • Commenting Enable
      Disabled Forbidden Owners Signed-in users Everyone
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Invitee
    • No invitee
    • Options
    • Versions and GitHub Sync
    • Transfer ownership
    • Delete this note
    • Note settings
    • Template
    • Save as template
    • Insert from template
    • Export
    • Dropbox
    • Google Drive Export to Google Drive
    • Gist
    • Import
    • Dropbox
    • Google Drive Import from Google Drive
    • Gist
    • Clipboard
    • Download
    • Markdown
    • HTML
    • Raw HTML
Menu Note settings Sharing Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Transfer ownership Delete this note
Export
Dropbox Google Drive Export to Google Drive Gist
Import
Dropbox Google Drive Import from Google Drive Gist Clipboard
Download
Markdown HTML Raw HTML
Back
Sharing
Sharing Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Comment & Invitee
Publishing
Please check the box to agree to the Community Guidelines.
Everyone on the web can find and read all notes of this public team.
After the note is published, everyone on the web can find and read this note.
See all published notes on profile page.
More (Comment, Invitee)
Commenting Enable
Disabled Forbidden Owners Signed-in users Everyone
Permission
Owners
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Invitee
No invitee
   owned this note    owned this note      
Published Linked with GitHub
Like5 BookmarkBookmarked
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Full verification of the Mina blockchain on EVM ## Introduction The [Ethereum Foundation](https://ethereum.foundation/) (EF) and [Mina Foundation](https://minaprotocol.com/) (MF) would like to announce a Request for Proposals (RfP) for the design and implementation of a mechanism to verify the Pickles SNARK on Ethereum. Direct verification of this SNARK on the EVM appears to be too costly. Thus, we are accepting proposals for systems that may perform some preprocessing on the Pickles SNARK (e.g., by computing a STARK that verifies the Pickles SNARK which itself may be efficiently verified on the EVM). The goal of this is (1) to enable full-verification of the Mina blockchain on Ethereum to enable inter-op between the two chains, and (2) to enable applications more generally to use recursive SNARKs on Ethereum. ## Table of Contents [toc] ## Definitions Let \begin{align*} p &= 2^{254} + 45560315531419706090280762371685220353 \\ q &= 2^{254} + 45560315531506369815346746415080538113 \\ \mathbb{G}_1 &= \left\{ (x, y) \in \mathbb{F}_p \mid y^2 = x^3 + 5 \right\} \\ \mathbb{G}_2 &= \left\{ (x, y) \in \mathbb{F}_q \mid y^2 = x^3 + 5 \right\} \\ n_1 = 17 \\ n_2 = 16 \end{align*} Note that $|\mathbb{G}_1| = q$ and $|\mathbb{G}_2| = p$. The Pickles SNARK verifier as used in Mina has several components 1. Computing several hash values from the data of the proof. This involves using the Poseidon hash function with 63 full rounds both over $\mathbb{F}_p$ and $\mathbb{F}_q$ with round constants and MDS matrix specified [here for $\mathbb{F}_p$](https://github.com/o1-labs/marlin/blob/master/oracle/src/pasta/fp.rs) and [here for $\mathbb{F}_q$](https://github.com/o1-labs/marlin/blob/master/oracle/src/pasta/fq.rs). This step is fairly cheap and could likely be implemented with reasonable gas cost on EVM. 2. Checking several arithmetic equations. Again, this step is fairly cheap and could be implemented directly on EVM. 3. Performing one multi-scalar multiplication (MSM) of size $2 n_2 + 4 + (2 + 25) = 63$, for which some of the bases are fixed and some are variable. The step could likely be implemented directly on EVM with reasonable efficiency, although it is likely to be more expensive than steps 1 and 2. 4. For each $i$, performing a multi-scalar multiplication over $\mathbb{G}_i$ of size $2^{n_i}$ with a fixed array of bases, and with scalars that can be very efficiently computed from the proof. Step 4 is very unlikely to be efficiently computed directly on EVM, unless the computation is split over several blocks. As an alternative, we suggest grant recipients produce an additional proof (e.g., a AIR-based STARK or a BN128-based SNARK) which verifies the computation of that step. ## Reference implementation A Rust implementation of the Pickles verifier can be found [here](https://github.com/o1-labs/marlin/blob/master/dlog/plonk/src/verifier.rs#L207). It makes a procedure call to verify the underlying polynomial commitment opening, which code is located [here](https://github.com/o1-labs/marlin/blob/master/dlog/commitment/src/commitment.rs#L612). ## Extended discussion As mentioned above, the most expensive part of the verifier, and the part which would likely have to be verified in an auxiliary proof-system outside of EVM, is two MSMs. In this section, we describe these MSMs in more detail. Let $\mathbb{G}_k$ be one of the two curves defined above and let $\mathbb{F}$ be its scalar field. Let $\phi \colon \{ 0, 1 \}^{128} \to \mathbb{F}$ be the algorithm defined by `to_field` [here](https://github.com/o1-labs/marlin/blob/49f81edc9c86e5907d26ea791fa083640ad0ef3e/oracle/src/sponge.rs#L33). Given an integer $i < 2^{n_k}$, define $\mathsf{bits}(i)$ to be the little-endian bit array of length $n$ representing the binary expansion of $i$. From a given Pickles SNARK, one will derive a sequence of challenges $c_0, \dots, c_{n_k - 1} \in \{ 0, 1 \}^{128}$. The associated MSM is $$ \sum_{i = 0}^{2^{n_k} - 1} s_i G_i = H $$ where $$ s_i := \prod_{\substack{0 \leq j < n_k \\ \mathsf{bits}(i)[j] = 1}} \phi(c_j) $$ and where $G_0, \dots, G_{2^{n_k} - 1} \in \mathbb{G}$ is a fixed sequence of group elements as generated by [this algorithm](https://github.com/o1-labs/marlin/blob/master/dlog/commitment/src/srs.rs#L70). ### Observations The sequence of scalars $\left\{ s_i \right\}_{0 \leq i < 2^{n - 1}}$ can be reordered in such a way that each term can be obtained by the previous by at most one multiplication and one division. If one also reorders the fixed sequence of bases $\left\{ {G}_i \right\}_{0 \leq i < 2^{n - 1}}$ accordingly, this makes the MSM $\sum_i s_i {G}_i$ well suited to verifying with an AIR-based STARK, since the computation can be expressed as a loop in which each iteration is very efficiently expressed as an arithmetic computation (modulo lookups in a fixed lookup table). ## Version of code The github commit of the code which will serve as the spec will be determined at the beginning of the project. The code is developed in the open at https://github.com/o1-labs/marlin and https://github.com/minaprotocol/mina/. ## Process summary The entire process can be summarised as follows: 1. **Request:** Release of RfP (this post) 2. **Gather:** Vendors submit proposals 3. **Deliberate:** EF and MF decide which proposal to accept, and comes up with a plan based on the resources and needs of the accepted proposal. 4. **Propose:** EF and MF propose the plan to vendor, and makes adjustments based on vendor's feedback 5. **Begin:** Vendor accepts and work begins ## Engagement timeline The proposed timeline of the engagement is approximately 6 months. Members of the EF and the MF will be available at all times to answer questions and comments during planning and implementation in order to make life as easy as possible for the vendor. ## Deliverables Deliverable will take the form of - A program `aux-proof-gen` that takes as input a Mina blockchain-state and associated Pickles SNARK and produces an auxiliary proof. It must be possible to run this program in less than 15 minutes on a cloud instance with at most 16 cores and 32 GB of memory. - An Ethereum smart contract `aux-proof-verify` that has an internal state corresponding to the Mina blockchain state, and which can be set to a new state only if one provides an auxiliary proof that verifies. The contract should use at most 5M gas. - For a given Mina blockchain state $s$, it should be possible to produce an auxiliary proof using `aux-proof-gen` that verifies on `aux-proof-verify` with state $s$ if and only if one posseses a Pickles SNARK associated to state $s$. - A high-level description of the implemented auxiliary proof system. - Two blog posts describing the progress of the work; one halfway through the engagement and one at the end. - All code delivered under this RfP will be released under Apache License, Version 2.0. ## Fee Structure ### Invoices Based on the timeline of this RfP, the chosen vendor will be expected to submit 2 invoices: - a first invoice of 50% of the total engagement fee at the start of the engagement - a second invoice of 50% of the total engagement fee at the end of the engagement, following the delivery of all Deliverables, including the code and the final blog post, and a 5 day review period. ### Payment method The vendor will be given the option to be paid in Fiat money (via bank transfer), ETH, or MINA. If the vendor chooses to be paid in ETH, the value of ETH described under the agreement will be the value in USD at NYSE closing time (4 PM EST) on the day prior to the due date (as described at https://www.coingecko.com). If the vendor chooses to be paid in MINA, the value of MINA described under the agreement will be either: - the value in USD at NYSE closing time (4 PM EST) on the day prior to the due date (as described at https://www.coingecko.com), if there exists a reputable exchange with a publicly accessible market for the MINA tokens; - or the implied value in USD from Mina Tokens' latest private funding round, if there does not exist a reputable exchange with a publicly accessible market for the MINA tokens. ## Selection criteria The selected vendor will have significant expertise in the areas necessary to meet the needs and requirements set forth in this RfP. Particularly: - Expertise in applied cryptography and cryptographic systems, specifically STARKs and SNARKs - Expertise in low level, optimised code - Experience with EVM ## Bidding instructions Upon reception of this request, interested vendors are expected to confirm receipt and intention to bid on the engagement. In this confirmation, they should explain what they need from us in order to get started. As well as bring attention to areas in which they feel they do not have significant expertise. We will use this information to try to provide appropriate entrance material for the engagement. Proposals must be submitted before *March 31st, 2021 at 5pm PST*. We expect to take 1 week to deliberate and respond. Please send initial confirmations, and proposals (in PDF format) to the following address: rfp@ethereum.org _Feel free to send us any questions you may have: rfp@ethereum.org_

Import from clipboard

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lost their connection.

Create a note from template

Create a note from template

Oops...
This template is not available.


Upgrade

All
  • All
  • Team
No template found.

Create custom template


Upgrade

Delete template

Do you really want to delete this template?

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Tutorials

Book Mode Tutorial

Slide Mode Tutorial

YAML Metadata

Contacts

Facebook

Twitter

Discord

Feedback

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions

Versions and GitHub Sync

Sign in to link this note to GitHub Learn more
This note is not linked with GitHub Learn more
 
Add badge Pull Push GitHub Link Settings
Upgrade now

Version named by    

More Less
  • Edit
  • Delete

Note content is identical to the latest version.
Compare with
    Choose a version
    No search result
    Version not found

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub

      Please sign in to GitHub and install the HackMD app on your GitHub repo. Learn more

       Sign in to GitHub

      HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Available push count

      Upgrade

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Upgrade

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully