antimatter15 / circom

zkSnark circuit compiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Circom 2.0 WASM

This is a proof of concept of Circom 2.0 compiled to WASM.

Getting Started

cd circom

# Compiling to WASM with rustwasmc/wasmedge
npm install -g rustwasmc
rustwasmc build --dev # fast compile, slow to run
rustwasmc build --enable-aot # slow but optimized build

# Testing out the compiled version with wasmedge
mkdir -p output
~/.wasmedge/bin/wasmedge --dir .:. pkg/circom.wasm --output output basic.circom --wasm
cd output/basic_js
node generate_witness.js basic.wasm input.json out.wtns

# Testing out the compiled version with wasmtime
wasmtime --dir . pkg/circom.wasm --output output basic.circom --wasm
cd output/basic_js
node generate_witness.js basic.wasm input.json out.wtns

# Copying
cp pkg/circom.wasm ../npm

About

zkSnark circuit compiler

License:GNU General Public License v3.0


Languages

Language:WebAssembly 37.8%Language:Rust 33.5%Language:Assembly 25.1%Language:C++ 2.7%Language:JavaScript 0.6%Language:Circom 0.3%Language:Dockerfile 0.0%Language:Makefile 0.0%