Skip to main content

Circuit Preparation

Guidance for uploading a circuit.

Sindri Configuration File​

The sindri.json file contains key parameters and names associated with your circuit and is required with any circuit upload. There are two required fields:

  • name - the name of your circuit which you will use to request proofs after upload and compilation.
  • circuitType - the development framework used to write the circuit.
sindri.json
{
"$schema": "https://sindri.app/api/v1/sindri-manifest-schema.json",
"name": "name",
"circuitType": "framework"
}

Including the schema field provides information to editor plugins, enabling features like autocompletion and validation. Visual Studio Code, for example, is automatically configured to support JSON Schema. We strongly recommend you utilize this feature in order to ensure you have provided all the necessary fields for a specific circuitType.

Directory Organization​

The organization of your circuit code depends on the framework that it is written in. For instance, if you upload a Noir or Halo2 circuit, you should have a src/ directory where all the circuit code lies as well as a Nargo.toml or Cargo.toml, respectively. The CLI init method provides circuit scaffolds for all of the supported frameworks. These scaffolds can serve as a template as you develop or organize your circuit.

Compression​

If you upload your circuit via the Sindri frontend or via the the Create Circuit API endpoint, then you must supply a single file. This file must be either a gzipped tar archive (.tar.gz) or a zipfile (.zip) of your circuit directory. The Python SDK and CLI functions for uploading a circuit accept a path to a directory and automatically bundle your circuit for you before uploading. Feel free to skip the following section if you are using those tools.

Step 1. Navigate to the Parent Directory

Open a terminal or command prompt and navigate to the parent directory of the circuit you want to upload. The following steps assume you have a circuit directory called my_circuit/ and your current working directory is the parent directory of my_circuit/.

Step 2. Compress the Entire Directory Tree

The file name you give your tar archive is unimportant, but the extension .tar.gz is required for Sindri's API to recognize the compression type you used to prepare your circuit.

tar -zcvf my_circuit.tar.gz my_circuit/

Step 3. Verify the Contents

Check the contents of the updated archive to ensure that the important files are now at the root:

tar -tzvf my_circuit.tar.gz