NeaByteLab | August 2025 | Version 1.0.0
Research Implementation - Comprehensive TypeScript library for understanding quantum-resistant zero-knowledge proof protocols. Designed for research, education, and prototyping applications.
A comprehensive TypeScript library implementing quantum-resistant zero-knowledge proof protocols using educational cryptographic concepts. This library provides educational implementations of four major post-quantum cryptography approaches:
- Hash-Based ZKP: Hash chain implementations using SHA-256/384/512
- Lattice-Based ZKP: Learning With Errors (LWE) implementations for lattice cryptography
- Multivariate ZKP: Polynomial system implementations for multivariate cryptography
- Hybrid ZKP: Multi-algorithm approaches for defense-in-depth concepts
- π¬ Research Focus: Comprehensive implementations for understanding cryptographic concepts
- π Detailed Documentation: Mathematical foundations and security analysis
- β‘ Performance Benchmarks: Built-in benchmarking for algorithm comparison
- π‘οΈ Security Analysis: Research-grade security assessments
- π± Cross-Platform: Node.js 22+ (browser support planned)
- π§ͺ Prototyping Tools: Development utilities for testing concepts
graph TB
A[QuantumZKP Core] --> B[HashZKP]
A --> C[LatticeZKP]
A --> D[MultivariateZKP]
A --> E[HybridZKP]
A --> F[Benchmarking]
A --> G[Documentation]
style A fill:#e3f2fd,stroke:#1976d2,stroke-width:3px,color:#000000
style B fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px,color:#000000
style C fill:#fff3e0,stroke:#f57c00,stroke-width:2px,color:#000000
style D fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px,color:#000000
style E fill:#f8bbd9,stroke:#c2185b,stroke-width:2px,color:#000000
style F fill:#e8f5e8,stroke:#388e3c,stroke-width:2px,color:#000000
style G fill:#fff3e0,stroke:#f57c00,stroke-width:2px,color:#000000
Algorithm | Foundation | Research Purpose | Performance Profile |
---|---|---|---|
Hash | SHA-256/384/512 hash functions | Understanding hash-based cryptography | 1.76ms generation, 1.07ms verification |
Lattice | Learning With Errors (LWE) | Researching lattice cryptography principles | 389.67ms generation, 104.79ΞΌs verification |
Multivariate | Multivariate polynomial systems | Studying polynomial cryptography concepts | 377.03ΞΌs generation, 17.80ΞΌs verification |
Hybrid | Multiple algorithm combination | Researching defense-in-depth concepts | 1.33s generation, 654.66ΞΌs verification |
Performance data based on real benchmarks on Apple M3 Pro hardware
npm install @neabyte/quantum-zkp
import { QuantumZKP } from '@neabyte/quantum-zkp'
// Create a quantum-resistant zero-knowledge proof
const secret = 'my-secret-data'
const zkp = new QuantumZKP()
const proof = zkp.createProof(secret, 'hash')
// Verify the proof
const verificationResult = zkp.verifyProof(proof)
console.log('Proof valid:', verificationResult.isValid) // true
console.log('Verification time:', verificationResult.verificationTime, 'ms')
import { LatticeZKP, HashZKP, MultivariateZKP, HybridZKP } from '@neabyte/quantum-zkp'
// Hash-based ZKP
const hashProof = HashZKP.createProof(secret, {
chainLength: 1000
})
// Lattice-based ZKP
const latticeProof = LatticeZKP.createProof(secret, {
dimension: 256,
modulus: 2n ** 512n
})
// Multivariate ZKP
const multivariateProof = MultivariateZKP.createProof(secret, {
variables: 8,
equations: 12
})
// Hybrid ZKP
const hybridProof = HybridZKP.createProof(secret, {
algorithms: ['hash', 'lattice'],
weights: [0.6, 0.4]
})
// Create distributed proof across multiple parties
const thresholdProof = zkp.createThresholdProof(secret, 3, 'lattice')
console.log('Threshold:', thresholdProof.threshold) // 2
console.log('Parties:', thresholdProof.parties) // 3
// Process multiple proofs efficiently
const secrets = ['secret1', 'secret2', 'secret3', 'secret4']
const proofs = zkp.batchCreateProofs(secrets, 'hash', {
parallel: true,
batchSize: 2,
progressCallback: (progress) => console.log(`Progress: ${progress * 100}%`)
})
// Benchmark all algorithms
const benchmarks = zkp.benchmarkAllAlgorithms()
benchmarks.forEach(result => {
console.log(`${result.algorithm}: ${result.operationsPerSecond} ops/sec`)
})
flowchart LR
A[Prover<br/>Secret Knowledge] --> B[Commitment<br/>Hide Secret]
B --> C[Challenge<br/>Random Value]
C --> D[Response<br/>Proof Without Secret]
D --> E[Verification<br/>Check Validity]
style A fill:#ffebee,color:#000000
style E fill:#e8f5e8,color:#000000
graph TD
A[ZKP Properties] --> B[π Completeness]
A --> C[π‘οΈ Soundness]
A --> D[π€ Zero-Knowledge]
A --> E[β‘ Efficiency]
B --> B1[Valid proofs always verify]
C --> C1[Invalid proofs rarely verify]
D --> D1[No secret information revealed]
E --> E1[Practical to generate/verify]
style A fill:#ffffff,stroke:#000000,stroke-width:2px,color:#000000
style B fill:#ffffff,stroke:#000000,stroke-width:2px,color:#000000
style C fill:#ffffff,stroke:#000000,stroke-width:2px,color:#000000
style D fill:#ffffff,stroke:#000000,stroke-width:2px,color:#000000
style E fill:#ffffff,stroke:#000000,stroke-width:2px,color:#000000
flowchart LR
A[Secret] --> B[Hash Chain]
B --> C[Commitment]
C --> D[Challenge]
A --> E[Witness]
E --> F[Response]
F --> G[Verification]
G --> H[Result]
D --> F
subgraph "Research Features"
I[π Hash Chain Concepts]
J[π Hash Function Security]
K[β‘ Fast Performance]
end
style A fill:#ffebee,color:#000000
style H fill:#e8f5e8,color:#000000
style I fill:#e3f2fd,color:#000000
style J fill:#fff3e0,color:#000000
style K fill:#f3e5f5,color:#000000
flowchart LR
A[Secret] --> B[LWE Problem]
B --> C[Commitment]
C --> D[Challenge]
A --> E[Witness]
E --> F[LWE Solution]
F --> G[Verification]
G --> H[Result]
D --> F
subgraph "Research Features"
I[π Lattice Cryptography]
J[π LWE Hardness Assumption]
K[β‘ Medium Performance]
end
style A fill:#ffebee,color:#000000
style H fill:#e8f5e8,color:#000000
style I fill:#e3f2fd,color:#000000
style J fill:#fff3e0,color:#000000
style K fill:#f3e5f5,color:#000000
flowchart LR
A[Secret] --> B[Polynomial System]
B --> C[Commitment]
C --> D[Challenge]
A --> E[Witness]
E --> F[Polynomial Solution]
F --> G[Verification]
G --> H[Result]
D --> F
subgraph "Research Features"
I[π Polynomial Cryptography]
J[π Polynomial System Solving]
K[β‘ Complex Security]
end
style A fill:#ffebee,color:#000000
style H fill:#e8f5e8,color:#000000
style I fill:#e3f2fd,color:#000000
style J fill:#fff3e0,color:#000000
style K fill:#f3e5f5,color:#000000
flowchart LR
A[Secret] --> B[Multiple Algorithms]
B --> C[Combined Commitment]
C --> D[Challenge]
A --> E[Witness]
E --> F[Weighted Response]
F --> G[Multi-Verification]
G --> H[Result]
D --> F
subgraph "Research Features"
I[π Defense-in-Depth Concepts]
J[π Multiple Security Assumptions]
K[β‘ Maximum Research Security]
end
style A fill:#ffebee,color:#000000
style H fill:#e8f5e8,color:#000000
style I fill:#e3f2fd,color:#000000
style J fill:#fff3e0,color:#000000
style K fill:#f3e5f5,color:#000000
// Research privacy-preserving transactions
const proof = zkp.createProof(transactionData, 'hash')
// Study how zero-knowledge proofs work in blockchain systems
// Research identity proof concepts
const identityProof = zkp.createProof(userCredentials, 'lattice')
// Study anonymous authentication concepts
// Research lightweight authentication concepts
const deviceProof = HashZKP.createProof(deviceSecret)
// Study device-to-device communication concepts
// Research digital signature concepts
const signature = HybridZKP.createProof(financialDocument)
// Study long-term document security concepts
For detailed performance analysis and optimization recommendations, see PERFORMANCE.md.
Algorithm | Generation Time | Verification Time | Proof Size | Memory Usage | Ops/sec |
---|---|---|---|---|---|
Hash | 1.76ms | 1.07ms | 416.18 KB | ~256 KB | 569.1 |
Lattice | 389.67ms | 104.79ΞΌs | 5.01 KB | ~512 KB | 2.6 |
Multivariate | 377.03ΞΌs | 17.80ΞΌs | 9.26 KB | 255.9 KB | 2652.3 |
Hybrid | 1.33s | 654.66ΞΌs | 431.54 KB | ~1 MB | 0.7 |
Benchmark results from Apple M3 Pro with Node.js 22.16.0
- Minimum: Node.js 22+, 2GB RAM
- Recommended: 4GB+ RAM for research hybrid algorithms
- Research: 8GB+ RAM for comprehensive research demonstrations
new QuantumZKP(config?: Partial<ZKPConfig>)
Creates a quantum-resistant zero-knowledge proof.
Parameters:
secret: Buffer | string
- Secret to prove knowledge ofalgorithm: AlgorithmType
- Algorithm to use (default: 'hash')parameters?: Partial<ProofParameters>
- Algorithm-specific parameters
Returns: Proof
- Quantum-resistant proof
Verifies a quantum-resistant proof.
Parameters:
proof: Proof
- Proof to verify
Returns: VerificationResult
- Verification result with timing information
Creates distributed proof across multiple parties.
Parameters:
secret: Buffer | string
- Secret to prove knowledge ofparties: number
- Number of parties (default: 3)algorithm: AlgorithmType
- Algorithm to use
Returns: ThresholdProof
- Distributed proof with reconstruction key
Efficiently creates multiple proofs.
Parameters:
secrets: (Buffer | string)[]
- Array of secretsalgorithm: AlgorithmType
- Algorithm to useoptions?: BatchProcessingOptions
- Processing options
Returns: Proof[]
- Array of proofs
Benchmarks all supported algorithms.
Returns: BenchmarkResult[]
- Performance comparison results
// Create hash-based proof
const proof = HashZKP.createProof(secret, { chainLength: 1000 })
// Verify hash-based proof
const isValid = HashZKP.verifyProof(proof)
// Get performance metrics
const metrics = HashZKP.getPerformanceMetrics()
// Get security level
const security = HashZKP.getSecurityLevel()
// Create lattice-based proof
const proof = LatticeZKP.createProof(secret, {
dimension: 256,
modulus: 2n ** 512n
})
// Verify lattice-based proof
const isValid = LatticeZKP.verifyProof(proof)
// Create multivariate proof
const proof = MultivariateZKP.createProof(secret, {
variables: 8,
equations: 12
})
// Verify multivariate proof
const isValid = MultivariateZKP.verifyProof(proof)
// Create hybrid proof
const proof = HybridZKP.createProof(secret, {
algorithms: ['hash', 'lattice'],
weights: [0.6, 0.4]
})
// Verify hybrid proof
const isValid = HybridZKP.verifyProof(proof)
git clone https://github.com/NeaByteLab/Quantum-ZKP.git
cd Quantum-ZKP
npm install
npm run build # Build the library
npm run dev # Development mode with watch
npm run test # Run tests
npm run lint # Lint code
npm run format # Format code
npm run benchmark # Run performance benchmarks
npm run example # Run basic usage example
- README.md - Project overview and quick start
- PERFORMANCE.md - Detailed performance analysis and benchmarks
- SECURITY.md - Security analysis and cryptographic foundations
- LICENSE - Apache 2.0 license
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
This is a research implementation designed for understanding quantum-resistant cryptography concepts. While the implementations follow established cryptographic principles, they are intended for research and prototyping purposes.
For detailed security analysis and cryptographic foundations, see SECURITY.md.
For production quantum-resistant cryptography, consult with qualified cryptographic experts and use established, audited implementations that have undergone formal security analysis.
We welcome contributions for research improvements, documentation enhancements, and bug fixes. Please read our Contributing Guidelines before submitting pull requests.
For research support, questions about implementation concepts, or consulting inquiries:
- Issues: GitHub Issues
- Consulting: Contact NeaByteLab
Note: This library is designed for research purposes and prototyping. For production quantum-resistant cryptography implementations, please consult with qualified cryptographic experts.