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.

22 lines
514 B

  1. # go-snark wasm
  2. *Warning: this is an ongoing experimentation*
  3. WASM wrappers for zkSNARK Pinocchio & Groth16 protocols.
  4. ## Wasm usage
  5. To compile to wasm, inside the `wasm` directory, execute:
  6. ```
  7. GOARCH=wasm GOOS=js go build -o go-snark.wasm go-snark-wasm-wrapper.go
  8. ```
  9. Add the file `wasm_exec.js` in the directory:
  10. ```
  11. cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" .
  12. ```
  13. To see the usage from javascript, check `index.js` file.
  14. Run the http server that allows to load the `.wasm` file:
  15. ```
  16. node server.js
  17. ```