1.0.21 • Published 4 years ago

zokrates-js-node v1.0.21

Weekly downloads
1
License
GPLv3
Repository
-
Last release
4 years ago

zokrates-js-node

JavaScript bindings for ZoKrates project.

npm install zokrates-js-node

API

FunctionDescription
initializeLoads binding wasm module and returns a promise with ZoKrates provider
compileCompiles source code into ZoKrates internal representation of arithmetic circuits
computeWitnessComputes a valid assignment of the variables, which include the results of the computation
setupGenerates a trusted setup for the compiled program
exportSolidityVerifierGenerates a Solidity contract which contains the generated verification key and a public function to verify a solution to the compiled program
generateProofGenerates a proof for a computation of the compiled program

Usage

const { initialize } = require('zokrates-js-node');

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)
});
1.0.21

4 years ago

1.0.20

4 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago