Snarkify SDK
The Snarkify SDK is a Rust library designed to simplify the creation and deployment of ZKP provers as serverless services to Snarkify Trustless Cloud.
Installation
To include the Snarkify SDK in your project, add the following line to your Cargo.toml under [dependencies]:
= "0.1.0"
or simply run
cargo add snarkify-sdk
Quick Start
Code changes
- Create a new file
snarkify.rsin yoursrc/bindirectory - Implement the
ProofHandlertrait andprovemethod for proof creation - Invoke
snarkify_sdk::run::<{YourProofHandler}>()in the main function
Here's a basic example illustrating how to use the SDK:
use io;
use async_trait;
use ;
use ProofHandler;
;
Running & Testing
As an example, to run the prover basic_prover in examples directory, simply run
cargo run --example basic_prover
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"
}'