This is the repo for hackathon project by MixBytes team of ETHGLobal Hackathon Istanbul, implementing Merkle Patricia Tree storage proofs
The project is based on ZKLLVM compiler-assigner-prover and forked from zkllvm-template project.
git clone --recurse-submodules https://github.com/mixbytes/zkllvm-mpt-proofs.git
cd zkllvm-mpt-proofsIf you initially cloned without --recurse-submodules, update submodules explicitly:
git submodule update --init --recursiveCompile and run the main() function, calling the same verify_path() function, that is used in circuit to debug
clang++ -std=c++14 -Wno-unknown-attributes -I libs/crypto3/libs/hash/include/ src/main.cpp src/cJSON.cpp
(result is in a.out, you can run it)
docker pull ghcr.io/nilfoundation/toolchain:latestRun the script from the root of your project.
scripts/run.sh --docker compileThe compile command does the following:
- Starts a Docker container based on
nilfoundation/zkllvm-template. - Makes a clean
./builddirectory and initializescmake. - Compiles the code into a circuit.
Next step is to make a compiled circuit and assignment table.
scripts/run.sh --docker run_assignerOn this step, we run the assigner, giving it the circuit in LLVM IR format (template.lls)
and the input data (./src/main-input.json).
The assigner produces the following files:
- Circuit file
./build/template.crctis the circuit in a binary format that is usable by theproof-generator. - Assignment table
./build/template.tblis a representation of input data, prepared for proof computation with this particular circuit.
scripts/run.sh --docker prove