Comment on page
Installation
Install zkLLVM toolchain
zkLLVM is distributed as a deb package, so you can install it using the following commands:
echo 'deb [trusted=yes] http://deb.nil.foundation/ubuntu/ all main' >>/etc/apt/sources.list
apt update
apt install -y zkllvm cmake libboost-all-dev
Clone the repository and all sub-modules
git clone --recurse-submodules [email protected]:NilFoundation/zkllvm.git
cd zkllvm
If you wish to generate IR (Intermediate representation) in binary format (*.bc). This format is not compatible with the proof market currently.
cmake -G "Unix Makefiles" -B ${ZKLLVM_BUILD:-build} -DCMAKE_BUILD_TYPE=Release .
If you wish to generate IR (Intermediate representation) in text format (*.ll). This format is compatible with the proof market.
cmake -G "Unix Makefiles" -B ${ZKLLVM_BUILD:-build} -DCMAKE_BUILD_TYPE=Release -DCIRCUIT_ASSEMBLY_OUTPUT=TRUE .
make -C ${ZKLLVM_BUILD:-build} assigner clang -j$(nproc)
This builds some samples we have in the
examples
directorymake -C ${ZKLLVM_BUILD:-build} circuit_examples -j$(nproc)
This generates an execution trace for the arithmetic example built.
${ZKLLVM_BUILD:-build}/bin/assigner/assigner -b ${ZKLLVM_BUILD:-build}/examples/arithmetics_example.bc -i examples/arithmetics.inp -t assignment.tbl -c circuit.crct
Where
Inputs:
- b: Binary representation of the circuit
- i: Public inputs for the circuit
Output:
- t: Execution trace
- c: Pre-processed constraints