Skip to main content

Getting Started with the Sindri Rust SDK

🦀 Give your ZK App a performance boost with the Sindri Rust SDK 🦀

The Sindri Rust SDK provides a powerful development experience for building ZK applications. Through its DSL and zkVM package integrations, developers can iterate on circuit code in its native language locally while leveraging Sindri's performant proving backend. This seamless integration allows for smooth transitions from development to production environments using the same technology stack. This guide will demonstrate usage of the Sindri rust client and provide functional prototypes which you can build on.

Prerequisites

👤 Account Creation

A Sindri account is required to interact with the API. You can create an account if you don't already have one. After signing up, create an API key here.

📦 Installation

info

Sindri's rust SDK and CLI are published on the latest stable rust toolchain. If you do not have rust installed, you can download it here. If you encounter any errors suggesting an outdated rust toolchain (e.g. problems recognizing a lock file version), you can update your rust version via rustup update.

Throughout this guide, we will be cloning prebuilt projects to speed up development. In order to download projects, we will need to install the Sindri rust CLI:

cargo install sindri-cli --force --locked

No matter which path you choose below, you will need to provide your Sindri API key as an environment variable. So before moving on, make sure you save your key in your terminal:

export SINDRI_API_KEY=your-key-here

Choose Your Path

Ready to start building? Choose the path that best fits your project:

🚀 Deploy Your Existing Project

Already have a ZK codebase? Learn how to seamlessly integrate Sindri's proving infrastructure into your existing workflow.

In this example, we run through the entire end-to-end process of project compilation and proof generation within a few lines of code. All you need to do is:

cargo sindri clone sindri-rust/basic-demo
cd basic-demo
cargo run --release

After you are done, make sure to check out the code in src/main.rs. This gives you a prototype for how to use the Sindri client in your own project.

🔍 Project Preview

💻 Develop with zkVMs

Write and test zkVM guest code while building end-to-end proving workflows. Perfect for creating efficient, scalable zero-knowledge applications.

In this example, you will validate emails in parallel inside a prebuilt zkVM application! Once those proofs come back, your program will perform local proof verification. In order to play the demo, run:

cargo sindri clone sindri-rust/zkvm-demo
cd zkvm-demo/script
cargo run --release

Once you have run through the script, check out script/src/main.rs for more details on how to multithread your proof requests.

🔍 Project Preview

⛓️ Build Full Stack Web3 Apps

Create complete Web3 applications with on-chain verification. Learn how to integrate your ZK proofs directly into smart contracts.
info

You will need to have Foundry installed. For general use cases, the quickest installation route is: curl -L https://foundry.paradigm.xyz | bash

In this example, you will play a game of Sudoku with the result of your game certified on a local devnet. (If you aren't here for the free sudoku, just press c to skip to proof generation and on-chain verification.) To download the project and launch the game, run:

cargo sindri clone sindri-rust/web3-demo
cd web3-demo
cargo run --release

After playing your first game, look at src/main.rs for a sindri + alloy template to base your ZK-Dapp off of.

🔍 Project Preview

Next Steps

To better understand what's possible, you can find complete reference information in the crates listings for sindri and sindri-cli. You can also browse the rest of the Sindri documentation to learn more about writing circuits, the frameworks we support, and other ways to interact with the Sindri API.