Skip to content

Commit

Permalink
docs: proofread Requester-Producer flow, Mina readme and parts 1,2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandra-mara committed Jul 26, 2023
1 parent f100cff commit 3140d62
Show file tree
Hide file tree
Showing 4 changed files with 188 additions and 222 deletions.
55 changes: 32 additions & 23 deletions gitbook-docs/guides-1/mina-proof-pipeline-example/1.-setup.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,50 @@
# 1. Setup
# Part 1: setup

MINA proofs are computationally heavy; hence, users need to use the proof market to generate proofs to have a MINA state proof validated in EVM.
Mina proofs are computationally heavy; hence, proof producers can benefit from
using Proof Market to generate Mina state proofs for their further in-EVM validation.

You need to set up the following environments to follow along with this guide.
You're going to need the following environments ready for this guide.

## 1. Proof Market 
## Step 1: Proof Market

Please ensure you have done the following steps:
Prerequisites from the Proof Market side are:

* [Installation](../../guides/installation.md): Clone the repository. You don't need to build anything, as we will only be using Python scripts.
* [Authentication](../../market/user-guides/sign-up.md): Set up the `proof-market-toolchain` authentication as a user. You do not need to create a Proof Producer profile.
* [Environment setup](../getting-started/environment-setup.md).
* [Proof Market toolchain installation and setup](../../getting-started/installation.md).
You don't need to set up a virtual environment for the Proof Market toolchain,
we will only be using its Python scripts.
This will be referred to as `proof-market-toolchain` home in the guide.
* [Authentication on Proof Market](../../market/user-guides/sign-up.md).
There's no need to register as a producer, any account will suffice.

This will be referred to as `proof-market-toolchain` the home in the guide
## Step 2: Mina state proof

## 2. Mina State Proof 
Mina state proof repository maintained by `=nil;` Foundation
comprises the following artifacts:
* Solidity EVM verifier;
* C++ circuits;
* scripts to fetch Mina state (ledger) and Mina account state (user/zkApp).

Mina state-proof repository maintains the following artifcats
Please clone the [Mina state proof repository](https://github.com/NilFoundation/mina-state-proof)
and install all its dependencies.

* Solidity EVM verifier 
* C++ circuits
* Scripts to fetch mina state (ledger) , mina account state (user/zkApp)
This will be referred to as `mina-state-proof` home in the guide.

 Please clone the repository located [here](https://github.com/NilFoundation/mina-state-proof) and install any dependencies. 
## Step 3: Mina zkApp

This will be referred to as `mina-state-proof` home in the guide
Mina zkApp project consists of a sample zkApp
located at `mina-state-proof/examples/mina-add-zkapp` with 8 state variables
that are updated on each interaction.
Please follow the steps
from [`mina-add-zkapp/README.md`](https://github.com/NilFoundation/mina-state-proof/tree/master/examples/mina-add-zkapp)
to install the project dependencies.

## 3. Mina zkApp
This will be referred to as `mina-add-zkApp` home in the guide.

Mina zkApp project consists of a sample zkApp with 8 state variables that are updated on each interaction. This is located at `mina-state-proof/examples/mina-add-zkapp` . Please follow the steps to Install the project dependencies present at `mina-state-proof/examples/mina-add-zkapp/README.md`. 
By now, you should have three folders with the three repositories above:

This will be referred to as `mina-add-zkApp` home in the guide

At the end of this step, you should have 3 folders representing the three repositories above as follows

```
```bash
proof-market-toolchain/
mina-state-proof/
mina-state-proof/examples/mina-add-zkapp/
```

Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# 2. Deploy zkApp
# Part 2: deploying zkApp

Please navigate to the `mina-add-zkapp` home directory.

The following steps deploy the zkApp to `Berkeley` testnet
The following steps deploy the zkApp to `Berkeley` test net.

## 1. Generate key-pair 
## Step 1: generate a key-pair

```
npm run build && node build/src/generateKeyPairs.js
```

This command outputs :
```console
$ npm run build && node build/src/generateKeyPairs.js

```
--------WARNING: UNSECURE KEYS DO NOT USE IN PRODUCTION ENV----------------

--------------------------------------------------------------------------
Expand All @@ -24,47 +20,39 @@ user public key : B62xxxxxxxxxxxxxxxxxxxxxxxx
--------------------------------------------------------------------------
```

The user should update 

Copy these keys to the corresponding paths:
* `zkApp` key pair to `keys/berkeley.json`
* `user` key pair to `keys/user.json`

Only the user wallet **must** be funded by requesting faucet funds on `BERKELEY` network here by providing the public key: [https://faucet.minaprotocol.com/](https://faucet.minaprotocol.com/)
Only the user wallet **must** be funded by requesting faucet funds on `BERKELEY` network here
by providing the public key: [https://faucet.minaprotocol.com/](https://faucet.minaprotocol.com/).

{% hint style="warning" %}
You must wait for your user wallet to be funded before progressing. This can take approximately 3-5 minutes.
You must wait for your user wallet to be funded before progressing.
This can take approximately 3-5 minutes.
{% endhint %}

## Step 2: build the project


## 2. Build Project

```
```bash
npm run build
```

## 3. Deploy Project
## Step 3: deploy the project

```
```bash
zk deploy berkeley
```

zkApp 8 state variables initialized to `1,2,3,4,5,6,7,8` The contract has a method `update` which increments the zkApp state fields by `1,2,3,4,5,6,7,8` each of them respectively.
zkApp 8 state variables initialized to `1,2,3,4,5,6,7,8`.
The contract has a method `update` that increments the zkApp state fields by `1,2,3,4,5,6,7,8` each of them respectively.

## 4. Interact with zkApp
## Step 4: interact with zkApp

```
```bash
node build/src/interact.js berkeley
```

Every interaction calls the `update` method which increments values as follows:

* `update#1` values changed to `2,4,6,8,10,12,14,16`
* `update#2` values changed to `3,6,9,12,15,18,21,24`.







* `update#1` values changed to `2,4,6,8,10,12,14,16`;
* `update#2` values changed to `3,6,9,12,15,18,21,24`.
7 changes: 5 additions & 2 deletions gitbook-docs/guides-1/mina-proof-pipeline-example/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Mina Proof pipeline - Example
# Mina proof pipeline example

This section describes a step-by-step workflow to validate MINA proofs in EVM via the =nil;Proof Market.
This section describes a step-by-step workflow to validate MINA proofs in EVM
via `=nil;` Proof Market.

Start here: [Mina proof pipeline example, step 1](1.-setup.md).
Loading

0 comments on commit 3140d62

Please sign in to comment.