System Architecture
Sphyre is built on a modular, decentralized architecture that separates concerns across multiple specialized applications. This design ensures scalability, security, and maintainability.High-Level Architecture
Core Components
1. Fortro Engine (Backend API)
The central backend service that orchestrates all SSI operations. Technology Stack:- Language: Rust
- Framework: Axum (Tokio runtime)
- Database: MongoDB
- Storage: IPFS (Kubo)
- Blockchain: Ethereum (ethers-rs)
- Messaging: Async tasks via Tokio +
towermiddleware
- Modular Axum routers (
/api/auth,/api/wallet,/api/issuer,/api/verifier,/api/qr,/api/presentation-request,/api/consent) - Shared
AppStatefor database, IPFS, and blockchain clients - JWT-based authentication and DID extraction middleware
- Post-quantum cryptography (Kyber-Dilithium)
- Meta-transaction support (Minimal Forwarder)
- Automatic credential verification and presentation polling
Learn More
Detailed Fortro Engine documentation
2. Sphyre ALV (User Wallet)
Progressive Web App for end-users to manage their digital identity. Technology Stack:- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Crypto: tweetnacl, bip39
- UI: TailwindCSS, shadcn/ui
- 12-word seed phrase generation
- DID creation and management
- Credential storage and presentation
- QR code scanning
- Consent management
- Zero-knowledge proof generation
- Offline mode support
Learn More
Detailed Sphyre ALV documentation
3. Sphyre Issuers (Issuer Dashboard)
Web application for organizations to issue and manage credentials. Technology Stack:- Framework: React 18
- Language: TypeScript
- State Management: React Context
- UI: TailwindCSS, Material-UI
- Schema creation and management
- Template customization
- Credential issuance workflow
- Request approval system
- Credential revocation
- Analytics dashboard
Learn More
Detailed Sphyre Issuers documentation
4. Sphyre Verifier (Verification Portal)
Application for organizations to request and verify credentials. Technology Stack:- Framework: Next.js 14
- Language: TypeScript
- UI: TailwindCSS, shadcn/ui
- Presentation request creation
- QR code generation for requests
- Credential verification
- Selective disclosure support
- Zero-knowledge proof verification
- Verification history
Learn More
Detailed Sphyre Verifier documentation
Data Flow Architecture
Credential Issuance Flow
Credential Verification Flow
Storage Architecture
MongoDB Collections
IPFS Storage
Credentials are stored on IPFS for decentralized, content-addressed storage:Blockchain Anchoring
Credential hashes are anchored on Ethereum for immutability:Security Architecture
Cryptographic Layer
Post-Quantum Crypto
Kyber for key encapsulation
Dilithium for digital signatures
BBS+ for selective disclosure proofs
Dilithium for digital signatures
BBS+ for selective disclosure proofs
DID Generation
Ed25519 key pair from seed phrase
did:alyra: + base64(publicKey)Credential Signing
Issuer signs with Dilithium
Proof attached to credential
Proof attached to credential
Zero-Knowledge Proofs
Selective disclosure without revealing data
Age verification, citizenship, etc.
Age verification, citizenship, etc.
Authentication Flow
Network Architecture
Deployment Topology
API Communication
All frontend applications communicate with Fortro Engine via REST API: Base URL:https://api.sphyre.tech
Authentication:
- Allowed origins:
https://app.sphyre.tech,https://issuers.sphyre.tech,https://verifier.sphyre.tech,https://sphyre.tech - Methods: GET, POST, PUT, DELETE, PATCH, OPTIONS
- Headers: Content-Type, Authorization, X-User-DID, X-Issuer-DID
- Credentials:
omit(JWT sent via Authorization header)
Performance & Scalability
Optimization Strategies
API Performance
API Performance
- Rust’s zero-cost abstractions for maximum speed
- Async I/O with Tokio runtime
- Connection pooling for database and IPFS
- Response caching for frequently accessed data
Database Optimization
Database Optimization
- Indexed queries on DID and credential ID
- Aggregation pipelines for analytics
- TTL indexes for expired credentials
- Sharding for horizontal scaling
Frontend Optimization
Frontend Optimization
- Next.js static generation where possible
- Image optimization and lazy loading
- Code splitting and tree shaking
- Service worker for offline support
Network Optimization
Network Optimization
- CDN for static assets
- Gzip/Brotli compression
- HTTP/2 multiplexing
- WebSocket for real-time updates
Design Principles
1
Decentralization
No single point of failure. Data distributed across IPFS and blockchain.
2
Privacy by Design
Minimal data collection. User controls data sharing. ZKP for selective disclosure.
3
Security First
Post-quantum cryptography, DID challenges, meta-transaction signer separation. Defense in depth. Regular security audits.
4
Interoperability
W3C standards compliance. OpenAPI specification. RESTful design.
5
User Experience
Simple interfaces. Progressive enhancement. Offline functionality.
Technology Decisions
| Aspect | Technology | Rationale |
|---|---|---|
| Backend Language | Rust + Axum + Tokio | Performance, memory safety, async concurrency |
| Frontend Framework | Next.js/React | Developer experience, SEO, SSR/SSG |
| Database | MongoDB | Flexible schema, JSON storage, scalability |
| Storage | IPFS (Kubo) | Decentralized, content-addressed, permanent |
| Blockchain | Ethereum (ethers-rs + Minimal Forwarder) | Smart contract + meta-tx support |
| Cryptography | Kyber, Dilithium, BBS+ | Post-quantum resistant, selective disclosure |
| Authentication | JWT + DID challenge | Stateless, DID-bound access |
Migration Notes (Actix → Axum)
Documentation Sync Checklist
- Update diagrams when new routes or services are added (wallet, issuer, verifier, meta-tx)
- Reflect changes to environment variables (
PORT,CORS_ALLOWED_ORIGINS, blockchain addresses) - Verify sample payloads match current MongoDB schemas (
credential_preview,presentation_requests) - Regenerate API reference after modifying Axum routers
- Confirm architecture pages mention new security features (challenge/response, meta transactions)
- Schedule quarterly review alongside backend release notes