iden3 / snarkjs

zkSNARK implementation in JavaScript & WASM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when running snarkjs groth16 setup: ENOENT: no such file or directory, open 'proving_key.json'

bluabaleno opened this issue · comments

I'm encountering an issue when trying to run the snarkjs groth16 setup command. The command I'm running is:

snarkjs groth16 setup circuits/simple.r1cs proving_key.json verification_key.json

The error message I'm getting is:

[ERROR] snarkJS: [Error: ENOENT: no such file or directory, open 'proving_key.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'proving_key.json'
}

This is puzzling because the snarkjs groth16 setup command should be creating the proving_key.json file, not attempting to open it.

Here are the relevant details about my environment:

  • snarkjs version: 0.7.0
  • Node.js version: v18.12.1
  • Operating system: macOS with an Apple M1 chip

I've tried the following steps to troubleshoot the issue:

  1. Checked that my current directory is writable.
  2. Uninstalled and reinstalled snarkjs with npm uninstall -g snarkjs and npm install -g snarkjs.
  3. Tried running the command with sudo.
  4. Tried running the Terminal using Rosetta.

None of these steps have resolved the issue. Any help would be greatly appreciated.

You are using the setup command, which has this syntax: groth16 setup [circuit.r1cs] [powersoftau.ptau] [circuit_0000.zkey]

You are probably looking for a different command.