Security Model
zkTerm is designed with security-first principles:- Client-Side Encryption: All encryption happens in your browser before upload
- Zero-Knowledge Proofs: Verify without revealing sensitive data
- Decentralized Storage: IPFS ensures no single point of failure
- On-Chain Verification: Immutable proof storage on Solana and Starknet
Cryptography
Encryption Standards| Component | Algorithm | Details |
|---|---|---|
| File Encryption | AES-256-GCM | 256-bit key, unique IV per file |
| Key Derivation | PBKDF2 | 200,000 iterations, 32-byte salt |
| Password Hashing | bcrypt | Cost factor 10 |
| Digital Signatures | Ed25519 | 256-bit keys, client-side generation |
| ZK Proofs | Groth16 | BN254 curve, ~200 byte proofs |
| Function | Circuit Cost | Use Case |
|---|---|---|
| Poseidon | ~300 constraints | Most ZK operations, commitments |
| Pedersen | ~1000 constraints | Homomorphic commitments |
| MiMC | ~500 constraints | Alternative ZK hash |
- Groth16 (zkStorage): Trusted setup via Powers of Tau, ~100ms verification
- STARK (zkID): Transparent setup, no trusted ceremony needed
zkToolkit Security
The@zkterm/zktoolkit package provides 10 cryptographic modules:
- hash: Poseidon, Pedersen, MiMC hash functions
- commit: Pedersen commitments (hiding + binding properties)
- nullifier: Double-spend prevention via Poseidon(secret, scope)
- range: Range proofs using bit decomposition
- sign: EdDSA over Baby Jubjub curve
- merkle: Merkle tree construction and proofs
- field: BN254 prime field arithmetic
- ec: Baby Jubjub elliptic curve operations
- shamir: Secret sharing (k-of-n threshold)
- proof: Groth16 proof generation
Threat Model
Protected Against- Man-in-the-Middle: TLS encryption + client-side crypto
- Server Compromise: Server never sees passwords or private keys
- Replay Attacks: Nonce-based signatures
- Brute Force: bcrypt slow hashing + rate limiting
- Data Tampering: IPFS content addressing + SHA-256 checksums
- Double Spend: Nullifier sets with Poseidon hashing
- Quantum Computers: Ed25519 is vulnerable (post-quantum research in progress)
- Client Malware: If your device is compromised, keys can be extracted
- Social Engineering: Phishing attacks targeting users
- Lost Passwords: No password recovery by design (user controls keys)
Best Practices for Users
Password Security- Use 16+ character passwords
- Include numbers, symbols, uppercase letters
- Never reuse passwords across services
- Use a password manager
- No password recovery exists - store passwords safely
- Export private keys to secure offline location
- Never share private keys with anyone
- Store backups on encrypted USB or hardware wallet
- Consider hardware wallet for high-value operations
- Verify checksums after downloading files
- Keep backup of important file IDs
- Use unique passwords for each file
- Never upload sensitive data without encryption enabled
- Verify transaction details before signing
- Use hardware wallet for large amounts
- Double-check contract addresses
- Monitor gas prices before transactions
Best Practices for Developers
API SecurityMemory Safety
zkTerm implements secure memory handling:- Private Key Zeroization: Keys are zeroed from memory after use
- ArrayBuffer Usage: Sensitive data stored in ArrayBuffer (can be zeroed)
- Wallet Mutex Locking: Prevents concurrent transactions on same wallet
- Session Isolation: Express sessions with PostgreSQL storage
Smart Contract Security
Starknet zkID Registry The ZkIDProofRegistry Cairo contract stores proof hashes on-chain:- Immutable proof storage (write-once)
- Owner-only verification
- Gas-optimized felt252 operations
- Deployed on Starknet Sepolia (mainnet planned)
- Uses Solana’s built-in ed25519 program
- Transaction memo for proof anchoring
- Deployed on Solana Mainnet
Incident Response
If you discover a security vulnerability:- Do NOT disclose publicly
- Report via GitHub security advisories or X DM @zkterm
- Include steps to reproduce and impact assessment
- We will respond within 48 hours
- Credit given to researchers (with permission)
Compliance
- Privacy by Design: No personal data stored on servers
- Client-Side Encryption: User data encrypted before leaving browser
- Decentralized Storage: Files stored on IPFS, not centralized servers
- User-Controlled Keys: Only users can decrypt their data