{"id":31022652,"url":"https://github.com/tokamak-network/deprecated-zvm","last_synced_at":"2026-03-03T16:42:51.620Z","repository":{"id":41270787,"uuid":"303630555","full_name":"tokamak-network/DEPRECATED-zvm","owner":"tokamak-network","description":"Zero Knowledge based Ethereum Virtual Machine in Circom language","archived":false,"fork":false,"pushed_at":"2025-06-03T10:04:42.000Z","size":123,"stargazers_count":17,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-16T04:30:04.919Z","etag":null,"topics":["circom","evm","zero-knowledge"],"latest_commit_sha":null,"homepage":"","language":"Circom","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tokamak-network.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-10-13T08:00:38.000Z","updated_at":"2025-06-03T10:04:43.000Z","dependencies_parsed_at":"2025-06-08T02:46:59.003Z","dependency_job_id":null,"html_url":"https://github.com/tokamak-network/DEPRECATED-zvm","commit_stats":null,"previous_names":["onther-tech/zvm","tokamak-network/deprecated-zvm","tokamak-network/zvm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tokamak-network/DEPRECATED-zvm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokamak-network%2FDEPRECATED-zvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokamak-network%2FDEPRECATED-zvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokamak-network%2FDEPRECATED-zvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokamak-network%2FDEPRECATED-zvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tokamak-network","download_url":"https://codeload.github.com/tokamak-network/DEPRECATED-zvm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokamak-network%2FDEPRECATED-zvm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274956865,"owners_count":25380806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circom","evm","zero-knowledge"],"created_at":"2025-09-13T12:05:12.510Z","updated_at":"2026-03-03T16:42:51.576Z","avatar_url":"https://github.com/tokamak-network.png","language":"Circom","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Disclaimer\nThis repository is outdated. It has been found that some Circom circuits are under-constrained, by [Hideaki Takahashi](https://github.com/Koukyosyumei). The circuits may be vulnerable to forging witness. There is no plan to update this repository.\n\n\n# zvm\nZero Knowledge based Ethereum Virtual Machine in Circom language\n\n## Dependencies\nYou need node v14, [snarkjs](https://github.com/iden3/snarkjs) and [circom](https://github.com/iden3/circom).\n\nYou can easily install snarkjs and circom by entering the following commands after node v14 is successfully installed.\n```\nnpm install -g circom@latest\nnpm install -g snarkjs@latest\n```\n## Status\nzvm is currently under busy construction. The circuit supports the EVM opcodes, the stack size upto eight (unsigned integers), memory size upto eight (unsigned integers) and sixteen input signals of array which represent the bytecodes of EVM.\n\n### Completion\nThe checked opcodes have been implemented.\n- [x] 0x00\tSTOP; Halts execution\n- [x] 0x01\tADD; Addition operation\n- [x] 0x02\tMUL; Multiplication operation\n- [x] 0x03\tSUB; Subtraction operation\n- [x] 0x04\tDIV; Integer division operation\n- [ ] 0x05  SDIV; Signed integer division operation (truncated)\n- [x] 0x06  MOD; Modulo remainder operation\n- [ ] 0x07  SMOD; Signed modulo remainder operation\n- [x] 0x08  ADDMOD; Modulo addition operation\n- [x] 0x09  MULMOD; Modulo multiplication operation\n- [x] 0x0a  EXP; Exponential operation\n- [ ] 0x0b  SIGNEXTEND; Extend length of two's complement signed integer\n- [x] 0x0c  GCD; Greatest common divisor operation - Only referenced in simple-vm\n- [x] 0x0d  LCM; Least common multiple operation - Only referenced in simple-vm\n- [x] 0x0e  COMBINATION; Combination operation (nCr) - Only referenced in simple-vm\n- [x] 0x0f  FACTORIAL; Factorial operation (n!) - Only referenced in simple-vm\n\n- [x] 0x10  LT; Less-than comparison\n- [x] 0x11  GT;\tGreater-than comparison\n- [ ] 0x12\tSLT; Signed less-than comparison\n- [ ] 0x13\tSGT; Signed greater-than comparison\n- [x] 0x14\tEQ;\tEquality comparison\n- [x] 0x15\tISZERO;\tSimple not operator\n- [x] 0x16\tAND; Bitwise AND operation\n- [x] 0x17\tOR; Bitwise OR operation\n- [x] 0x18\tXOR; Bitwise XOR operation\n- [x] 0x19\tNOT; Bitwise NOT operation\n- [x] 0x1a  BYTE; Retrieve single byte from word\n- [x] 0x1b\tSHL; Shift Left\n- [x] 0x1c\tSHR; Logical Shift Right\n- [x] 0x1d\tSAR; Arithmetic Shift Right\n\n- [ ] 0x20\tKECCAK256; Compute Keccak-256 hash\n\n- [ ] 0x30\tADDRESS; Get address of currently executing account\n- [ ] 0x31\tBALANCE; Get balance of the given account\n- [ ] 0x32\tORIGIN;\tGet execution origination address\n- [ ] 0x33\tCALLER; Get caller address \n- [ ] 0x34\tCALLVALUE; Get deposited value by the instruction/transaction responsible for this execution \n- [ ] 0x35\tCALLDATALOAD; Get input data of current environment\n- [ ] 0x36\tCALLDATASIZE; Get size of input data in current environment\n- [ ] 0x37\tCALLDATACOPY; Copy input data in current environment to memory\n- [ ] 0x38\tCODESIZE; Get size of code running in current environment \n- [ ] 0x39\tCODECOPY; Copy code running in current environment to memory\n- [ ] 0x3a\tGASPRICE; Get price of gas in current environment \n- [ ] 0x3b\tEXTCODESIZE; Get size of an account's code\n- [ ] 0x3c\tEXTCODECOPY; Copy an account's code to memory\n- [ ] 0x3d\tRETURNDATASIZE; Pushes the size of the return data buffer onto the stack\n- [ ] 0x3e\tRETURNDATACOPY; Copies data from the return data buffer to memory\n- [ ] 0x3f\tEXTCODEHASH; Returns the keccak256 hash of a contract's code\n\n- [ ] 0x40\tBLOCKHASH; Get the hash of one of the 256 most recent complete blocks 0\n- [ ] 0x41\tCOINBASE; Get the block's beneficiary address \n- [ ] 0x42\tTIMESTAMP; Get the block's timestamp \n- [ ] 0x43\tNUMBER; Get the block's number \n- [ ] 0x44\tDIFFICULTY; Get the block's difficulty \n- [ ] 0x45\tGASLIMIT; Get the block's gas limit \n- [ ] 0x46\tCHAINID; Returns the current chain’s EIP-155 unique identifier\n\n- [x] 0x50\tPOP; Remove an item from stack \n- [x] 0x51\tMLOAD; Load an item from memory\n- [x] 0x52\tMSTORE; Save an item to memory\n- [ ] 0x53\tMSTORE8; Save byte to memory \n- [ ] 0x54\tSLOAD; Load word from storage\n- [ ] 0x55\tSSTORE; Save word to storage\n- [x] 0x56\tJUMP; Alter the program counter\n- [x] 0x57\tJUMPI; Conditionally alter the program counter\n- [x] 0x58\tGETPC; Get the value of the program counter prior to the increment \n- [x] 0x59\tMSIZE; Get the size of active memory in bytes \n- [ ] 0x5a\tGAS; Get the amount of available gas, including the corresponding reduction the amount of available gas\n- [x] 0x5b\tJUMPDEST; Mark a valid destination for jumps\n\n- [x] 0x60 PUSH; Place one uint item on stack ([NOTE] Not n-byte item)\n\n- [x] 0x80\tDUP1; Duplicate 1st stack item \n- [x] 0x81\tDUP2; Duplicate 2nd stack item \n- [x] 0x82\tDUP3; Duplicate 3rd stack item \n- [x] 0x83\tDUP4; Duplicate 4th stack item \n- [x] 0x84\tDUP5; Duplicate 5th stack item \n- [x] 0x85\tDUP6; Duplicate 6th stack item \n- [x] 0x86\tDUP7; Duplicate 7th stack item \n- [x] 0x87\tDUP8; Duplicate 8th stack item \n- [x] 0x88\tDUP9; Duplicate 9th stack item \n- [x] 0x89\tDUP10; Duplicate 10th stack item \n- [x] 0x8a\tDUP11; Duplicate 11th stack item \n- [x] 0x8b\tDUP12; Duplicate 12th stack item \n- [x] 0x8c\tDUP13; Duplicate 13th stack item \n- [x] 0x8d\tDUP14; Duplicate 14th stack item \n- [x] 0x8e\tDUP15; Duplicate 15th stack item \n- [x] 0x8f\tDUP16; Duplicate 16th stack item \n\n- [x] 0x90  SWAP1; Exchange 1st and 2nd stack items\n- [x] 0x91  SWAP2; Exchange 1st and 3rd stack items\n- [x] 0x92  SWAP3; Exchange 1st and 4th stack items\n- [x] 0x93  SWAP4; Exchange 1st and 5th stack items\n- [x] 0x94  SWAP5; Exchange 1st and 6th stack items\n- [x] 0x95  SWAP6; Exchange 1st and 7th stack items\n- [x] 0x96  SWAP7; Exchange 1st and 8th stack items\n- [x] 0x97  SWAP8; Exchange 1st and 9th stack items\n- [x] 0x98  SWAP9; Exchange 1st and 10th stack items\n- [x] 0x99  SWAP10; Exchange 1st and 11th stack items\n- [x] 0x9a  SWAP11; Exchange 1st and 12th stack items\n- [x] 0x9b  SWAP12; Exchange 1st and 13th stack items\n- [x] 0x9c  SWAP13; Exchange 1st and 14th stack items\n- [x] 0x9d  SWAP14; Exchange 1st and 15th stack items\n- [x] 0x9e  SWAP15; Exchange 1st and 16th stack items\n- [x] 0x9f  SWAP16; Exchange 1st and 17th stack items\n\n- [ ] 0xa0\tLOG0; Append log record with no topics\n- [ ] 0xa1\tLOG1; Append log record with one topic\n- [ ] 0xa2\tLOG2; Append log record with two topics\n- [ ] 0xa3\tLOG3; Append log record with three topics\n- [ ] 0xa4\tLOG4; Append log record with four topics\n\n- [ ] 0xb0\tJUMPTO; Tentative libevmasm has different numbers\n- [ ] 0xb1\tJUMPIF; Tentative \n- [ ] 0xb2\tJUMPSUB; Tentative \n- [ ] 0xb4\tJUMPSUBV; Tentative \n- [ ] 0xb5\tBEGINSUB; Tentative \n- [ ] 0xb6\tBEGINDATA; Tentative \n- [ ] 0xb8\tRETURNSUB; Tentative \n- [ ] 0xb9\tPUTLOCAL; Tentative \n- [ ] 0xba\tGETLOCAL; Tentative \n\n- [ ] 0xf0\tCREATE;\tCreate a new account with associated code\n- [ ] 0xf1\tCALL; Message-call into an account\n- [ ] 0xf2\tCALLCODE; Message-call into this account with alternative account's code\n- [ ] 0xf3\tRETURN;\tHalt execution returning output data\n- [ ] 0xf4\tDELEGATECALL; Message-call into this account with an alternative account's code, but persisting into this account with an alternative account's code\n- [ ] 0xf5\tCREATE2; Create a new account and set creation address to sha3(sender + sha3(init code)) % 2**160\n- [ ] 0xfa\tSTATICCALL;\tSimilar to CALL, but does not modify state\n- [ ] 0xfc\tTXEXECGAS; Not in yellow paper FIXME\n- [ ] 0xfd\tREVERT; Stop execution and revert state changes, without consuming all provided gas and providing a reason\n- [ ] 0xfe\tINVALID; Designated invalid instruction\n- [ ] 0xff\tSELFDESTRUCT; Halt execution and register account for later deletion\n\n\n# Quick Start\nYou can simply do following things with [zvm.sh](https://github.com/Onther-Tech/zvm/blob/main/src/zvm.sh)\n\n1. Building trusted setups\n2. Compile Circom circuits\n3. Debug\n4. Generate and verify a proof\n\n```\n$ cd src\n$ ./zvm.sh\nCommands\n1. Setup phase 1:          $ ./zvm.sh phase1\n2. Setup phase 2:          $ ./zvm.sh phase2 [circuit name]\n3. Debug with the witness: $ ./zvm.sh debug [circuit name] [input json file path]\n4. Generate a proof:       $ ./zvm.sh generate-proof [proof file name] [public file name]\n5. Verify a proof:         $ ./zvm.sh verify-proof [proof file path] [public file path] \n```\n\nPlease check [snarkjs](https://github.com/iden3/snarkjs/blob/master/README.md) and [circom](https://github.com/iden3/circom/blob/master/README.md) if you need how it works.\n\n# Tutorial\nThis tutorial leads you how to play with [zvm circuit](https://github.com/Onther-Tech/zvm/blob/main/src/circuits/vm.circom).\n\n## Phase 1: General setup\nIn this phase, you start a new powers of tau ceremony, contribute to the ceremony and apply a random beacon.\n```\n$ cd src\n$ ./zvm.sh phase1\n\n... \n\n[DEBUG] snarkJS: betaTauG1: fft 12 join  12/12  1/1 0/2\n[DEBUG] snarkJS: betaTauG1: fft 12 join  12/12  1/1 1/2\n```\n[NOTE] You can customize the randomness on this step by modifying the script.\n\n## Phase 2: Circuit specific setup\nYou compile a circuit, generate the reference *zkey* and contribute to the phase 2 ceremony, similar to the previous step. \nFinally, you export the verification key which is used for verifying a proof.\n```\n$ ./zvm.sh phase2 vm\n\n... \n\n[INFO]  snarkJS: ZKey Ok!\n```\n\n## Debug: Calculate a witness and debug the circuit\nYou execute the circuit with your input file and get debugging result.\n\n```\n$ cat vm-input.json\n{\"code\": [\"0x60\",\"0x2\",\"0x60\",\"0x6\",\"0x1\",\"0x0\",\"0x0\",\"0x0\",\"0x0\",\"0x0\",\"0x0\",\"0x0\",\"0x0\",\"0x0\",\"0x0\",\"0x0\"]}\n```\n* *code* array represents bytecodes that EVM takes.\nFor example, *vm-input.json* describes the following instructions.\n```\nPUSH 0x2\nPUSH 0x6\nADD\nSTOP\n```\n* You can read the details of circuit input [here](https://github.com/Onther-Tech/zvm/blob/main/INPUT.md)\n```\n$ ./zvm.sh debug vm vm-input.json\n\n...\n\n[INFO]  snarkJS: START: main\n[INFO]  snarkJS: GET main.code[0] --\u003e 96\n[INFO]  snarkJS: GET main.code[1] --\u003e 2\n[INFO]  snarkJS: GET main.code[2] --\u003e 96\n[INFO]  snarkJS: GET main.code[3] --\u003e 6\n[INFO]  snarkJS: GET main.code[4] --\u003e 1\n[INFO]  snarkJS: GET main.code[5] --\u003e 0\n[INFO]  snarkJS: FINISH: main\n```\n\n## Generate a proof\nYou generate a proof using the calculated witness.\n```\n$ ./zvm.sh generate-proof proof public\n```\n\n## Verify the proof\nYou verify the proof and it prints the verification result.\n``` \n$ ./zvm.sh verify-proof proof.json public.json\n[INFO]  snarkJS: OK!\n```\n\n### Please create an issue if you have any questions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokamak-network%2Fdeprecated-zvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftokamak-network%2Fdeprecated-zvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokamak-network%2Fdeprecated-zvm/lists"}