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 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@v1");
const prover = blueprint.createProver();

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

// Generate proof
const proof = await prover.generateProof(eml);
const { proofData, publicData } = proof.getProofData();

console.log("Proof:", proofData);
console.log("Public data:", publicData);
}

main();

Repository Templates

We have provided a GitHub template that includes working examples from this guide, including Node.js, React and Next.js implementations.

This templates allows you to get started quickly with the Blueprint SDK.