Snarkify
  • 🏗️GPU Prover Network
    • Introduction
    • Deploy a Elastic Prover
      • Integrate Elastic Prover SDK
    • Snakrify CLI
      • Installation
      • Authentication
      • Service Initialization
      • Build & Deployment
      • Proof Generation
      • Team Management
      • GPU Shell Management
    • Advanced Topics
      • Webhook
  • 🏚️High-Performance ZKP
    • zkEVM Halo2 GPU Prover
      • MSM
      • NTT
      • Quotient Polynomial Evaluation
      • KZG Multiopen
      • Polynomial Inversion
      • Permutation Generation
    • ZPrize
  • 🐺Sirius Folding
    • Introduction
    • Quickstart
    • Examples
      • Fold a Summation Circuit
      • Fold a Fibonacci Circuit
      • Fold a Halo2 Circuit
      • Fold the zkevm-circuits
    • Terminologies
    • Sirius Folding APIs
      • `StepCircuit` trait
      • `PublicParams` Struct
      • `IVC` struct
  • LInks
    • Github
    • Telegram Group
    • snarkify.io
Powered by GitBook
On this page
  • Introduction
  • Installation
  • Implement your prover
  • Testing locally
  1. GPU Prover Network
  2. Deploy a Elastic Prover

Integrate Elastic Prover SDK

Introduction

The Snarkify Elastic Prover SDK is a Rust-based library that offers a comprehensive interface for engaging with the Snarkify Network. It allows for the swift conversion of your existing circuit code into a deployable prover. With the SDK's streamlined process, you can easily tap into the capabilities of Snarkify Network using just a handful of straightforward steps.

Installation

cargo add snarkify-sdk async-trait serde

Implement your prover

  1. Create a new file snarkify.rs in your src/bin directory

  2. Implement the ProofHandler trait and prove method for proof creation

  3. Invoke snarkify_sdk::run::<{YourProofHandler}>() in the main function

Here's a snippet of code illustrating how to use the SDK:

use async_trait::async_trait;
use serde::{Deserialize, Serialize};
use snarkify_sdk::prover::ProofHandler;
use std::io;

struct MyProofHandler;

#[derive(Deserialize)]
struct MyInput {
    public_input: String,
}

#[derive(Serialize)]
struct MyOutput {
    proof: String,
}

#[async_trait]
impl ProofHandler for MyProofHandler {
    type Input = MyInput;
    type Output = MyOutput;
    type Error = ();

    async fn prove(data: Self::Input) -> Result<Self::Output, Self::Error> {
        Ok(MyOutput {
            proof: data.public_input.chars().rev().collect(),
        })
    }
}

fn main() -> Result<(), io::Error> {
    snarkify_sdk::run::<MyProofHandler>()
}

Testing locally

To run your prover locally, simply run,

cargo run --bin snarkify

and you can test the prover locally with a sample request like

curl --location --request POST 'http://localhost:8080' \
--header 'Content-Type: application/json' \
--header 'ce-specversion: 1.0' \
--header 'ce-id: abcdef123456' \
--header 'ce-source: test' \
--header 'ce-type: com.test.example' \
--data-raw '{
     "public_input": "aloha"
 }'

PreviousDeploy a Elastic ProverNextSnakrify CLI

Last updated 4 months ago

Please also checkout this for a ready-to-deploy example of Poseidon hash prover.

🏗️
library