Eddsa proof
A library to generate and verify EdDSA proofs.
The Snark artifacts (.wasm and .zkey files) can be specified or not in the generate function parameters and can possibly be downloaded using the following URLs:
[!WARNING]
The Snark artifacts currently used to generate zero-knowledge proofs are the result of an insecure trusted setup, and the library has not yet been audited. Therefore, it is advised not to use it in production.
đ Install
npm or yarn
Install the @zk-kit/eddsa-proof package:
npm i @zk-kit/eddsa-proof
or yarn:
yarn add @zk-kit/eddsa-proof
đ Usage
import { generate, verify } from "@zk-kit/eddsa-proof"
const privateKey = 1
const scope = 2
const fullProof = await generate(privateKey, scope)
console.log(fullProof)
const response = await verify(fullProof)
console.log(response)
đ Benchmarks
Benchmarks were run on a MacBook Pro, Apple M2 Pro, 16 GB RAM machine, after initializing the BN128 curve with @zk-kit/groth16-buildBn128 (~230ms).
import { generate, verify } from "@zk-kit/eddsa-proof"
import { buildBn128 } from "@zk-kit/groth16"
await buildBn128()
console.time("generate")
const proof = await generate(1, 2)
console.timeEnd("generate")
console.time("verify")
console.log(await verify(proof))
console.timeEnd("verify")