Skip to main content

Quick Start With Sindri

Create your first circuit and proof with Sindri in minutes

🧃 A Brief Introduction

You're probably wondering what Sindri is and how it can help you. It's pretty simple: we make ZK development and deployment easy, fast, and secure through the Sindri API. We understand every line of code is precious, and we want to make sure you're spending your time on the things that matter most. If that sounds like something you're interested in, you're in the right place.

Let's walk through an easy-to-follow-along workflow where we'll compile a circuit and spin up a proof in just a few minutes. If you've ever used a service like DockerHub or Heroku, this should feel familiar. Let's not waste any more time and get to it.

info

Before getting started, you to need create a Sindri account.


🚧 Dependencies

  • Node.js You'll want v18.13.0 or later.
  • Sindri CLI Don't worry about installing this, it's covered below!

🥋 Becoming a ZK Ninja with Sindri

  1. Authenticate and log in with the Sindri CLI.

First things first: let's run the latest CLI and log in with our credentials.

npx sindri@latest login
## Returns the below callback:
Username: {your-username}
Password: ****************************
New API Key Name: my-laptop-sdk
Select a Team: my-team-name
[12:49:18.420] INFO: You have successfully authorized the client with your Sindri account.
  1. Download some helper files and artifacts.

Clone the Sindri Resources repo where you can find a ton of great resources for template development with Sindri.

git clone https://github.com/Sindri-Labs/sindri-resources.git
  1. Navigate to the Circom multiplier directory.

For now, we'll be focused on the multiplier2 circuit... because who doesn't love a good multiplier? 🤷‍♂️

cd sindri-resources/circuit_database/circom/multiplier2
  1. Name your circuit.

Open sindri.json (this is where a bunch of cool settings live). In the name field, provide a more unique name than multiplier2 - life is too short for bad circuit names! 🔫

sindri-resources/circuit_database/circom/multiplier2/sindri.json
{
"$schema": "https://sindri.app/api/v1/sindri-manifest-schema.json",
"name": "multiplier2", ## Change this to your spirit animal
"circuitType": "circom",
"curve": "bn254",
"provingScheme": "groth16",
"witnessCompiler": "c++"
}
  1. Compile and deploy.

Now, it's time to compile your circuit and deploy it to Sindri! Be sure you're in the multiplier2 directory. Run the command below:

sindri-resources/circuit_database/circom/multiplier2
npx sindri@latest deploy
  1. You just compiled your first circuit!

Feel that? You compiled your first circuit! 🙌

npx sindri@latest deploy
### Generates the output below:
[12:49:58.056] INFO: Creating "{your-circuit-name}.tar.gz" package with 5 files.
[12:49:58.063] INFO: Circuit compilation initiated.
[12:50:22.879] INFO: Circuit compiled successfully after 23.8 seconds.
  1. Generate your proof.

Run sindri proof create and take it in. You have just run your first proof run on Sindri. Tweet it. Print it out. Frame it. Verify it. Do whatever you'd like because that proof is yours! 🚀

sindri-resources/circuit_database/circom/multiplier2
# Create a new proof for the inputs in `input.json`.
npx sindri@latest proof create --input input.json
### Generates the output below:
[12:51:15.345] INFO: Proof generated successfully after 2.9 seconds.
{ ... proof data ... }

Looking for More?

Here are some commonly accessed pages: