Fortro Engine
Fortro Engine is the central backend API server that orchestrates all SSI operations in the Sphyre ecosystem. Built with Rust for maximum performance and security, it handles authentication, credential issuance, verification, and blockchain integration.Overview
Fortro Engine provides a RESTful API that connects all frontend applications with the underlying infrastructure (MongoDB, IPFS, Ethereum).Technology
Language: Rust
Framework: Axum (Tokio runtime)
Base URL:
Framework: Axum (Tokio runtime)
Base URL:
https://api.sphyre.techKey Features
Post-quantum cryptography
JWT authentication
IPFS & blockchain integration
Real-time credential processing
JWT authentication
IPFS & blockchain integration
Real-time credential processing
Architecture
Tech Stack
Rust Language
Rust Language
Why Rust?
- Memory safety without garbage collection
- Zero-cost abstractions
- Fearless concurrency
- Excellent performance
Axum Web Framework
Axum Web Framework
Tower-based async HTTP stack backed by the Tokio runtime.
MongoDB Driver
MongoDB Driver
NoSQL database for flexible credential storage
IPFS Integration
IPFS Integration
Decentralized storage via Kubo HTTP API
Ethereum Client
Ethereum Client
Blockchain interaction using ethers-rs
Cryptography
Cryptography
Post-quantum and standard crypto libraries
Project Structure
API Modules
1. Authentication Module
Handles user registration, login, and JWT token management. Endpoints:POST /api/auth/register- Register new user with DIDPOST /api/auth/login- Authenticate with DID signaturePOST /api/auth/verify- Verify JWT token validityGET /api/auth/challenge- Get challenge for signature
2. Wallet Module
Manages user credentials and wallet operations. Endpoints:GET /api/wallet/:did/credentials- Get all user credentialsGET /api/wallet/:did/connections- Get user connectionsPOST /api/wallet/:did/consent- Manage consent settingsGET /api/wallet/:did/credential/:id- Get specific credential
- Real-time credential sync
- Offline data caching
- Consent management
- Connection tracking
3. Issuer Module
Handles credential schemas, templates, and issuance. Endpoints:POST /api/issuer/schema- Create credential schemaGET /api/issuer/schemas- List all schemasPOST /api/issuer/template- Create credential templatePOST /api/issuer/issue- Issue verifiable credentialPOST /api/issuer/revoke/:id- Revoke credentialGET /api/issuer/requests- Get pending credential requests
4. Verifier Module
Manages presentation requests and credential verification. Endpoints:POST /api/verifier/request- Create presentation requestPOST /api/verifier/verify- Verify presentationGET /api/verifier/verifications- Get verification historyGET /api/verifier/request/:id- Get request details
5. QR Code Module
Generates QR codes for credential offers and presentation requests. Endpoints:POST /api/qr/offer- Generate credential offer QRPOST /api/qr/request- Generate presentation request QR
Database Schema
MongoDB Collections
- users
- credentials
- schemas
- templates
Cryptographic Operations
Post-Quantum Cryptography
Fortro Engine uses NIST-approved post-quantum algorithms:DID Operations
IPFS Integration
Upload Credentials
Retrieve Credentials
Blockchain Integration
Smart Contract Interaction
Error Handling
Fortro Engine uses a centralized error handling system:Configuration
Environment variables for Fortro Engine:Deployment
Docker Deployment
Docker Compose
Testing
Unit Tests
Performance Optimization
Connection Pooling
Connection Pooling
Reuse database and IPFS connections
Async Operations
Async Operations
Non-blocking I/O with Tokio runtime
Caching
Caching
Cache frequently accessed data