1
0
Fork 0
mirror of synced 2025-09-23 04:08:33 +00:00
ZoKrates/zokrates_js
2020-04-27 19:46:48 +02:00
..
src merge dev, fix conflicts 2020-04-27 19:46:48 +02:00
tests Add dockerfile for building zokrates_js, modify ci steps 2020-01-14 02:51:29 +01:00
.dockerignore make imports public in core, remove ci steps for zokrates_js 2020-01-06 20:55:54 +01:00
.gitignore add zokrates_js crate 2019-11-21 17:17:00 +01:00
build.sh Add dockerfile for building zokrates_js, modify ci steps 2020-01-14 02:51:29 +01:00
Cargo.lock merge dev, fix conflicts 2020-04-27 19:46:48 +02:00
Cargo.toml fix imports in zokrates_js 2020-03-04 20:41:15 +01:00
Dockerfile fix Dockerfile, disable wasm-opt 2020-02-04 18:05:44 +01:00
Dockerfile.env Update Dockerfile.env 2020-02-05 15:55:31 +01:00
gulpfile.js move readme to zokrates_book, remove custom serializer on SetupKeypair, remove docker files 2019-11-22 14:53:16 +01:00
index.d.ts update naming 2020-04-27 15:12:09 +02:00
index.js minor refactor and cleanup, add tests to vk parser 2020-04-24 16:09:03 +02:00
package-lock.json upgrade node deps 2020-03-25 15:06:25 +01:00
package.json upgrade node deps 2020-03-25 15:06:25 +01:00
publish.sh Add dockerfile for building zokrates_js, modify ci steps 2020-01-14 02:51:29 +01:00
README.md Add dockerfile for building zokrates_js, modify ci steps 2020-01-14 02:51:29 +01:00
utils.js Add dockerfile for building zokrates_js, modify ci steps 2020-01-14 02:51:29 +01:00

zokrates.js

JavaScript bindings for ZoKrates project.

npm install zokrates-js

API

Function Description
initialize Loads binding wasm module and returns a promise with ZoKrates provider
compile Compiles source code into ZoKrates internal representation of arithmetic circuits
computeWitness Computes a valid assignment of the variables, which include the results of the computation
setup Generates a trusted setup for the compiled program
exportSolidityVerifier Generates a Solidity contract which contains the generated verification key and a public function to verify a solution to the compiled program
generateProof Generates a proof for a computation of the compiled program

Usage

import { initialize } from 'zokrates-js';

function importResolver(location, path) {
  // implement your resolving logic here
  return { 
    source: "def main() -> (): return", 
    location: path 
  };
}

initialize().then((zokratesProvider) => {
    // we have to initialize the wasm module before calling api functions
    zokratesProvider.compile("def main(private field a) -> (field): return a", "main", importResolver)
});