Commit graph

120 commits

Author SHA1 Message Date
Gulshan Yadav
4a2825f516 feat(api): add public API gateway with rate limiting
- Create API gateway service with Express.js
- Implement sliding window rate limiting via Redis
- Add API key management with tiered access (free/developer/enterprise)
- Track usage analytics per key and globally
- Add RPC proxy to blockchain nodes
- Configure Docker Compose with api-gateway and redis services
- Free tier: 100 req/min, Developer: 1000 req/min, Enterprise: unlimited
2026-01-10 06:19:08 +05:30
Gulshan Yadav
d121759d2c feat(web-wallet): add multi-language support (i18n)
- Add i18next, react-i18next, and browser language detection
- Create translations for 6 languages: English, Chinese, Spanish, Korean, Japanese, Russian
- Add LanguageSelector component for settings page
- Integrate language selection into Settings page with translated security options
- Language preference persists to localStorage
2026-01-10 06:12:10 +05:30
Gulshan Yadav
fd7f6446ea feat(web-wallet): add hardware wallet support (Ledger/Trezor)
- Add hardware-wallet.ts with Ledger and Trezor integration
- Create HardwareWalletConnect.tsx component for wallet selection UI
- Add Hardware Wallet section to Settings page
- Support WebHID transport for Ledger (Nano S/X/S Plus)
- Support Trezor Connect for Trezor Model T/One
- Implement hybrid signature flow for hardware wallets:
  - Ed25519 signed on hardware device (key never leaves device)
  - Dilithium3 requested from server (for post-quantum protection)

Dependencies added:
- @ledgerhq/hw-transport-webhid: WebHID transport for Ledger
- @trezor/connect-web: Trezor Connect integration

Note: Hardware wallets don't support Dilithium3 yet, so the hybrid
signature scheme uses server-side Dilithium signing with Ed25519 proof.
2026-01-10 06:03:24 +05:30
Gulshan Yadav
a439389943 feat(web-wallet): add QR code generation and scanning support
- Add QRCode component using qrcode.react (SVG-based, H error correction)
- Add QRScanner component using html5-qrcode for camera-based scanning
- Update Receive page with real QR code and payment request amount
- Update Send page with QR scan button to auto-fill recipient address
- Support Synor payment URI format: synor:address?amount=X
- Add Dockerfile for web wallet with nginx serving
- Add web-wallet service to docker-compose.testnet.yml (port 17300)
- Fix TypeScript WebCrypto ArrayBuffer type issues

QR features:
- SVG rendering for crisp display at any size
- Error correction level H (30% recovery) for printed codes
- Camera permission handling with user-friendly error states
- Auto-fill amount when scanning payment requests
2026-01-10 05:53:34 +05:30
Gulshan Yadav
e0475176c5 docs: update ecosystem milestone progress after Dilithium3 WASM completion 2026-01-10 05:35:13 +05:30
Gulshan Yadav
3041c6d654 feat(crypto-wasm): add deterministic Dilithium3 key derivation and hybrid signatures
This commit enables full wallet recovery from BIP-39 mnemonics by implementing
deterministic Dilithium3 key derivation using HKDF-SHA3-256 with domain separation.

Changes:
- crates/synor-crypto-wasm: Implement deterministic Dilithium keygen
  - Use HKDF with info="synor:dilithium:v1" for key derivation
  - Enable pqc_dilithium's crypto_sign_keypair via dilithium_kat cfg flag
  - Add proper memory zeroization on drop
  - Add tests for deterministic key generation

- apps/web: Update transaction signing for hybrid signatures
  - Add signTransactionHybrid() for Ed25519 + Dilithium3 signatures
  - Add createSendTransactionHybrid() for quantum-resistant transactions
  - Update fee estimation for larger hybrid signature size (~5.5KB/input)
  - Maintain legacy Ed25519-only functions for backwards compatibility

- WASM module: Rebuild with deterministic keygen
  - Update synor_crypto_bg.wasm with new implementation
  - Module size reduced to ~470KB (optimized)

- Documentation updates:
  - Update mobile wallet plan: React Native -> Flutter
  - Add testnet-first approach note
  - Update explorer frontend progress to 90%
2026-01-10 05:34:26 +05:30
Gulshan Yadav
6b5a232a5e feat: Desktop wallet, gas estimator UI, and 30-day monitoring stack
Security (Desktop Wallet):
- Implement BIP39 mnemonic generation with cryptographic RNG
- Add Argon2id password-based key derivation (64MB, 3 iterations)
- Add ChaCha20-Poly1305 authenticated encryption for seed storage
- Add mnemonic auto-clear (60s timeout) and clipboard auto-clear (30s)
- Add sanitized error logging to prevent credential leaks
- Strengthen CSP with object-src, base-uri, form-action, frame-ancestors
- Clear sensitive state on component unmount

Explorer (Gas Estimator):
- Add Gas Estimation page with from/to/amount/data inputs
- Add bech32 address validation (synor1/tsynor1 prefix)
- Add BigInt-based amount parsing to avoid floating point errors
- Add production guard for mock mode (cannot enable in prod builds)

Monitoring (30-day Testnet):
- Add Prometheus config with 30-day retention
- Add comprehensive alert rules for node health, consensus, network, mempool
- Add Alertmanager with severity-based routing and inhibition rules
- Add Grafana with auto-provisioned datasource and dashboard
- Add Synor testnet dashboard with uptime SLA tracking

Docker:
- Update docker-compose.testnet.yml with monitoring profile
- Fix node-exporter for macOS Docker Desktop compatibility
- Change Grafana port to 3001 to avoid conflict
2026-01-10 04:38:09 +05:30
Gulshan Yadav
1606776394 feat: Phase 7 critical tasks - security, formal verification, WASM crypto
## Formal Verification
- Add TLA+ specs for UTXO conservation (formal/tla/UTXOConservation.tla)
- Add TLA+ specs for GHOSTDAG ordering (formal/tla/GHOSTDAGOrdering.tla)
- Add mathematical proof of DAA convergence (formal/proofs/)
- Document Kani verification approach (formal/kani/)

## Bug Bounty Program
- Add SECURITY.md with vulnerability disclosure process
- Add docs/BUG_BOUNTY.md with $500-$100,000 reward tiers
- Define scope, rules, and response SLA

## Web Wallet Dilithium3 WASM Integration
- Build WASM module via Docker (498KB optimized)
- Add wasm-crypto.ts lazy loader for Dilithium3
- Add createHybridSignatureLocal() for full client-side signing
- Add createHybridSignatureSmart() for auto-mode selection
- Add Dockerfile.wasm and build scripts

## Security Review ($0 Approach)
- Add .github/workflows/security.yml CI workflow
- Add deny.toml for cargo-deny license/security checks
- Add Dockerfile.security for audit container
- Add scripts/security-audit.sh for local audits
- Configure cargo-audit, cargo-deny, cargo-geiger, gitleaks
2026-01-10 01:40:03 +05:30
Gulshan Yadav
16c7e87a66 fix(explorer): fix RPC method calls and add WebSocket support
- Fix health check to use RPC call instead of GET /health
- Update API endpoints to use correct RPC method names:
  - synor_getInfo, synor_getMiningInfo, synor_getTips
  - synor_getBlockCount, synor_getBlueScore, synor_getBlocksByBlueScore
- Fix response format handling (synor_getTips returns {tips: [...]})
- Add WebSocket endpoint at /ws for real-time updates:
  - stats_update events (every second)
  - new_block events on block detection
  - tip_update events on DAG changes
- Add ws feature to axum and tokio-tungstenite dependency
2026-01-08 13:15:40 +05:30
Gulshan Yadav
4d7171f4bf a 2026-01-08 09:24:26 +05:30
Gulshan Yadav
6094319ddf feat(crypto-wasm): add Dilithium3 post-quantum signatures
Implements WASM-compatible Dilithium3 (ML-DSA-65) signatures using the
pure Rust pqc_dilithium crate. This provides NIST Security Category 3
post-quantum signature support for the web wallet.

Changes:
- Add pqc_dilithium dependency with WASM feature
- Create DilithiumSigningKey wrapper for WASM bindings
- Add dilithiumVerify and dilithiumSizes helper functions
- Update tests to work on both native and WASM targets
- Update README to reflect completed Dilithium3 support

Key sizes (Dilithium3 / ML-DSA-65):
- Public Key: 1,952 bytes
- Signature: 3,293 bytes
2026-01-08 07:31:36 +05:30
Gulshan Yadav
b22c1b89f0 feat: Phase 7 production readiness improvements
- Add SYNOR_BOOTSTRAP_PEERS env var for runtime seed node configuration
- Implement secrets provider abstraction for faucet wallet key security
  (supports file-based secrets in /run/secrets for production)
- Create WASM crypto crate foundation for web wallet (Ed25519, BIP-39)
- Add DEPLOYMENT.md guide for testnet deployment
- Add SECURITY_AUDIT_SCOPE.md for external security audit preparation
- Document seed node deployment process in synor-network

Security improvements:
- Faucet now auto-detects /run/secrets for secure key storage
- CORS already defaults to specific origins (https://faucet.synor.cc)
- Bootstrap peers now configurable at runtime without recompilation
2026-01-08 07:21:14 +05:30
Gulshan Yadav
8bdc9d6086 style: apply cargo fmt formatting 2026-01-08 06:23:23 +05:30
Gulshan Yadav
5c643af64c fix: resolve all clippy warnings for CI
Fix all Rust clippy warnings that were causing CI failures when built
with RUSTFLAGS=-Dwarnings. Changes include:

- Replace derivable_impls with derive macros for BlockBody, Network, etc.
- Use div_ceil() instead of manual implementation
- Fix should_implement_trait by renaming from_str to parse
- Add type aliases for type_complexity warnings
- Use or_default(), is_some_and(), is_multiple_of() where appropriate
- Remove needless borrows and redundant closures
- Fix manual_strip with strip_prefix()
- Add allow attributes for intentional patterns (too_many_arguments,
  needless_range_loop in cryptographic code, assertions_on_constants)
- Remove unused imports, mut bindings, and dead code in tests
2026-01-08 05:58:22 +05:30
Gulshan Yadav
8dac870e5e chore: add .vite to gitignore 2026-01-08 05:22:24 +05:30
Gulshan Yadav
d917f1ed22 style: format all Rust code with cargo fmt 2026-01-08 05:22:24 +05:30
Gulshan Yadav
ae0a9d7cfa fix(ci): correct rust-toolchain action name
Changed dtolnay/rust-action to dtolnay/rust-toolchain
2026-01-08 05:22:18 +05:30
Gulshan Yadav
ef9a8cd50f ci: add GitHub Actions workflows
- CI workflow for Rust and web builds
- Release workflow for automated releases
2026-01-08 05:22:17 +05:30
Gulshan Yadav
65b55637d8 chore: remove workflows temporarily for initial push 2026-01-08 05:22:17 +05:30
Gulshan Yadav
48949ebb3f Initial commit: Synor blockchain monorepo
A complete blockchain implementation featuring:
- synord: Full node with GHOSTDAG consensus
- explorer-web: Modern React blockchain explorer with 3D DAG visualization
- CLI wallet and tools
- Smart contract SDK and example contracts (DEX, NFT, token)
- WASM crypto library for browser/mobile
2026-01-08 05:22:17 +05:30