@zkproofport/sdk
v0.3.1
Published
Privacy-preserving proof SDK for zkProofport
Readme
ZKProofport SDK
Privacy-preserving proof SDK for verifying on-chain facts and identity without exposing wallet addresses. Supports both EVM chains (Base) and Solana.
Features
- Complete Privacy: User's wallet address is never exposed to the dApp
- Multi-Chain: Supports Base (EVM) and Solana verification
- Browser-Based: Works in any web environment, no installation required
- Simple Integration: Abstracts away complex ZK logic
- Extensible: Request different proofs by changing
circuitId
Installation
npm install @zkproofport/sdk
# or
yarn add @zkproofport/sdkQuick Start
Base (EVM) Verification
import { openProofPortal, verifyProof } from "@zkproofport/sdk";
import { JsonRpcProvider } from "ethers";
const provider = new JsonRpcProvider("https://mainnet.base.org");
async function verifyUser() {
// 1. Open portal and get proof
const proofData = await openProofPortal({
circuitId: "coinbase_kyc"
});
// 2. Verify the proof
const result = await verifyProof({
...proofData,
mode: "onchain", // or "offchain"
provider,
});
if (result.success) {
console.log("User verified!");
}
}Solana Verification
import { openProofPortal, verifySolanaProofSimulate } from "@zkproofport/sdk";
async function verifySolanaUser() {
// 1. Open portal and get proof (Solana circuit)
const proofData = await openProofPortal({
circuitId: "coinbase_kyc_solana"
});
// 2. Verify on Solana Devnet
const result = await verifySolanaProofSimulate({
proof: proofData.proof,
publicWitness: proofData.publicInputs,
verifierProgramId: "Fo4Th6bRHvMv2jcaA6awkRkPde6jkVG8w7QW1yFeM4jF",
rpcUrl: "https://api.devnet.solana.com",
});
if (result.success) {
console.log("Verified on Solana!", result.explorerUrl);
}
}API Reference
openProofPortal(options)
Opens the ZKProofport portal modal for proof generation.
| Parameter | Type | Description |
|-----------|------|-------------|
| circuitId | string | Circuit ID ("coinbase_kyc" or "coinbase_kyc_solana") |
Returns: Promise<{ proof, publicInputs, meta }>
verifyProof(options) - EVM
Verifies proof on EVM chains (Base).
| Parameter | Type | Description |
|-----------|------|-------------|
| proof | string | The ZK proof |
| publicInputs | any | Public inputs |
| meta | object | Metadata from portal |
| mode | "offchain" \| "onchain" | Verification mode |
| provider | JsonRpcProvider | Required for onchain mode |
verifySolanaProofSimulate(options) - Solana
Verifies proof on Solana.
| Parameter | Type | Description |
|-----------|------|-------------|
| proof | string | The ZK proof (hex) |
| publicWitness | string | Public witness (hex) |
| verifierProgramId | string | Solana program ID |
| rpcUrl | string | Solana RPC URL |
Returns: { success, signature?, explorerUrl?, error? }
Supported Circuits
| Circuit ID | Chain | Description |
|------------|-------|-------------|
| coinbase_kyc | Base | Coinbase Identity Verification (EAS attestation) |
| coinbase_kyc_solana | Solana | Same attestation, Groth16 proof for Solana |
Verifier Contracts
- Base Mainnet:
0x4C163fa6756244e7f29Cb5BEA0458eA993Eb0F6d - Solana Devnet:
Fo4Th6bRHvMv2jcaA6awkRkPde6jkVG8w7QW1yFeM4jF
How It Works
- dApp calls
openProofPortal()with acircuitId - SDK opens the Portal in an iFrame
- User connects wallet and generates proof
- Portal returns proof data to dApp
- dApp verifies proof (offchain or onchain)
Roadmap
- [ ] Additional circuits (World ID, POAPs, NFT ownership)
- [ ] Solana Mainnet support
- [ ] Client-side Solana proving
License
MIT
