Web3 Storage System
Data Hashes Storage, cross-chain.
System Overview
The OmegaX Health Web3 Storage system provides a robust framework for storing and verifying AI decision certificates using distributed storage and blockchain technology. This comprehensive solution ensures data integrity, immutability, and transparency for healthcare-related decision records through a multi-chain verification approach.
The system leverages IPFS (InterPlanetary File System) via Web3.Storage for decentralized content storage, combined with blockchain verification on either Solana or Binance Smart Chain (BSC), providing cryptographic proof of record existence and timestamp verification.
Technical Architecture
The architecture consists of five primary components working together to provide secure and verifiable certificate storage:
API Layer: Express.js REST API that handles incoming requests for certificate storage and verification
Certificate Generation: PDF generation system using PDFKit to create standardized certificate documents
IPFS Storage: Integration with Web3.Storage (w3up-client) for decentralized file storage
Blockchain Verification: Dual-chain support for recording certificate hashes on either Solana or BSC
Local Database: JSON-based storage for certificate metadata and cross-referencing
Data flows through the system in a structured manner:
Client submits a SHA-256 hash representing an AI decision
System generates a standardized PDF certificate
Certificate is uploaded to IPFS via Web3.Storage
Certificate hash and metadata are recorded on the selected blockchain
All data is synchronized to the local database
Client receives verification links and transaction information
Data Flow Architecture
Hash Submission and Validation
When a client submits a SHA-256 hash, the system performs multiple validation steps:
Regex validation to ensure 64-character hexadecimal format
Deduplication check against the local database
Cross-referencing with existing IPFS CIDs and blockchain records
This validation layer prevents duplicate entries and ensures only correctly formatted hashes enter the system.
Certificate Generation Pipeline
The certificate generation process is more sophisticated than just creating a PDF:
Template Selection: The system selects from multiple template designs based on the certificate type
Metadata Embedding: Invisible metadata is embedded within the PDF structure
Digital Signature: A cryptographic signature is applied using the OmegaX private key
Dynamic Content Generation: The certificate content is dynamically generated based on the blockchain target
SVG Logo Integration: Vector graphics are embedded for resolution independence
The PDFKit implementation uses carefully optimized streams to minimize memory usage during certificate generation, allowing the system to handle high-volume requests efficiently.
Blockchain Data Standardization
Before data reaches any blockchain, it undergoes standardization:
This standardization ensures consistent data structures regardless of the target blockchain, enabling cross-chain verification.
Component Details
API Server
The API server is built on Express.js and provides endpoints for certificate storage and verification. Key features include:
Bearer token authentication for secure write operations
Public verification endpoints for transparent auditing
Chain-specific verification routes for targeted blockchain validation
Health check endpoint for system monitoring
Certificate Generation
The system generates standardized PDF certificates for each AI decision with the following properties:
Dark-themed design with OmegaX Health branding
SHA-256 hash prominently displayed
Certificate type specification (e.g., "AI diagnosis")
Timestamp and verification information
Blockchain-specific details
IPFS Storage via Web3.Storage
The system uses Web3.Storage for decentralized file storage with these characteristics:
Content-addressable storage with CID (Content Identifier) generation
Automatic space management and delegation handling
Periodic synchronization between local database and Web3.Storage
Fault-tolerant upload process with error handling
Space Management Algorithm
The system employs a sophisticated space management algorithm:
Space Detection:
Space Creation and Selection: If no spaces exist, the system creates a new space and selects it automatically. If spaces exist but none are selected, the system selects the first available space.
Delegation Management: The system supports Car file delegation import for authorized uploaders:
Content-Addressed Storage Optimization
The system optimizes IPFS storage through:
Deduplication: Files with identical content result in identical CIDs, preventing redundant storage
Binary Encoding: PDFs are uploaded in binary format rather than base64 to reduce storage requirements
Metadata Separation: Certificate metadata is stored separately from the file content
Parallel Uploads: The system supports concurrent uploads for high-throughput scenarios
The result is an efficient storage system that minimizes blockchain transaction fees by storing only essential verification data on-chain.
Blockchain Integration
Solana Blockchain
The Solana integration provides:
On-chain storage of certificate metadata using memo transactions
Optimized data structure with derived hash IDs for efficient storage
Fallback RPC endpoints with automatic switching on rate limiting
Exponential backoff retry mechanism for transaction reliability
Standardized memo format:
OMGX:{derivedHashId}:{cid}:{timestamp}:{type}
Solana Transaction Structure
Solana transactions leverage the memo program with a specialized structure:
Transaction Type:
System program transfer with minimum lamports (5000 = 0.000005 SOL)
Memo program instruction with certificate data
Data Format:
Data Derivation:
Transaction Optimization:
Extended validity window with
lastValidBlockHeight + 150
Minimal lamport transfer (self-transfer) to reduce costs
Commitment level set to
confirmed
for faster verification
Binance Smart Chain
The BSC integration features:
Smart contract interaction for certificate storage
Gas price and limit optimization
Network configuration for both mainnet and testnet
Error handling and transaction receipt verification
Event monitoring for
CertificateStored
events
BSC Transaction Structure
BSC transactions interact with a smart contract through two primary methods:
Storage Method:
Event Emission:
Gas Optimization:
Custom gas price and limit settings
Use of the
nonpayable
function typeEvent indexing for optimized querying
Data Retrieval Structure:
Local Database
The system maintains a local JSON database (uploads.json
) that:
Stores complete records of all certificates
Includes file metadata, blockchain transaction details, and timestamps
Serves as a fallback when blockchain verification is temporarily unavailable
Synchronizes periodically with Web3.Storage
Blockchain Transaction Format Specifications
Blockchain Transaction Structure (Standardized)
Where:
OMGX: OmegaX Health prefix
derivedHashId: Short identifier derived from SHA-256 hash
cid: IPFS or off-chain storage identifier
timestamp: UNIX timestamp
type: Data category (e.g.,
AI_DECISION
,HEALTH_PROFILE_UPDATE
,INSURANCE_CLAIM
)
Advanced Error Handling and Recovery
The system implements sophisticated error handling beyond basic try/catch:
Blockchain-Specific Error Recovery
Solana Error Recovery
Rate Limit Detection and Handling:
Transaction Expiration Handling:
RPC Endpoint Failover: The system maintains multiple RPC endpoints and automatically switches on failure:
BSC Error Recovery
Gas Price Adjustment: The system monitors transaction failures and adjusts gas prices automatically:
Nonce Management: For high-throughput scenarios, the system tracks and manages transaction nonces:
Receipt Validation: The system validates transaction receipts to ensure successful execution:
IPFS Error Recovery
The system implements hierarchical error recovery for IPFS operations:
Upload Retry Logic:
Space Reconfiguration: If uploads consistently fail, the system attempts to reconfigure the Web3.Storage space:
Cross-Chain Verification Architecture
The system supports advanced cross-chain verification capabilities:
Verification Logic
The verification process follows a multi-level approach:
Primary Verification: Check the specified blockchain for the hash
Cross-Chain Fallback: If not found, check other supported blockchains
IPFS Verification: Verify the existence and integrity of the IPFS content
Local Database Verification: As a final fallback, check the local database
This approach ensures maximum reliability even if one verification layer is temporarily unavailable.
Cross-Chain Data Normalization
To handle different data structures across blockchains, the system normalizes verification results:
This normalization allows the API to present consistent responses regardless of the underlying blockchain.
Security Architecture
The security architecture extends beyond basic authentication:
1. Blockchain Transaction Security
Solana Transaction Security
Derived Hash IDs: Instead of storing the full 64-character hash, the system derives a shorter hash ID:
This approach prevents exposing the full hash on-chain while maintaining verifiability.
Signature Verification: For verification, the system checks transaction signatures:
BSC Transaction Security
Events Monitoring: The system monitors
CertificateStored
events instead of querying the blockchain state:Ownership Management: The smart contract includes ownership controls:
2. Certificate Security Features
The generated PDF certificates include multiple security features:
Cryptographic Hash Display: The full SHA-256 hash is displayed prominently
Embedded Metadata: Invisible metadata is embedded in the PDF structure
Verification QR Code: A QR code links to the verification endpoint
Tamper-Evident Design: Visual elements that make modifications apparent
Document Expiry Controls: Optional expiration timestamps for time-limited certificates
3. API Security Layers
The API implements multiple security layers:
Rate Limiting: Prevents brute force attacks and DoS attempts
Input Sanitization: All user inputs are strictly validated:
Authentication Token Rotation: The system supports token rotation for enhanced security:
Zero-Knowledge Implementation
The zero-knowledge implementation leverages several advanced techniques:
Data Tokenization
Certificate data is tokenized before storage, separating identifiable information from verification data:
Blockchain-Stored Metadata
The system stores only standardized, non-sensitive metadata on the blockchain:
Zero-Knowledge Proof Generation
For advanced use cases, the system can generate zero-knowledge proofs:
Data Analysis and Metrics
The system includes built-in analytics capabilities:
Transaction Volume Tracking
Blockchain Performance Metrics
Certificate Type Distribution
Subscription Model
The API follows a dual-tier subscription model:
Open Verification (GET): Fully open and free, enabling transparency and public auditability.
Hash Storage (POST): Premium OmegaX subscribers have storage fees included. Institutions (hospitals, EHR providers) sign subscription agreements for dedicated endpoints, simplifying their integration and enabling DAO participation.
Direct blockchain writing by third parties without subscriptions is technically possible but complex; therefore, OmegaX strongly recommends institutional subscriptions to simplify integration and usage.
Future Development Roadmap
The OmegaX system is designed with future extensibility in mind:
Multi-Chain Expansion
The architecture is prepared for additional blockchain integrations:
Enhanced Zero-Knowledge Capabilities
The system is ready for advanced zero-knowledge proof implementations:
Decentralized Governance Integration
The architecture supports integration with DAO governance:
Conclusion
The OmegaX Health Web3 Storage system represents a comprehensive solution for storing and verifying AI decision certificates using distributed storage and blockchain technology. By leveraging IPFS for content storage and multiple blockchains for verification, the system provides a robust, transparent, and secure framework for healthcare data integrity.
Through its standardized API, flexible blockchain support, and advanced security features, the system enables healthcare providers, AI systems, and third-party verifiers to participate in a trustless ecosystem for medical decision record-keeping.
The combination of decentralized storage, multi-chain verification, and zero-knowledge capabilities positions the OmegaX system as a foundation for transparent yet privacy-preserving healthcare data management.
Last updated