Skip to main content

Setup

The Blueprint SDK provides a simple way to generate and verify zero-knowledge proofs from emails.

Installation

To get started with the SDK, the first step is to install it using your preferred package manager:

npm install @zk-email/sdk

Usage

Download Sample Email

You can download a sample email file to test the SDK:

Generate Proof

import zkeSDK, { Proof } from "@zk-email/sdk";
import fs from "fs/promises";

async function main() {
const sdk = zkeSDK();

// Get blueprint from the registry
const blueprint = await sdk.getBlueprint("Bisht13/SuccinctZKResidencyInvite@v3");
const prover = blueprint.createProver();

// Read email file
const eml = await fs.readFile("residency.EML", "utf-8");

// Generate the proof
const proof = await prover.generateProof(eml);
setProof(proof);

// Verify the proof on chain
const verification = await blueprint.verifyProofOnChain(proof);

// Verify the proof off chain
const verification = await blueprint.verifyProof(proof);

console.log("Verification:", verification);
}

main();

Repository Templates

We have provided a GitHub repo with working examples from this guide, showcasing different implementations, including Node.js, Next.js, Vite with Vanilla JS, and Deno.

These templates help you get started quickly with the Blueprint SDK.