Clean up documentation and update dependencies

This commit is contained in:
Hanzo Dev
2025-11-04 15:54:47 -08:00
parent 9f5ad36c0d
commit be4f2e16cf
11 changed files with 64 additions and 1250 deletions
+7
View File
@@ -0,0 +1,7 @@
AGENTS.md
CLAUDE.md
GEMINI.md
GROK.md
QWEN.md
-124
View File
@@ -1,124 +0,0 @@
# Crypto Consolidation Summary
## Completed Actions
### 1. Moved Crypto Implementations
**From `/Users/z/work/lux/node/utils/crypto/`:**
- `bls/``/Users/z/work/lux/crypto/bls_new/`
- `secp256k1/``/Users/z/work/lux/crypto/secp256k1_new/`
- `keychain/``/Users/z/work/lux/crypto/keychain/`
- `ledger/``/Users/z/work/lux/crypto/ledger/`
### 2. Extracted Common Crypto
**From `/Users/z/work/lux/threshold/`:**
- Blake3 hash implementation → `/Users/z/work/lux/crypto/hashing/blake3/`
**From `/Users/z/work/lux/mpc/`:**
- Age encryption utilities → `/Users/z/work/lux/crypto/encryption/age.go`
### 3. Created Unified Implementations
**BLS Unified (`/Users/z/work/lux/crypto/bls/bls_unified.go`):**
- High-performance BLST implementation (default)
- Pure Go CIRCL implementation (with `purego` build tag)
- Common interface for both implementations
### 4. Existing Crypto Already Consolidated
**These packages already use centralized crypto:**
- `/Users/z/work/lux/consensus` - Uses `github.com/luxfi/crypto/bls`
- `/Users/z/work/lux/geth` - Domain-specific, uses appropriate external libs
- `/Users/z/work/lux/evm` - Domain-specific, EVM compatibility required
## Current State
### Crypto Package Structure
```
/Users/z/work/lux/crypto/
├── bls/ # Existing BLS (CIRCL-based)
├── bls_new/ # Migrated BLS (BLST-based) from node
├── bls_unified.go # Unified BLS implementation
├── secp256k1/ # Existing SECP256K1
├── secp256k1_new/ # Migrated SECP256K1 from node
├── keychain/ # Key management (migrated)
├── ledger/ # Hardware wallet support (migrated)
├── hashing/
│ └── blake3/ # Blake3 hash (extracted from threshold)
├── encryption/
│ └── age.go # Age encryption (extracted from MPC)
├── mldsa/ # ML-DSA post-quantum
├── mlkem/ # ML-KEM post-quantum
├── slhdsa/ # SLH-DSA post-quantum
├── precompile/ # Precompiled contracts
└── [other existing crypto packages]
```
## Implementation Differences
### BLS Implementations
| Feature | Node (BLST) | Crypto (CIRCL) |
|---------|-------------|----------------|
| Library | supranational/blst | cloudflare/circl |
| Performance | C library, faster | Pure Go, slower |
| Compatibility | Requires CGO | No CGO needed |
| Features | Full BLS12-381 | BLS signatures only |
### SECP256K1 Implementations
| Feature | Node | Crypto |
|---------|------|--------|
| Library | decred/dcrd/dcrec | Custom implementation |
| RFC6979 | Yes | No |
| Recovery | Yes | Yes |
| Cache | LRU cache | No cache |
## Next Steps Required
### 1. Merge Implementations
- [ ] Decide on primary BLS implementation (recommend BLST for performance)
- [ ] Merge SECP256K1 features (add RFC6979 to crypto version)
- [ ] Create compatibility layer for smooth transition
### 2. Update Import Paths
Files requiring updates:
- `/Users/z/work/lux/node/` - 13 files importing `utils/crypto/keychain`
- Need to change from: `github.com/luxfi/node/utils/crypto/*`
- To: `github.com/luxfi/crypto/*`
### 3. Remove Old Directories
After verification:
- [ ] Remove `/Users/z/work/lux/node/utils/crypto/`
- [ ] Clean up duplicate implementations
### 4. Testing
- [ ] Run all crypto package tests
- [ ] Run node tests with new imports
- [ ] Run consensus tests
- [ ] Performance benchmarks
## Benefits Achieved
1. **Centralized Crypto**: All cryptographic operations now originate from `/Users/z/work/lux/crypto`
2. **No Duplication**: Eliminated duplicate BLS and SECP256K1 implementations
3. **Better Organization**: Clear separation between generic crypto and domain-specific code
4. **Improved Maintainability**: Single source of truth for crypto operations
5. **Enhanced Security**: Easier to audit and update crypto code
## Migration Commands
### To complete the migration:
```bash
# 1. Update imports in node package
find /Users/z/work/lux/node -name "*.go" -exec sed -i '' \
's|github.com/luxfi/node/utils/crypto|github.com/luxfi/crypto|g' {} \;
# 2. Update go.mod files
cd /Users/z/work/lux/node && go mod edit -replace github.com/luxfi/node/utils/crypto=github.com/luxfi/crypto
# 3. Run tests
cd /Users/z/work/lux/crypto && go test ./...
cd /Users/z/work/lux/node && go test ./...
# 4. After verification, remove old directories
rm -rf /Users/z/work/lux/node/utils/crypto
```
## Summary
All cryptographic code has been successfully consolidated into `/Users/z/work/lux/crypto`. The threshold package retains its threshold-specific logic while common crypto (Blake3) has been extracted. The MPC package retains its MPC-specific logic while encryption utilities have been centralized. This achieves the goal of having all crypto originate from a single, well-organized package.
-155
View File
@@ -1,155 +0,0 @@
# Lux Crypto Test Coverage Report
## Summary
Comprehensive test coverage has been added for the Lux cryptography packages, with a focus on post-quantum cryptography implementations.
## Coverage by Package
### High Coverage (>80%)
- **mldsa**: 91.8% ✅ - Module Lattice Digital Signature Algorithm (FIPS 204)
- **bn256/google**: 91.6% ✅
- **ipa/bandersnatch/fp**: 92.9% ✅
- **blake2b**: 90.4% ✅
- **ipa**: 90.2% ✅
- **ipa/ipa**: 87.2% ✅
- **signify**: 83.8% ✅
- **ecies**: 81.6% ✅
- **bn256/cloudflare**: 81.8% ✅
### Medium Coverage (40-80%)
- **ipa/bandersnatch/fr**: 77.8% ✅
- **cb58**: 76.5% ✅
- **ipa/banderwagon**: 76.2% ✅
- **crypto (main)**: 72.4% ✅
- **kzg4844**: 56.4% ✅
- **ipa/common**: 51.3% ✅
- **bls/signer/localsigner**: 50.0% ✅
- **precompile**: 47.1% ✅ (improved from 8.3%)
- **slhdsa**: 43.0% ✅ - Stateless Hash-Based DSA (FIPS 205)
- **mlkem**: 42.4% ✅ - Module Lattice KEM (FIPS 203)
- **secp256k1**: 41.1% ✅
- **bn256/gnark**: 40.9% ✅
### Low Coverage (<40%)
- **bls**: 39.5%
- **ipa/bandersnatch**: 38.1%
### Zero Coverage (placeholder/unused)
- **lamport**: 0.0% (tests exist but showing 0%)
- **bn256**: 0.0%
- **bls12381**: 0.0%
- **cache**: 0.0%
- **common**: 0.0%
- **hashing**: 0.0%
- **rlp**: 0.0%
- **secp256r1**: 0.0%
- **staking**: 0.0%
- **utils**: 0.0%
## Key Improvements
### 1. Post-Quantum Cryptography
-**ML-DSA (FIPS 204)**: Complete test suite with 91.8% coverage
- All security levels (44, 65, 87)
- Signature generation and verification
- Serialization/deserialization
- Edge cases and error handling
-**ML-KEM (FIPS 203)**: Comprehensive tests with 42.4% coverage
- All security levels (512, 768, 1024)
- Key encapsulation and decapsulation
- Implicit rejection testing
- Serialization round-trips
-**SLH-DSA (FIPS 205)**: Full test suite with 43.0% coverage
- All variants (128s/f, 192s/f, 256s/f)
- Deterministic signature verification
- Large signature size handling
### 2. Precompiles
-**Coverage improved from 8.3% to 47.1%**
- Comprehensive test suite for:
- SHAKE (128/256) with all variants
- cSHAKE with customization strings
- Lamport signature verification
- BLS operations (placeholder tests)
- Registry and gas estimation
- Cross-precompile workflows
### 3. Solidity Testing Infrastructure
- ✅ Foundry/Anvil test setup created
- ✅ Solidity interfaces for all precompiles
- ✅ Helper libraries (ShakeLib, LamportLib, BLSLib)
- ✅ Comprehensive test contracts
- ✅ Deployment scripts
## Test Execution
### Running Go Tests
```bash
cd /Users/z/work/lux/crypto
go test -v -cover ./...
```
### Running Specific Package Tests
```bash
# Post-quantum crypto
go test -v ./mldsa/... ./mlkem/... ./slhdsa/... -cover
# Precompiles
go test -v ./precompile/... -cover
# With benchmarks
go test -bench=. -benchmem ./...
```
### Running Solidity Tests
```bash
cd /Users/z/work/lux/crypto/precompile/test
make install # Install Foundry
make test # Run tests with Anvil
```
## CI/CD Configuration
- GitHub Actions workflow created
- Automatic testing on push/PR
- Coverage reporting with Codecov
- Benchmark comparisons for PRs
- Minimum coverage threshold: 40%
## Performance Benchmarks
### Post-Quantum Operations (100 operations)
- **ML-KEM-768 Encapsulate**: ~321μs
- **ML-DSA-65 Sign**: ~1.96ms
- **SLH-DSA-128f Sign**: ~622μs (10 operations)
### Precompile Gas Costs
- **SHAKE256-256**: 200 gas
- **SHAKE256-512**: 250 gas
- **SHAKE256-1024**: 350 gas
- **Lamport Verify SHA256**: 50,000 gas
- **BLS Verify**: 150,000 gas
## Next Steps
1. **Address Zero Coverage Packages**:
- Determine if packages are still in use
- Add tests or mark as deprecated
2. **Improve Low Coverage Packages**:
- BLS: Add real implementation tests
- Lamport: Fix coverage reporting issue
3. **Production Readiness**:
- Replace placeholder implementations
- Add integration tests with node
- Performance optimization with CGO
4. **Security Audit**:
- Review all crypto implementations
- Ensure constant-time operations
- Validate against test vectors
## Conclusion
The Lux crypto package now has comprehensive test coverage, particularly for critical post-quantum cryptography implementations. All major packages have >40% coverage, with many achieving >80%. The testing infrastructure supports both Go and Solidity testing, with CI/CD automation in place.
-216
View File
@@ -1,216 +0,0 @@
# Post-Quantum Cryptography Integration Analysis for Lux Network
## Current State of Integration
### What's Actually Implemented
1. **Post-Quantum Crypto Libraries**
- ML-KEM (FIPS 203) - Key encapsulation
- ML-DSA (FIPS 204) - Digital signatures (Dilithium)
- SLH-DSA (FIPS 205) - Hash-based signatures (SPHINCS+)
- Located in `/crypto/mlkem`, `/crypto/mldsa`, `/crypto/slhdsa`
2. **Precompile Infrastructure**
- Framework exists in `/crypto/precompile/`
- Address ranges reserved: 0x0110-0x0139
- But NOT yet integrated into geth's VM
3. **Current Consensus Signatures**
- **P-Chain**: BLS signatures (BLS12-381) for validators
- **C-Chain**: ECDSA (secp256k1) for EVM transactions
- **X-Chain**: ECDSA (secp256k1) for UTXO transactions
### Integration Gaps
## 1. EVM/Geth Integration ❌
The post-quantum precompiles are NOT yet in geth's contracts.go:
```go
// Need to add to /geth/core/vm/contracts.go:
var PrecompiledContractsLux = PrecompiledContracts{
// ... existing precompiles ...
// ML-DSA (Dilithium)
common.BytesToAddress([]byte{0x01, 0x10}): &mldsaVerify44{},
common.BytesToAddress([]byte{0x01, 0x11}): &mldsaVerify65{},
common.BytesToAddress([]byte{0x01, 0x12}): &mldsaVerify87{},
// ML-KEM
common.BytesToAddress([]byte{0x01, 0x20}): &mlkemEncapsulate512{},
common.BytesToAddress([]byte{0x01, 0x21}): &mlkemDecapsulate512{},
// ... etc
}
```
## 2. Account/Wallet Level Signature Selection ❌
Currently, signature types are hardcoded per chain:
### Current Architecture:
```
P-Chain (Platform) → BLS only (validator consensus)
C-Chain (Contract) → ECDSA only (EVM compatibility)
X-Chain (Exchange) → ECDSA only (UTXO model)
M-Chain (proposed) → Would need Dilithium MPC
```
### What's Needed for User Choice:
1. **Account Abstraction (EIP-4337 style)**
```solidity
contract PostQuantumAccount {
enum SignatureType { ECDSA, MLDSA44, MLDSA65, MLDSA87 }
SignatureType public sigType;
bytes public publicKey;
function validateSignature(bytes memory signature) {
if (sigType == SignatureType.MLDSA65) {
// Call precompile at 0x0111
(bool success, ) = address(0x0111).staticcall(
abi.encode(publicKey, message, signature)
);
require(success, "Invalid ML-DSA signature");
}
}
}
```
2. **Transaction Format Extension**
```go
type PostQuantumTx struct {
SignatureAlgorithm uint8 // 0=ECDSA, 1=ML-DSA, 2=SLH-DSA
Signature []byte // Variable size based on algorithm
}
```
## 3. Consensus Integration
### Current State:
- **P-Chain**: BLS + Corona (post-quantum ready)
- **Validators**: Use BLS for aggregatable signatures
- **Not using ML-DSA/Dilithium for consensus**
### Why Not Dilithium for Consensus?
1. **Signature Size**: ML-DSA signatures are 2.4-4.6 KB vs BLS's 96 bytes
2. **Aggregation**: BLS supports signature aggregation, ML-DSA doesn't
3. **Network Overhead**: Would increase block size significantly
### Actual Post-Quantum Strategy:
```
Consensus: BLS + Corona (hybrid classical/PQ)
User Transactions: ECDSA with optional PQ via precompiles
Smart Contracts: Can use PQ via precompiles
```
## 4. MPC for M-Chain
For threshold signatures with ML-DSA:
```go
// Theoretical implementation needed:
type MLDSAThresholdSigner struct {
shares []MLDSAShare
threshold int
}
// Challenge: ML-DSA doesn't naturally support threshold
// Would need lattice-based secret sharing scheme
```
## Implementation Roadmap
### Phase 1: EVM Precompile Integration ⏳
```bash
# What needs to be done:
1. Wire up precompiles in geth/core/vm/contracts.go
2. Add to PrecompiledContractsLux
3. Test with C-Chain
```
### Phase 2: Smart Contract Support ✅ (Ready when Phase 1 done)
```solidity
// Users can already write contracts like:
contract PostQuantumVault {
function verifyMLDSA(
bytes memory pubKey,
bytes memory message,
bytes memory signature
) public view returns (bool) {
(bool success, bytes memory result) = address(0x0111).staticcall(
abi.encode(pubKey, message, signature)
);
return success && result[0] == 1;
}
}
```
### Phase 3: Wallet Integration 🔮
```javascript
// Future wallet support:
const wallet = new LuxWallet({
signatureType: 'ML-DSA-65',
// Larger keys and signatures
privateKey: mldsaPrivateKey, // 4000 bytes
});
```
### Phase 4: Optional Account Abstraction 🔮
- Allow users to choose signature scheme per account
- Backward compatible with ECDSA
- Higher gas costs for PQ signatures
## Practical Usage Today
### What Works Now:
1. **Library Level**: All PQ crypto works
2. **Testing**: Can test algorithms independently
3. **Benchmarking**: Performance metrics available
### What Doesn't Work Yet:
1. **On-chain verification**: Precompiles not wired to EVM
2. **Wallet support**: No UI/UX for PQ keys
3. **Network consensus**: Still BLS, not ML-DSA
## Recommended Architecture
```
┌─────────────────────────────────────┐
│ User Layer │
├─────────────────────────────────────┤
│ Wallet: ECDSA (default) │
│ ML-DSA (optional via AA) │
├─────────────────────────────────────┤
│ Chain Layer │
├─────────────────────────────────────┤
│ P-Chain: BLS + Corona (consensus) │
│ C-Chain: ECDSA + PQ precompiles │
│ X-Chain: ECDSA (UTXO compatible) │
│ M-Chain: ECDSA (MPC) / Future: PQ │
├─────────────────────────────────────┤
│ Precompile Layer (0x0110+) │
├─────────────────────────────────────┤
│ ML-KEM │ ML-DSA │ SLH-DSA │ SHAKE │
└─────────────────────────────────────┘
```
## Summary
**Current Reality:**
- Post-quantum crypto is implemented but not integrated
- Consensus uses BLS + Corona (hybrid approach)
- No user-facing PQ signature support yet
**What's Needed:**
1. Wire precompiles to geth EVM ← Critical next step
2. Create example smart contracts using PQ
3. Add wallet support (much later)
4. Consider account abstraction for signature choice
**Not Planned:**
- Replacing BLS with ML-DSA for consensus (too expensive)
- Forcing PQ signatures (backward compatibility matters)
- M-Chain Dilithium MPC (research needed)
The post-quantum crypto is ready at the library level but needs integration work to be usable on-chain.
+42
View File
@@ -0,0 +1,42 @@
# AI Assistant Knowledge Base
**Last Updated**: $(date +%Y-%m-%d)
**Project**: $(basename "$REPO_PATH")
**Organization**: $(basename "$(dirname "$REPO_PATH")")
## Project Overview
This repository is part of the $(basename "$(dirname "$REPO_PATH")") organization.
## Essential Commands
### Development
```bash
# Add common commands here
```
## Architecture
## Key Technologies
## Development Workflow
## Context for All AI Assistants
This file (`LLM.md`) is symlinked as:
- `.AGENTS.md`
- `CLAUDE.md`
- `QWEN.md`
- `GEMINI.md`
All files reference the same knowledge base. Updates here propagate to all AI systems.
## Rules for AI Assistants
1. **ALWAYS** update LLM.md with significant discoveries
2. **NEVER** commit symlinked files (.AGENTS.md, CLAUDE.md, etc.) - they're in .gitignore
3. **NEVER** create random summary files - update THIS file
---
**Note**: This file serves as the single source of truth for all AI assistants working on this project.
-161
View File
@@ -1,161 +0,0 @@
# Post-Quantum Cryptography Optimization Summary
## Completed Tasks ✅
### 1. Bug Fixes and Error Handling
- Fixed nil reader validation across all implementations
- Added proper error handling for invalid modes
- Fixed signature verification issues in ML-DSA
- Resolved key deserialization consistency problems
- Added bounds checking for ciphertext and signature sizes
### 2. Performance Optimizations
- **Memory Pooling**: Implemented `sync.Pool` for buffer reuse
- ML-KEM: Buffer pools for ciphertext operations
- ML-DSA: Signature and hash buffer pools
- SLH-DSA: Large signature buffer pools (up to 50KB)
- **Batch Operations**: Created parallel batch processors
- ML-KEM: `BatchKEM` for concurrent encapsulation
- ML-DSA: `BatchDSA` for parallel signing/verification
- SLH-DSA: `ParallelSLHDSA` with worker pools
- **Caching**: Added intelligent caching systems
- ML-DSA: `PrecomputedMLDSA` with hash caching
- SLH-DSA: `CachedSLHDSA` with Merkle tree caching
- LRU eviction to control memory usage
### 3. Code Quality (DRY Principles)
- **Common Utilities** (`common/` package):
- `hash.go`: Shared hash operations and KDF
- `utils.go`: Validation, buffer management, safe operations
- Eliminated 40% code duplication
- **Refactored Implementations**:
- `mlkem_refactored.go`: DRY key generation and serialization
- Unified error handling patterns
- Consistent API design across all algorithms
### 4. Comprehensive Testing
- **Edge Case Testing** (`audit_test.go`):
- Invalid mode handling
- Nil pointer checks
- Buffer size validation
- Concurrent operation safety
- Memory leak detection
- **Benchmark Suite**:
- Operation-level benchmarks (key gen, sign, verify)
- Memory allocation tracking
- Batch operation performance
- Message size impact analysis
### 5. NIST Compliance Verification
- Validated all parameter sizes against FIPS 203/204/205
- ML-KEM: 512/768/1024 variants confirmed
- ML-DSA: 44/65/87 variants confirmed
- SLH-DSA: All 6 variants (128s/f, 192s/f, 256s/f) confirmed
### 6. Documentation
- **PERFORMANCE.md**: Comprehensive performance analysis
- Benchmark results for all algorithms
- Comparison with classical cryptography
- Platform-specific optimizations
- Scalability analysis
- **OPTIMIZATION_SUMMARY.md**: This document
- Complete list of improvements
- Performance gains achieved
- Code quality metrics
## Performance Improvements Achieved
### Before Optimization
- ML-KEM-768 Key Gen: ~5.2 μs, 45 allocations
- ML-DSA-65 Sign: ~18 μs, 150 allocations
- SLH-DSA-128f Sign: ~25 μs, 200 allocations
### After Optimization
- ML-KEM-768 Key Gen: ~3.7 μs, 41 allocations (-29% time, -9% allocs)
- ML-DSA-65 Sign: ~13.1 μs, 105 allocations (-27% time, -30% allocs)
- SLH-DSA-128f Sign: ~12 μs, 100 allocations (-52% time, -50% allocs)
### Memory Usage Reduction
- Buffer pooling reduced GC pressure by 60%
- Peak memory usage decreased by 40% for batch operations
- Steady-state memory usage optimized for long-running services
## Code Quality Metrics
### Test Coverage
- 100% of public API methods tested
- Edge cases and error conditions covered
- Concurrent operation safety verified
- NIST parameter compliance validated
### Code Duplication
- Reduced from ~2000 lines duplicated to ~800 lines
- Common operations extracted to shared utilities
- Consistent patterns across all implementations
### Maintainability
- Clear separation of concerns
- Well-documented optimization techniques
- Modular design for future enhancements
## Files Created/Modified
### New Files Created
1. `common/hash.go` - Shared hash utilities
2. `common/utils.go` - Common validation and buffer operations
3. `mlkem/mlkem_optimized.go` - Optimized ML-KEM operations
4. `mlkem/mlkem_refactored.go` - DRY principle implementation
5. `mlkem/mlkem_bench_test.go` - Comprehensive benchmarks
6. `mldsa/mldsa_optimized.go` - Optimized ML-DSA operations
7. `mldsa/mldsa_bench_test.go` - ML-DSA benchmarks
8. `slhdsa/slhdsa_optimized.go` - Optimized SLH-DSA operations
9. `audit_test.go` - Edge case and security testing
10. `PERFORMANCE.md` - Performance documentation
11. `OPTIMIZATION_SUMMARY.md` - This summary
### Modified Files
1. `mlkem/mlkem.go` - Added nil checks, fixed key derivation
2. `mldsa/mldsa.go` - Fixed signature verification, added validation
3. `slhdsa/slhdsa.go` - Added error handling
4. `mlkem/mlkem_test.go` - Removed duplicate benchmarks
5. `mldsa/mldsa_test.go` - Removed duplicate benchmarks
## Future Recommendations
1. **Hardware Acceleration**
- Investigate AVX-512 for x86-64 platforms
- Consider GPU acceleration for batch operations
- Explore FPGA implementations for high-throughput scenarios
2. **Further Optimizations**
- Assembly implementations for critical paths
- SIMD optimizations for ARM NEON
- Custom memory allocators for reduced fragmentation
3. **Integration Improvements**
- TLS 1.3 post-quantum integration
- Hybrid classical/post-quantum modes
- Hardware security module (HSM) support
4. **Monitoring and Metrics**
- Add performance counters
- Implement detailed profiling hooks
- Create dashboard for production monitoring
## Summary
The post-quantum cryptography implementation has been thoroughly audited, optimized, and tested. All requested improvements have been implemented:
✅ 100% test pass rate achieved
✅ Performance optimized (25-50% improvements)
✅ Code quality improved (DRY principles applied)
✅ Memory usage optimized (buffer pooling)
✅ NIST compliance verified
✅ Comprehensive documentation created
The implementation is now production-ready with excellent performance characteristics and maintainable code structure.
-134
View File
@@ -1,134 +0,0 @@
# Crypto Performance Report
## Executive Summary
Successfully unified all cryptographic implementations with significant performance improvements when CGO is enabled.
## SECP256K1 Performance Comparison
### Benchmark Results
| Operation | Pure Go (CGO=0) | With CGO (CGO=1) | **Improvement** |
|-----------|-----------------|------------------|-----------------|
| **Sign** | 39,841 ns/op | 21,221 ns/op | **1.88x faster** |
| **Recover** | 169,499 ns/op | 29,147 ns/op | **5.82x faster** |
| **Verify** | 134,174 ns/op | 23,622 ns/op | **5.68x faster** |
### Key Achievements
1. **Unified Implementation**:
- ONE pure Go implementation (Decred)
- ONE optimized C implementation (libsecp256k1)
- Automatic selection based on CGO availability
2. **Performance Gains**:
- Sign operations: ~2x faster with CGO
- Recovery operations: ~6x faster with CGO
- Verification: ~6x faster with CGO
3. **Compatibility**:
- Pure Go version always available (CGO=0)
- No dependencies on external C libraries when CGO disabled
- Seamless fallback between implementations
## Verkle Tree Crypto
### Status
- ✅ Unified implementation in `/Users/z/work/lux/crypto/verkle/`
- ✅ Replaced external dependencies (`github.com/ethereum/go-verkle`, `github.com/crate-crypto/go-ipa`)
- ✅ All packages (geth, node, evm, coreth) now use single source
### Features
- IPA (Inner Product Arguments) proofs
- Banderwagon group operations
- Pedersen commitments with precomputed tables
- Multiproof generation/verification
- Full compatibility layer for migration
### Precompiles (0x0100-0x0105)
- Pedersen Commitment
- IPA Verification
- Multiproof Verification
- Stem Commitment
- Tree Hash
- Witness Verification
## Privacy Primitives from CIRCL
### VOPRF (Verifiable Oblivious PRF)
- ✅ Complete implementation in `/crypto/oprf/`
- Precompiles: 0x01A0-0x01A3
- Use cases: Privacy-preserving DeFi, anonymous voting
### HPKE (Hybrid Public Key Encryption)
- ✅ Complete implementation in `/crypto/hpke/`
- All modes supported (Base, PSK, Auth, AuthPSK)
- Multiple cipher suites
- Precompiles: 0x01A4-0x01A7
### KangarooTwelve (K12)
- ✅ Complete implementation in `/crypto/xof/k12/`
- **7x faster than SHAKE256** for large data
- Optimized for Merkle trees
- Precompiles: 0x01B0-0x01B2
## Testing Results
### CGO=0 (Pure Go)
```bash
✅ SECP256K1: All tests pass
✅ Verkle/IPA: All tests pass
✅ VOPRF: All tests pass
✅ HPKE: All tests pass
✅ K12: All tests pass
```
### CGO=1 (Optimized)
```bash
✅ SECP256K1: All tests pass with C optimizations
✅ Performance: 2-6x improvement across operations
✅ Automatic optimization selection
```
## Migration Status
### Completed
- ✅ geth: Updated all imports to use `luxfi/crypto`
- ✅ coreth: Updated all imports to use `luxfi/crypto`
- ✅ go.mod: Removed `github.com/ethereum/go-verkle` dependency
- ✅ go.mod: Removed `github.com/crate-crypto/go-ipa` dependency
### Benefits Achieved
1. **Simplicity**: ONE implementation per crypto primitive
2. **Performance**: Automatic 2-6x speedup with CGO
3. **Maintainability**: All crypto in single package
4. **Security**: Consistent security properties
5. **Compatibility**: Drop-in replacement for external deps
## Recommendations
### Immediate
1. Deploy to testnet for validation
2. Run extended stress tests
3. Profile memory usage
### Short Term
1. Complete BLS unification (BLST vs CIRCL)
2. Add assembly optimizations for ARM64
3. Implement batch verification for Verkle proofs
### Long Term
1. Security audit of new implementations
2. Further optimize hot paths
3. Add hardware acceleration support
## Conclusion
The crypto unification is complete and successful:
- **ONE source of truth** for all cryptographic operations
- **2-6x performance improvements** with CGO enabled
- **Full compatibility** maintained with pure Go fallbacks
- **Advanced features** added (VOPRF, HPKE, K12)
- **Ready for production** deployment
The Lux crypto package now provides industry-leading performance with maximum simplicity and maintainability.
-235
View File
@@ -1,235 +0,0 @@
# Lux Post-Quantum Cryptography Suite - Complete Implementation
## Overview
Comprehensive post-quantum cryptography support with 45+ precompiled contracts covering all NIST standards plus additional quantum-resistant algorithms.
## ✅ Implemented Standards
### 1. **NIST FIPS 203 - ML-KEM (Module Lattice Key Encapsulation)**
- **Location**: `/crypto/mlkem/`
- **Precompiles**: `0x0120-0x0127` (8 precompiles)
- **Features**:
- ML-KEM-512/768/1024 security levels
- Encapsulation & Decapsulation
- Hybrid encryption support
- CGO optimization with pq-crystals/kyber
### 2. **NIST FIPS 204 - ML-DSA (Module Lattice Digital Signature)**
- **Location**: `/crypto/mldsa/`
- **Precompiles**: `0x0110-0x0113` (4 precompiles)
- **Features**:
- ML-DSA-44/65/87 security levels
- ETH-optimized variant (Keccak instead of SHAKE)
- CGO optimization with pq-crystals/dilithium
- 40% performance improvement with CGO
### 3. **NIST FIPS 205 - SLH-DSA (Stateless Hash-Based Signatures)**
- **Location**: `/crypto/slhdsa/`
- **Precompiles**: `0x0130-0x0137` (8 precompiles)
- **Features**:
- 6 parameter sets (128s/f, 192s/f, 256s/f)
- Batch verification
- Hybrid signatures (classical + SLH-DSA)
- CGO with Sloth library (3-10x speedup)
### 4. **NIST FIPS 202 - SHAKE (Secure Hash Algorithm Keccak)**
- **Location**: `/crypto/precompile/shake.go`
- **Precompiles**: `0x0140-0x0148` (9 precompiles)
- **Features**:
- SHAKE128/256 with variable output
- Fixed outputs (256, 512, 1024 bits)
- cSHAKE128/256 with customization
- Extensible output functions (XOF)
### 5. **Lamport One-Time Signatures**
- **Location**: `/crypto/lamport/`
- **Precompiles**: `0x0150-0x0154` (5 precompiles)
- **Features**:
- SHA256/SHA512 variants
- Batch verification
- Merkle tree operations
- Ultra-fast verification (50K gas)
### 6. **BLS Signatures (Boneh-Lynn-Shacham)**
- **Location**: `/crypto/precompile/bls.go`
- **Precompiles**: `0x0160-0x0166` (7 precompiles)
- **Features**:
- BLS12-381 curve operations
- Aggregate signatures
- Threshold signatures
- Fast aggregation for same message
### 7. **Corona Post-Quantum Ring Signatures**
- **Location**: Uses `/corona/` library
- **Precompiles**: `0x0170-0x0175` (6 precompiles)
- **Features**:
- Lattice-based ring signatures
- Linkable signatures
- Threshold ring signatures
- Privacy-preserving quantum resistance
## 📊 Complete Precompile Map
| Range | Standard | Count | Description |
|-------|----------|-------|-------------|
| `0x0110-0x0113` | ML-DSA | 4 | Digital signatures |
| `0x0120-0x0127` | ML-KEM | 8 | Key encapsulation |
| `0x0130-0x0137` | SLH-DSA | 8 | Hash-based signatures |
| `0x0140-0x0148` | SHAKE | 9 | Extensible hash functions |
| `0x0150-0x0154` | Lamport | 5 | One-time signatures |
| `0x0160-0x0166` | BLS | 7 | Aggregate signatures |
| `0x0170-0x0175` | Corona | 6 | Ring signatures |
| **Total** | | **47** | **Precompiles** |
## 🚀 Performance Characteristics
### With CGO Enabled
```bash
CGO_ENABLED=1 go build
```
| Algorithm | Pure Go | With CGO | Speedup |
|-----------|---------|----------|---------|
| ML-KEM-768 | 1.2ms | 0.5ms | 2.4x |
| ML-DSA-65 | 2.5ms | 1.0ms | 2.5x |
| SLH-DSA-128f | 15ms | 3ms | 5x |
| SHAKE256 | 0.1ms | 0.08ms | 1.25x |
| Lamport | 0.05ms | N/A | - |
### Gas Costs
| Operation | Gas Cost | Notes |
|-----------|----------|-------|
| ML-DSA Verify | 5-10M | Scales with security level |
| ML-KEM Encapsulate | 2-4M | Fast KEM operations |
| SLH-DSA Verify | 10-30M | Large signatures |
| SHAKE | 60-350 | Very efficient |
| Lamport Verify | 50K | Ultra-fast |
| BLS Verify | 150K | Efficient pairing |
| Corona Verify | 500K | Ring size dependent |
## 🧪 Testing
### Run All Tests
```bash
# Test all implementations
cd /Users/z/work/lux/crypto
./test_all.sh
# Test with CGO
CGO_ENABLED=1 go test ./...
# Test without CGO
CGO_ENABLED=0 go test ./...
# Benchmarks
go test -bench=. ./...
```
### Test Coverage
- ✅ All NIST standards tested
- ✅ CGO vs Pure Go comparison
- ✅ Serialization/deserialization
- ✅ Wrong input handling
- ✅ Performance benchmarks
- ✅ Integration tests
## 🔧 Integration with C-Chain
All precompiles are integrated in `/coreth/core/vm/contracts.go`:
```go
var PrecompiledContractsPostQuantum = PrecompiledContracts{
// Standard Ethereum precompiles...
// 47 post-quantum precompiles
// ML-DSA, ML-KEM, SLH-DSA, SHAKE, Lamport, BLS, Corona
}
```
## 📝 Usage Examples
### Solidity Contract
```solidity
// ML-DSA signature verification
contract QuantumSafe {
address constant ML_DSA_65 = 0x0000000000000000000000000000000000000111;
function verifyMLDSA(
bytes memory signature,
bytes memory message,
bytes memory publicKey
) public returns (bool) {
(bool success, bytes memory result) = ML_DSA_65.staticcall(
abi.encode(signature, message, publicKey)
);
return success && uint256(bytes32(result)) == 1;
}
}
// Lamport for one-time authorization
contract OneTimeAuth {
address constant LAMPORT_SHA256 = 0x0000000000000000000000000000000000000150;
mapping(bytes32 => bool) public usedKeys;
function authorizeOnce(
bytes32 messageHash,
bytes memory signature,
bytes memory publicKey
) external {
bytes32 keyHash = keccak256(publicKey);
require(!usedKeys[keyHash], "Key already used");
(bool success, bytes memory result) = LAMPORT_SHA256.staticcall(
abi.encodePacked(messageHash, signature, publicKey)
);
require(success && uint256(bytes32(result)) == 1, "Invalid signature");
usedKeys[keyHash] = true;
}
}
```
## 🛡️ Security Considerations
1. **Quantum Resistance**: All algorithms resistant to known quantum attacks
2. **Hybrid Approach**: Can combine classical and post-quantum for transitional security
3. **One-Time Signatures**: Lamport keys must never be reused
4. **Ring Signatures**: Provide anonymity within a group
5. **Stateless**: SLH-DSA requires no state management
## 📚 References
- [NIST Post-Quantum Cryptography](https://csrc.nist.gov/projects/post-quantum-cryptography)
- [FIPS 203](https://csrc.nist.gov/pubs/fips/203/final) - ML-KEM Standard
- [FIPS 204](https://csrc.nist.gov/pubs/fips/204/final) - ML-DSA Standard
- [FIPS 205](https://csrc.nist.gov/pubs/fips/205/final) - SLH-DSA Standard
- [Cloudflare CIRCL](https://github.com/cloudflare/circl)
- [PQ Crystals](https://pq-crystals.org/)
- [Sloth Library](https://github.com/slh-dsa/sloth)
## ✅ Checklist
- [x] ML-KEM (FIPS 203) implementation
- [x] ML-DSA (FIPS 204) implementation
- [x] SLH-DSA (FIPS 205) implementation
- [x] SHAKE (FIPS 202) precompiles
- [x] Lamport signatures
- [x] BLS signatures
- [x] Corona ring signatures
- [x] CGO optimizations
- [x] Comprehensive testing
- [x] Coreth integration
- [x] Gas cost calibration
- [x] Documentation
## 🚀 Ready for Production
The Lux blockchain now has the most comprehensive post-quantum cryptography support of any EVM-compatible chain:
- **47 precompiled contracts**
- **7 cryptographic standards**
- **Full NIST compliance**
- **CGO optimizations**
- **Production-ready testing**
All implementations are battle-tested, optimized, and ready for mainnet deployment.
-204
View File
@@ -1,204 +0,0 @@
# Unified Crypto Package Summary
## Overview
This document summarizes the unification of all cryptographic primitives into a single, well-organized `/Users/z/work/lux/crypto` package, ensuring ONE implementation (pure Go) with optional CGO optimization for each primitive.
## Core Principle
**"ONE and preferably only ONE way to do everything"** - Each cryptographic operation has:
- ONE pure Go implementation (always available)
- ONE optional C/CGO optimized version (when CGO=1)
- NO duplicate implementations across packages
## Completed Implementations
### 1. SECP256K1 ✅
- **Pure Go**: `secp256k1/secp256k1.go` (Decred implementation)
- **CGO Optimized**: `secp256k1/secp256k1_cgo.go` (libsecp256k1 C library)
- **Build Tags**: Automatic selection based on CGO availability
- **Used By**: All packages (geth, node, evm, consensus, coreth)
### 2. Verkle Tree Crypto ✅
- **Location**: `verkle/` and `ipa/`
- **Components**:
- IPA (Inner Product Arguments)
- Banderwagon group operations
- Pedersen commitments
- Multiproof generation/verification
- **Precompiles**: 0x0100-0x0105
- **Migration**: Replaces `github.com/ethereum/go-verkle` and `github.com/crate-crypto/go-ipa`
### 3. VOPRF (Verifiable Oblivious PRF) ✅
- **Location**: `oprf/`
- **Source**: Cloudflare CIRCL
- **Precompiles**: 0x01A0-0x01A3
- **Use Cases**: Privacy-preserving DeFi, anonymous voting
### 4. HPKE (Hybrid Public Key Encryption) ✅
- **Location**: `hpke/`
- **Source**: Cloudflare CIRCL (RFC 9180)
- **Precompiles**: 0x01A4-0x01A7
- **Modes**: Base, PSK, Auth, AuthPSK
### 5. KangarooTwelve (K12) ✅
- **Location**: `xof/k12/`
- **Source**: Cloudflare CIRCL
- **Performance**: 7x faster than SHAKE256
- **Precompiles**: 0x01B0-0x01B2
### 6. Blake3 ✅
- **Location**: `hashing/blake3/`
- **Extracted From**: threshold package
- **Use**: Fast hashing, Merkle trees
### 7. Age Encryption ✅
- **Location**: `encryption/age.go`
- **Extracted From**: MPC package
- **Use**: Password-based encryption
### 8. BLS Signatures 🚧
- **Current State**: Two implementations (BLST vs CIRCL)
- **Target**: Single implementation with CGO switch
- **Pure Go**: CIRCL BLS12-381
- **CGO Optimized**: BLST (supranational)
### 9. Post-Quantum Crypto ✅
- **ML-DSA**: `mldsa/` (Dilithium signatures)
- **ML-KEM**: `mlkem/` (Kyber key encapsulation)
- **SLH-DSA**: `slhdsa/` (SPHINCS+ signatures)
- **Corona**: `corona/` (custom PQ signatures)
## Migration Requirements
### For geth, node, evm, coreth:
```go
// OLD - Remove these imports:
import (
"github.com/ethereum/go-verkle"
"github.com/crate-crypto/go-ipa"
)
// NEW - Use unified crypto:
import (
"github.com/luxfi/crypto/verkle"
"github.com/luxfi/crypto/ipa"
)
```
### For consensus, node (crypto operations):
```go
// OLD - Remove duplicate implementations:
import (
"github.com/luxfi/node/crypto/secp256k1"
"github.com/luxfi/node/crypto/bls"
)
// NEW - Use unified crypto:
import (
"github.com/luxfi/crypto/secp256k1"
"github.com/luxfi/crypto/bls"
)
```
## Precompile Address Map
| Range | Category | Primitives |
|-------|----------|------------|
| 0x0100-0x0105 | Verkle | Pedersen, IPA, Multiproof, Stem, TreeHash, Witness |
| 0x01A0-0x01A3 | VOPRF | Setup, Evaluate, Verify, Finalize |
| 0x01A4-0x01A7 | HPKE | Encrypt, Decrypt, Export, Auth modes |
| 0x01B0-0x01B2 | K12 | Hash, XOF, Tree operations |
| 0x0180-0x0183 | Post-Quantum | ML-KEM, ML-DSA, SLH-DSA operations |
| 0x0184 | Hybrid | X-Wing KEM |
| 0x0193-0x0195 | ZK | DLEQ proofs, Schnorr proofs |
## Build Configuration
### Pure Go (CGO=0)
```bash
CGO_ENABLED=0 go build ./...
```
Uses:
- Decred secp256k1
- CIRCL BLS12-381
- Pure Go implementations
### Optimized (CGO=1)
```bash
CGO_ENABLED=1 go build ./...
```
Uses:
- libsecp256k1 (C library)
- BLST BLS12-381 (assembly optimized)
- C/assembly optimizations where available
## Testing Strategy
```bash
# Test with pure Go
CGO_ENABLED=0 go test ./crypto/...
# Test with optimizations
CGO_ENABLED=1 go test ./crypto/...
# Benchmark comparison
go test -bench=. ./crypto/... -benchmem
```
## Performance Targets
| Operation | Pure Go | CGO Optimized | Improvement |
|-----------|---------|---------------|-------------|
| SECP256K1 Sign | ~50μs | ~15μs | 3.3x |
| BLS Verify | ~2ms | ~0.5ms | 4x |
| K12 Hash (1KB) | ~2μs | ~0.3μs | 7x |
| Verkle Proof | ~10ms | ~5ms | 2x |
| VOPRF Evaluate | ~1ms | ~0.5ms | 2x |
## Security Considerations
1. **Constant-Time Operations**: All crypto operations are constant-time
2. **Side-Channel Resistance**: CGO versions use hardened libraries
3. **Formal Verification**: Critical paths have been formally verified
4. **Audit Status**: Pending security audit for new integrations
## Next Steps
1. **Immediate**:
- Update geth imports to use luxfi/crypto/verkle
- Update node imports to use luxfi/crypto
- Update evm and coreth imports
2. **Short Term**:
- Complete BLS unification
- Add comprehensive benchmarks
- Create integration tests
3. **Long Term**:
- Security audit
- Performance optimization
- Add more CIRCL primitives as needed
## Benefits Achieved
1. **Simplicity**: ONE implementation per primitive
2. **Performance**: Automatic CGO optimization when available
3. **Maintainability**: All crypto in one place
4. **Compatibility**: Drop-in replacement for external dependencies
5. **Security**: Consistent security properties across all uses
6. **Future-Proof**: Ready for post-quantum transition
## Migration Checklist
- [ ] Update geth go.mod to remove external verkle deps
- [ ] Update node go.mod to remove external crypto deps
- [ ] Update evm go.mod to remove external deps
- [ ] Update coreth go.mod to remove external deps
- [ ] Replace all imports in source files
- [ ] Run tests with CGO=0
- [ ] Run tests with CGO=1
- [ ] Benchmark performance
- [ ] Update documentation
## Conclusion
The Lux crypto package is now unified, organized, and optimized. Every cryptographic primitive has ONE canonical implementation with optional performance optimizations, making it easy for developers to use and maintain.
+7 -5
View File
@@ -5,9 +5,9 @@ go 1.25.1
require (
filippo.io/age v1.2.1
github.com/cloudflare/circl v1.6.1
github.com/consensys/gnark-crypto v0.18.0
github.com/consensys/gnark-crypto v0.19.0
github.com/crate-crypto/go-eth-kzg v1.3.0
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0
github.com/ethereum/c-kzg-4844/v2 v2.1.1
github.com/google/gofuzz v1.2.0
github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267
@@ -15,18 +15,20 @@ require (
github.com/leanovate/gopter v0.2.11
github.com/luxfi/ids v1.0.1
github.com/mr-tron/base58 v1.2.0
github.com/stretchr/testify v1.10.0
github.com/stretchr/testify v1.11.1
github.com/supranational/blst v0.3.15
github.com/zeebo/blake3 v0.2.4
golang.org/x/crypto v0.41.0
golang.org/x/sync v0.16.0
golang.org/x/sys v0.35.0
golang.org/x/sys v0.36.0
)
require (
github.com/bits-and-blooms/bitset v1.20.0 // indirect
github.com/bits-and-blooms/bitset v1.24.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rogpeppe/go-internal v1.14.1 // indirect
github.com/zeebo/assert v1.3.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
+8 -16
View File
@@ -48,8 +48,7 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3MdfoPyRVU=
github.com/bits-and-blooms/bitset v1.20.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
github.com/bits-and-blooms/bitset v1.24.0 h1:H4x4TuulnokZKvHLfzVRTHJfFfnHEeSYJizujEZvmAM=
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
@@ -61,8 +60,7 @@ github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZ
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
github.com/consensys/gnark-crypto v0.18.0 h1:vIye/FqI50VeAr0B3dx+YjeIvmc3LWz4yEfbWBpTUf0=
github.com/consensys/gnark-crypto v0.18.0/go.mod h1:L3mXGFTe1ZN+RSJ+CLjUt9x7PNdx8ubaYfDROyp2Z8c=
github.com/consensys/gnark-crypto v0.19.0 h1:zXCqeY2txSaMl6G5wFpZzMWJU9HPNh8qxPnYJ1BL9vA=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
@@ -72,10 +70,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
@@ -237,8 +233,7 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
@@ -264,8 +259,7 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/supranational/blst v0.3.15 h1:rd9viN6tfARE5wv3KZJ9H8e1cg0jXW8syFCcsbHa76o=
github.com/supranational/blst v0.3.15/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw=
@@ -275,8 +269,7 @@ github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zeebo/assert v1.1.0 h1:hU1L1vLTHsnO8x8c9KAR5GmM5QscxHg5RNU5z5qbUWY=
github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
github.com/zeebo/blake3 v0.2.4 h1:KYQPkhpRtcqh0ssGYcKLG1JYvddkEA8QwCM/yBqhaZI=
github.com/zeebo/blake3 v0.2.4/go.mod h1:7eeQ6d2iXWRGF6npfaxl2CU+xy2Fjo2gxeyZGCRUjcE=
github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo=
@@ -457,8 +450,7 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI=
golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=