Git Product home page Git Product logo

zkevm-proverjs's Introduction

zkEVM ProverJS

zkEVM proof generator reference written in Javascript

General info

setup

$ npm install
$ npm run build

Usage

Basic usage:

$ node src/main_executor <input.json> -r <rom.json> -o <proof.json>

Example:

$ node src/main_executor tools/build-genesis/input_executor.json -r ../zkevm-rom/build/rom.json -o tmp/commit.bin

Additional parameters:

  • -t <test.json>: test
  • -l <logs.json>: logs
  • -s: skip compile pil
  • -d: debug mode
  • -p: select pilprogram.pil
  • -P: load pilConfig.json file
  • -u: unsigned transactions mode
  • -e: skip asserts newStateRoot and newLocalExitRoot
  • -v: verbose mode PIL
  • -T: enable tracer
  • -c: disable zk-counters
  • -N <number>: override number of steps
  • -V <verbose-config.json>: verbode executor & full-tracer. Loads verbose-config.json
  • -S <stats.json>: save stats to a file

Verbose configuration

  • fulltracer.enable: prints events originated in the full tracer
  • fulltracer.printOpcodes: print opcodes
  • fulltracer.filterOpcodes: string filter when printing opcodes
  • fulltracer.initFinalState: print pre/post state of touched addresses
  • fulltracer.bytecode: add bytecode to pre/post state
  • fulltracer.saveInitFinalState: save file with pre/post state
  • zkPC: print info program counter
  • batchL2Data: print info about batch L2 data
  • step: print executor step

Build setup

npm run buildsetup --build=build/v0.7.0.0-rc.1 --bctree=../zkevm-prover/build/bctree

Build prove

npm run buildall

Build prove with basic main (without SM, only for debugging)

npm run buildall --pil=pil/basic_main.pil --starkstruct=debug

Build prove with pilconfig (only for debugging)

npm run buildall --pilconfig=testvectors/pilconfig.pil --starkstruct=debug

Build options

from: syntax is --from=<step> to indicate step where start build/rebuild

npm run buildsetup --from=c12setup

continue: this option hasn't additional argument. With this option buildall detected last step well done and continues from next step.

npm run buildsetup --continue

step: syntax is --step=<step> to indicate step to execute (one step only)

npm run buildsetup --step=c12setup

steps: to show list of steps

npm run buildsetup --steps

pil: syntax is --pil=<main.pil> where main.pil was name of pil to compile. For debugging could use basic_main.pil. See --starkstruct option

npm run buildsetup --pil=pil/basic_main.pil --starkstruct=debug

pilconfig: syntax is --pilconfig=<pilconfig.json> where pilconfig.json was name of config used in pil compilation. See --starkstruct option

npm run buildall --pilconfig=testvectors/pilconfig.json --starkstruct=debug

starkstruct: syntax is --startstruct=debug to generates automatic starkstruct adapted to pil bits number. Only for debugging. This option shall used with --pil or pilconfig if number of bits change.

npm run buildall --starkstruct=debug

build: with this option could change build directory, by default build directory is build/proof.

npm run buildall --build=build/basic_proof

input: with this option indicates input file to use.

npm run buildall --input=test/myinputfile.json

bctree: syntax is --bctree=<bctree_exec> specify an external binary (executable) to generate build constanttree

npm run buildall --bctree=../zkevm-prover/build/bctree

Memory

Region (base-to) Size Content
0x000000 - 0x03FFFF 8MiB
0x040000 - 0x07FFFF 8MiB First context
0x080000 - 0x0BFFFF 8MiB Second context
: 8MiB :
Region (base-to) Size Content
CTX.base + [0x000000 - 0x00FFFF] 2MiB Context specific variables
CTX.base + [0x010000 - 0x01FFFF] 2MiB EVM Stack
CTX.base + [0x020000 - 0x03FFFF] 4MiB EVM Memory

zkevm-proverjs's People

Contributors

zkronos73 avatar krlosmata avatar jbaylina avatar ignasirv avatar agnusmor avatar invocamanman avatar laisolizq avatar eduadiez avatar fractasy avatar marcguzmanalbiol avatar rogertaule avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.