Quickstart

Igniting Your First Verifiable Agent

This guide provides a detailed, step-by-step walkthrough to set up a foundational development environment and run your first verifiable AI agent on the Raze Protocol.

Prerequisites:

  • Node.js 18+

  • Python 3.8+ with pip

  • Rust & Cargo (required for

    ezkl)

  • An OpenAI API key


Step 1: Install Dependencies 🛠️

First, ensure all necessary tools are installed on your system.

Bash

# Install Rust, a prerequisite for the ezkl framework
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Reload your environment to make cargo (Rust's package manager) available
source $HOME/.cargo/env

# Install Python dependencies for the ZKML model, including PyTorch and ONNX
pip install torch onnx

# Install ezkl with Python bindings
cargo install ezkl --features python-bindings

Step 2: Create Your ZKML Model 🧠

Navigate to your

models directory and execute the script to create the neural network model and test data.

Bash

This process generates

voting_model.onnx, a simple neural network model that classifies governance proposals, and accompanying sample input data.


Step 3: Set Up the ZK Circuit 🔐

This is the most critical step, where the AI model is transformed into a cryptographic circuit. Run the provided setup script to compile the ONNX model into a ZK circuit, generate the necessary proving and verifying keys, and create the on-chain verifier smart contract.

Bash

This process generates the following essential files:

network.ezkl (the compiled ZK circuit), proving.key and verifying.key (for proof generation and verification), and Verifier.sol (the Solidity smart contract for on-chain proof validation).


Step 4: Deploy and Test 🚀

Start a local blockchain and run the end-to-end integration test to see the entire Raze Protocol in action.

Bash

You have now successfully completed an end-to-end flow: an AI agent's decision was transformed into a verifiable ZK proof, and that proof was successfully validated by a smart contract on a local blockchain. Congratulations! You are now ready to build on the Raze Protocol.

Last updated