Skip to content

Commit

Permalink
README updated with the binary instalation instruction.
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaskov committed Jan 5, 2024
1 parent 6697949 commit 972a440
Showing 1 changed file with 34 additions and 47 deletions.
81 changes: 34 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,44 @@
# proof-producer
Proof producer for the =nil; Proof Market https://proof.market.nil.foundation/
# Proof producer for the =nil; Proof Market
This repository contains the proof producer for the =nil; [Proof Market](https://proof.market/), which is a part of the =nil; [zkllvm toolchain](https://github.com/NilFoundation/zkLLVM) for zk-enabled applications development.

# How to use
It is needed to have [zkllvm](https://raw.githubusercontent.com/NilFoundation/zkllvm).

To generate proof:
The input for the proof producer is a circified version of the algorithm to be proven. This circified version of the algorithm is generated by the [zkllvm](https://raw.githubusercontent.com/NilFoundation/zkllvm) toolchain.

Typically, you want to use the proof producer to participate in the =nil; Proof Market. In this case, you need to have a valid account on the =nil; Proof Market, which you can create through the [Proof Market web interface](https://proof.market/) or by using the [Proof Market CLI](https://github.com/NilFoundation/proof-market-toolchain/).

# Installation

1. Run zkllv assigner to prepare assignment table and circuit
All parts of the zkLLVM toolchain are distributed in form of deb packages. To install them, you need to add the =nil; repository to your systems package manager:

```bash
echo 'deb [trusted=yes] http://deb.nil.foundation/ubuntu/ all main' >>/etc/apt/sources.list
apt update
```
${ZKLLVM_BUILD:-build}/bin/assigner/assigner -b ${ZKLLVM_BUILD:-build}/examples/cpp/merkle_tree_sha2_256_cpp_example.ll -i ${ZKLLVM_BUILD:-build}/examples/inputs/merkle_tree_sha2_256.inp -t merkle_tree_sha2_256_assignment.tbl -c merkle_tree_sha2_256_circuit.crct -e pallas

Then, you can install the proof producer by running:

```bash
apt install proof-producer
```
2. Run proof generator

# Usage

The proof producer is a command line tool. To see the list of available options, run:

```bash
proof-generator --help
```
./bin/proof-generator/proof-generator --circuit=./merkle_tree_sha2_256_circuit.crt --assignment-table=/balances_tree.tbl --proof=./proof.txt

To produce a proof, you need to provide the proof producer with the file with the circuit definition and the assignment table with the values of the execution trace. You generate them from the [zkllvm examples](https://github.com/NilFoundation/zkLLVM) or download the existing ones using the [Proof Market CLI](https://github.com/NilFoundation/proof-market-toolchain/).

When you have the circuit definition and the assignment table, you can produce a proof by running:

```bash
proof-generator --circuit <circuit-file> --assignment <assignment-file> --proof <proof-file>
```

# Building
# Building from source
1. Install dependencies:
```
sudo apt-get install \
Expand Down Expand Up @@ -50,41 +74,4 @@ ${ZKLLVM_BUILD:-build}/bin/assigner/assigner -b ${ZKLLVM_BUILD:-build}/examples/
cd build
cmake ..
make -j $(nrpoc)
```
# Releases
## DEB packages
Building DEB packages is tested on every CI run.
This way developers can be sure that their code can be built to a package
before they merge it.
To make a DEB release:
1. Update the version in the `VERSION` file, for example, `v0.42.0`.
2. Push this commit to the `master` branch.
3. Push a tag on this commit, named same as the version:
```
git tag v0.42.0
git push origin v0.42.0
```
4. Wait for CI to build and publish the package.
## Toolchain Docker image
Build an image:
```bash
docker build -t ghcr.io/nilfoundation/toolchain:0.1.7 -t ghcr.io/nilfoundation/toolchain:latest .
```

Push it to the registry:

```bash
docker login ghcr.io
docker push ghcr.io/nilfoundation/toolchain:0.1.7
docker push ghcr.io/nilfoundation/toolchain:latest
```
```

0 comments on commit 972a440

Please sign in to comment.