@@ -1,91 +1,118 @@
11# ZERA Confidential SDK
223+> **Unaudited** -- This SDK has not yet undergone a formal security audit. See [Security](docs/SECURITY.md) for details.
4+35Privacy-preserving transaction infrastructure for Solana. ZERA enables confidential deposits, withdrawals, and shielded transfers using zero-knowledge proofs (Groth16 over BN254) with Poseidon-based commitments.
4657This monorepo provides the tools third-party developers need to integrate ZERA's privacy features into wallets, dApps, AI agents, and payment systems.
687-## On-Chain Programs
9+## Quick Start
8109-| Program | ID | Description |
10-|---|---|---|
11-| **Shielded Pool** | `B83jSQx1CT1hPRBupinaJaEkCjrfeo6Ktncu31q3ZNeX` | Full Groth16 shielded pool with Poseidon Merkle tree (height 24), supporting deposit, withdraw, relayed withdraw, and shielded transfer |
12-| **Private Cash** | `ESQxpH9XkBQT6EVeWwAzTZD1e9NrLMrY8RPQ9SidYsgF` | Commitment-based voucher system using Keccak-256 for lighter-weight private payments |
11+**[Full Quickstart Guide](docs/QUICKSTART.md)** -- zero to running in under 5 minutes.
131214-## Repository Structure
13+### 1. Point at the Devnet
14+15+A hosted Surfpool devnet (1:1 Solana mainnet fork) is available with the ZERA Pool program pre-deployed:
15161617```
17-zera-sdk/
18- crates/
19- zera-core/ Rust: Poseidon hashing, Merkle tree, note/commitment/nullifier
20- computation, Groth16 proof formatting, PDA derivation
21- zera-neon/ Rust: neon-rs Node.js native bindings for zera-core
22- packages/
23- sdk/ TypeScript: Client-side crypto (Poseidon + Keccak), note
24- management, Merkle tree, ZK proof generation via snarkjs,
25- transaction builders, PDA helpers, voucher system
26- docs/ Architecture, API reference, integration guide, and more
18+RPC: http://64.34.82.145:18899
19+WebSocket: ws://64.34.82.145:18900
2720```
282129-## Quick Start
22+```bash
23+solana config set --url http://64.34.82.145:18899
24+```
25+26+Or [run your own locally](devnet/SETUP.md) with Surfpool.
302731-### TypeScript SDK
28+### 2. Install the SDK
32293330```bash
34-npm install @zera-labs/sdk
31+npm install @zera-labs/sdk @solana/web3.js
3532```
363334+### 3. Try It
35+3736```typescript
3837import {
39-createNote,
40-computeCommitment,
41-computeNullifier,
42-MerkleTree,
43-generateDepositProof,
44-formatProofForSolana,
38+createNote, computeCommitment, computeNullifier,
39+hashPubkeyToField, MerkleTree, USDC_MINT,
4540} from "@zera-labs/sdk";
41+import { PublicKey } from "@solana/web3.js";
464247-// 1. Create a shielded note
48-const note = createNote(1_000_000n, assetHash); // 1 USDC
43+const mint = new PublicKey(USDC_MINT);
44+const assetHash = await hashPubkeyToField(mint.toBytes());
494550-// 2. Compute the Poseidon commitment
46+// Create a private note (1 USDC)
47+const note = createNote(1_000_000n, assetHash);
5148const commitment = await computeCommitment(note);
49+const nullifier = await computeNullifier(note);
525053-// 3. Generate a Groth16 deposit proof
54-const { proof } = await generateDepositProof(note, wasmPath, zkeyPath);
55-56-// 4. Submit the deposit transaction to Solana
57-// (see Integration Guide for full transaction building)
51+console.log("Commitment:", commitment.toString(16));
52+// Only you know the preimage. The commitment goes on-chain.
5853```
595460-### Rust Core
55+### 4. Run the Demos
615662-Add to your `Cargo.toml`:
57+```bash
58+# Offline crypto primitives (no network needed)
59+cd demos/solana-basic && pnpm install && pnpm demo
636064-```toml
65-[dependencies]
66-zera-core = { git = "https://github.com/zera-labs/zera-sdk", path = "crates/zera-core" }
61+# Live pool status from devnet
62+pnpm status
63+64+# Full React privacy wallet
65+cd ../react-demo && pnpm install && pnpm dev
6766```
686769-```rust
70-use zera_core::{poseidon_hash, compute_commitment, compute_nullifier};
68+## On-Chain Programs
69+70+| Program | ID | Description |
71+|---|---|---|
72+| **Shielded Pool** | `B83jSQx1CT1hPRBupinaJaEkCjrfeo6Ktncu31q3ZNeX` | Full Groth16 shielded pool with Poseidon Merkle tree (height 24), supporting deposit, withdraw, relayed withdraw, and shielded transfer |
73+| **Private Cash** | `ESQxpH9XkBQT6EVeWwAzTZD1e9NrLMrY8RPQ9SidYsgF` | Commitment-based voucher system using Keccak-256 for lighter-weight private payments |
717472-// Compute a Poseidon commitment
73-let commitment = compute_commitment(amount, secret, blinding, asset, &memo)?;
75+## Repository Structure
747675-// Derive the nullifier for spending
76-let nullifier = compute_nullifier(secret, commitment)?;
7777```
78+zera-sdk/
79+ crates/
80+ zera-core/ Rust: Poseidon hashing, Merkle tree, note/commitment/nullifier,
81+ Groth16 proof formatting, PDA derivation
82+ zera-neon/ Rust: napi-rs Node.js native bindings for zera-core
83+ packages/
84+ sdk/ TypeScript: @zera-labs/sdk — crypto, proofs, tx builders, note store
85+ mcp-server/ TypeScript: @zera-labs/mcp-server — MCP tool server for AI agents
86+ demos/
87+ solana-basic/ CLI demos: offline crypto, deposit flow, pool status reader
88+ react-demo/ Full React privacy wallet with Solana wallet adapter
89+ devnet/ Surfpool config for 1:1 mainnet fork (runbooks, program binary, IDL)
90+ docs/ Architecture, API reference, integration guide, and more
91+```
92+93+## Devnet
94+95+The `devnet/` directory contains everything needed to run a local 1:1 Solana mainnet fork via [Surfpool](https://github.com/txtx/surfpool):
96+97+- **surfpool.toml** -- Network config with Light Protocol programs, state trees, and tokens
98+- **runbooks/** -- Infrastructure-as-code for cloning mainnet state and deploying ZERA Pool
99+- **accounts_dump/** -- Program binary (.so) and IDL (.json)
100+101+See [devnet/SETUP.md](devnet/SETUP.md) for full details, or use the hosted instance at `64.34.82.145:18899`.
7810279103## Documentation
8010481105| Document | Description |
82106|---|---|
107+| **[Quickstart](docs/QUICKSTART.md)** | **Start here** -- zero to running in 5 minutes |
83108| [Architecture](docs/ARCHITECTURE.md) | System design, layer diagram, privacy model |
84109| [API Reference](docs/API_REFERENCE.md) | Full TypeScript SDK API with signatures and examples |
85110| [Integration Guide](docs/INTEGRATION_GUIDE.md) | Step-by-step walkthrough for third-party developers |
86111| [Cryptography](docs/CRYPTOGRAPHY.md) | Poseidon, commitments, nullifiers, Merkle tree, Groth16 |
87112| [Examples](docs/EXAMPLES.md) | Complete runnable code for every operation |
88113| [Security](docs/SECURITY.md) | Threat model, audit status, responsible disclosure |
114+| [Agentic Integration](docs/AGENTIC_INTEGRATION.md) | AI agent payment patterns (MCP, x402, ElizaOS) |
115+| [Use Cases](docs/USE_CASES.md) | Real-world integration scenarios |
8911690117## Key Concepts
91118@@ -100,8 +127,12 @@ let nullifier = compute_nullifier(secret, commitment)?;
100127- Node.js >= 18
101128- Solana CLI >= 1.18 (for on-chain interaction)
102129- Rust >= 1.75 (for building crates)
103-- Circuit files (`.wasm` + `.zkey`) for ZK proof generation
130+- Circuit files (`.wasm` + `.zkey`) for ZK proof generation (available on request)
131+132+## Contributing
133+134+See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, guidelines, and how to submit pull requests.
104135105136## License
106137107-MIT
138+[MIT](LICENSE)

Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.