Documentation

Complete technical guide to ZK Password Vault with Light Protocol ZK Compression, military-grade AES-256-GCM encryption, and decentralized IPFS storage.

Light ProtocolHelius RPCPinata IPFSAES-256-GCM

Overview

ZK Password Vault is a next-generation password manager built on Solana blockchain using Light Protocol ZK Compression. Your passwords are encrypted client-side, stored on decentralized IPFS, and verified on-chain with zero-knowledge proofs.

Military-Grade Encryption

AES-256-GCM with PBKDF2 key derivation (600,000 iterations)

99.1% Cheaper Storage

Light Protocol ZK Compression reduces on-chain costs dramatically

Decentralized Storage

Encrypted data on IPFS via Pinata, only CID reference on-chain

Self-Custody

Only you can decrypt - wallet signature derives encryption key

Architecture

┌─────────────────────────────────────────────────────────────────────────┐
│                        ZK PASSWORD VAULT ARCHITECTURE                    │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                          │
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐              │
│  │   CLIENT     │    │   BACKEND    │    │   SOLANA     │              │
│  │   (Browser)  │    │   (Next.js)  │    │   (Devnet)   │              │
│  └──────┬───────┘    └──────┬───────┘    └──────┬───────┘              │
│         │                    │                   │                       │
│    ┌────▼────┐          ┌────▼────┐        ┌────▼────┐                 │
│    │ AES-256 │          │ Light   │        │ ZK Comp │                 │
│    │ Encrypt │          │ Protocol│        │ Account │                 │
│    └────┬────┘          │ SDK     │        └─────────┘                 │
│         │               └────┬────┘                                     │
│    ┌────▼────┐               │                                          │
│    │ IPFS    │◄──────────────┘                                         │
│    │ Upload  │     (Helius RPC)                                         │
│    └────┬────┘                                                          │
│         │                                                                │
│    ┌────▼────┐                                                          │
│    │ Pinata  │                                                          │
│    │ Gateway │                                                          │
│    └─────────┘                                                          │
│                                                                          │
└─────────────────────────────────────────────────────────────────────────┘

Data Flow

  1. 1Encrypt: Passwords encrypted client-side with AES-256-GCM
  2. 2Upload: Encrypted blob uploaded to IPFS via Pinata
  3. 3Compress: Backend prepares Light Protocol ZK Compression transaction
  4. 4Sign: Client signs transaction with wallet (keys never leave device)
  5. 5Submit: Signed transaction broadcast to Solana via Helius RPC

Encryption (AES-256-GCM)

Key Derivation

  • Algorithm: PBKDF2-SHA256
  • Iterations: 300,000
  • Input: Wallet Ed25519 signature
  • Output: 256-bit AES key

Encryption

  • Algorithm: AES-256-GCM
  • Nonce: 12-byte random (crypto.getRandomValues)
  • Auth Tag: 128-bit integrity verification
  • Output: Base64 encoded ciphertext
Encryption Flow
// Key Derivation
signature = wallet.signMessage("ZK-Vault-Encryption-Key-v1")
key = PBKDF2(signature, salt, 300000, "SHA-256") // Vault key
passwordKey = PBKDF2(signature, salt2, 300000, "SHA-256") // Per-password

// Triple Encryption (600,000 total iterations)
nonce = crypto.getRandomValues(12 bytes)
ciphertext = AES-256-GCM.encrypt(passwords_json, key, nonce)
output = base64(nonce || ciphertext || auth_tag)

🔐 Security Note: AES-256-GCM is the same encryption used by banks, governments, and military. With 2^256 possible keys, brute-force attacks are computationally impossible - it would take billions of years with all computers on Earth.

Light Protocol ZK Compression

Light Protocol uses zero-knowledge proofs (Groth16/Poseidon) to compress on-chain state, reducing storage costs by 99.1% while maintaining full verifiability.

99.1%
Cost Reduction
~5000
Lamports (~$0.0005)
Rent-Free
No Storage Rent

Programs Used

Light System ProgramSySTEM1eSU2p4BGQfQpimFEWWSC1XDFeun3Nqzz3rT7
Account Compressioncompr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq
Noop Programnoopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV

⚡ ZK Compression: Data is stored in compressed Merkle trees with Poseidon hashes. Validity proofs (Groth16) ensure only legitimate updates are accepted.

Helius RPC

Helius provides enterprise-grade Solana RPC with native ZK Compression support. Their infrastructure handles the complex cryptographic operations required for Light Protocol transactions.

ZK Compression API

Native support for getStateTreeInfos(), getValidityProof(), and compressed account operations.

High Availability

99.9% uptime SLA with global edge network for low-latency transactions.

# RPC Endpoint
https://devnet.helius-rpc.com/?api-key=YOUR_KEY

IPFS Storage (Pinata)

Pinata provides reliable IPFS pinning for encrypted vault data. Content-addressing ensures data integrity - if the CID matches, the data is authentic.

Decentralized
No single point of failure
Content-Addressed
CID verifies integrity
Global CDN
Fast downloads worldwide

🔒 Privacy: Only encrypted ciphertext is stored on IPFS. Without your wallet's encryption key, the data is meaningless random bytes.

Security Model

4 Layers of Protection

Layer 1: Client-Side Encryption

AES-256-GCM encryption happens in your browser. Passwords never leave your device unencrypted.

Layer 2: Wallet-Derived Keys

Encryption key is derived from your wallet signature. Only you can decrypt.

Layer 3: Off-Chain Storage

Encrypted data stored on IPFS, not blockchain. Only CID reference is on-chain.

Layer 4: ZK Verification

Light Protocol ZK proofs verify ownership without revealing any data.

Attack Resistance

Attack VectorProtected?How?
Brute-force encryptionAES-256 = 2^256 combinations
Server breachBackend never sees encryption keys
IPFS data leakData is encrypted, unusable without key
Man-in-the-middleHTTPS + client-side encryption
Wallet key theftUse hardware wallet for maximum security

Quick Start

  1. 1

    Connect Your Wallet

    Click "Connect Wallet" and approve with Phantom, Solflare, or any Solana wallet.

  2. 2

    Sign to Derive Key

    One-time signature to derive your unique encryption key. This happens locally.

  3. 3

    Add Passwords

    Add your credentials. Use the password generator for strong passwords.

  4. 4

    Save with ZK Compression

    Click save, approve the transaction (~$0.001), and your vault is secured on-chain!