Noir Compilation Pipeline

Verify a Noir/Barretenberg circuit verifier already deployed on chain

If the packageDir argument is ommitted, the current directory will be used.

Small differences in the Solidity sources are allowed:

  • Contract name

  • pragma solidity version differences

  • Comment differences

  • Whitespace differences

  • verificationKeyHash view function return value

Usage: circuitscan verify:noir [options] <chainId> <verifierContractAddress> [packageDir]

Verify verifier contracts by their noir sources. Can also specify chain by name.

Options:
  -v, --nargo-version <version>  Specify nargo version
  -i, --instance <memorySize>    Specify the memory (GB) of compiler instance: 4, 8, 16, 32, 64, 128, 256, 384, 512 (default: 4 for smallest circuits)
  -r, --resume <requestId>       In case of errors during compilation, reattach to a job and attempt a new deploy. Overrides all other options.
  -c, --config <configUrl>       Specify a different configuration file (default: https://circuitscan.org/cli.json)
  -a, --api-key <apiKey>         Specify your API Key as a command line argument
  -h, --help                     display help for command

Compile a Noir circuit and deploy its circuit verifier on chain

Alternatively, the CLI can be used to compile and deploy the circuit verifier directly from source, ensuring that the verification happens smoothly.

Note

The DEPLOYER_PRIVATE_KEY environment variable and chainId argument must be set to use the deploy command unless the -b or --browser-wallet argument is used.

If the packageDir argument is ommitted, the current directory will be used.

Usage: circuitscan deploy:noir [options] <chainId> [packageDir]

 Deploy verifier contracts by their noir sources. Can also specify chain by name.

 Options:
   -v, --nargo-version <version>  Specify nargo version
   -i, --instance <memorySize>    Specify the memory (GB) of compiler instance: 4, 8, 16, 32, 64, 128, 256, 384, 512 (default: 4 for smallest circuits)
   -r, --resume <requestId>       In case of errors during compilation, reattach to a job and attempt a new deploy. Overrides all other options.
   -c, --config <configUrl>       Specify a different configuration file (default: https://circuitscan.org/cli.json)
   -a, --api-key <apiKey>         Specify your API Key as a command line argument
   -b, --browser-wallet           Send transaction in browser instead of by passing private key env var (overrides chainId argument)
   -h, --help                     display help for command

Command Line Arguments

-v, --nargo-version

Pass the version of Nargo to use. The corresponding Barretenberg version will also be used.

Allowed values: (Barretenberg version)

  • 0.34.0 (0.55.0)

  • 0.33.0 (0.47.1) (Default)

  • 0.32.0 (0.46.1)

  • 0.31.0 (0.41.0)

-i, --instance

Compilations are performed on a cloud machine with the specified number of GB of memory.

Please use the smallest value necessary to compile your circuits. Abuse of large instances will result in your account being banned.

Allowed values: 4, 8, 16, 32, 64, 128, 256, 384, 512

If ommitted, the smallest instance size is used: 4 GB.

-r, --resume

Some circuits take a long time to compile and it may not be feasible to have your local machine connected and waiting for the entire duration.

By taking note of the request ID output at the start of a deploy or verify command, you can close out of the process at any time before compilation completes and restart the process later.

In addition to helping with long running jobs or spotty internet connections, this allows verifying the same circuit verifier it accross multiple deployments without waiting for another compilation.

This argument may also be used to re-use a compilation output if the wrong chain/contract address is passed without waiting to compile again.

Request IDs are stored in ~/.circuitscan-history for easy recovery from errors.

-c, --config

This argument is only used when connecting your CLI to a different (e.g. self-hosted) instance of Circuitscan.

There is no reason to use this argument when verifying or deploying circuits to circuitscan.org.

-a, --api-key

Overrides API key settings from either the CIRCUITSCAN_API_KEY environment variable, or the ~/.circuitscan JSON user configuration.

-b, --browser-wallet

For the deploy:noir command, this argument may be used instead of specifying the DEPLOYER_PRIVATE_KEY environment variable.

A link will be provided after the circuit compiles where you will be able to connect your wallet and deploy the verifier contract.

After your contract is deployed, the verification process will continue in your terminal.

This is a recommended option for desktop use of the Circuitscan CLI. If using in a CI/CD environment, the environment variable provides headless operation.

Verification Errors

invalid_diff

The generated Solidity verifier contract does not match the source code retrieved from the block explorer

Find the generated source at https://circuitscan-artifacts.s3.us-west-2.amazonaws.com/build/<build-name-adjective-animal>/verifier.sol

contract_not_verified

The contract at this address on the specified is not verified on Sourcify/Blockscout/Etherscan.

Please submit the source to Sourcify.dev