You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
arnaucube 0a162482ee wasm proof generation from browser working. Added cli wasm exporters, html&js browser example, wasm wrapper from go 5 years ago
..
utils add wasm utils: bigint-string parsers 5 years ago
.gitignore wasm proof generation from browser working. Added cli wasm exporters, html&js browser example, wasm wrapper from go 5 years ago
README.md wasm proof generation from browser working. Added cli wasm exporters, html&js browser example, wasm wrapper from go 5 years ago
go-snark-wasm-wrapper.go wasm proof generation from browser working. Added cli wasm exporters, html&js browser example, wasm wrapper from go 5 years ago
go-snark.wasm wasm proof generation from browser working. Added cli wasm exporters, html&js browser example, wasm wrapper from go 5 years ago
index.html wasm proof generation from browser working. Added cli wasm exporters, html&js browser example, wasm wrapper from go 5 years ago
index.js wasm proof generation from browser working. Added cli wasm exporters, html&js browser example, wasm wrapper from go 5 years ago
package.json wasm proof generation from browser working. Added cli wasm exporters, html&js browser example, wasm wrapper from go 5 years ago
server.js wasm proof generation from browser working. Added cli wasm exporters, html&js browser example, wasm wrapper from go 5 years ago

README.md

go-snark wasm

Warning: this is an ongoing experimentation

Wasm usage

To compile to wasm, inside the wasm directory, execute:

GOARCH=wasm GOOS=js go build -o go-snark.wasm go-snark-wasm-wrapper.go

Add the file wasm_exec.js in the directory:

cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" .

Call the library from javascript:

let r = generateProofs(
	JSON.stringify(circuit),
	JSON.stringify(setup),
	JSON.stringify(px),
	JSON.stringify(inputs),
);

Run the http server that allows to load the .wasm file:

node server.js