This package has been deprecated

Author message:

Package zokrates-js-node is no longer maintained. Use zokrates-js instead and check documentation for node support.

zokrates-js-node
TypeScript icon, indicating that this package has built-in type declarations

1.0.21 • Public • Published

zokrates-js-node

JavaScript bindings for ZoKrates project.

npm install zokrates-js-node

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

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

Package Sidebar

Install

npm i zokrates-js-node

Weekly Downloads

10

Version

1.0.21

License

GPLv3

Unpacked Size

3.53 MB

Total Files

11

Last publish

Collaborators

  • blockchain-it