Hedera Integration
MediPact is built on four core pillars of Hedera: HCS, EVM, Accounts, and HBAR.
Core Hedera Services
| Service | Usage | Impact |
|---|---|---|
| HCS | Immutable storage of consent & data proof hashes | Unchangeable audit trail, ~$0.0001/message |
| Hedera EVM | ConsentManager & RevenueSplitter smart contracts | Automated consent registry & revenue distribution |
| Hedera Account IDs | Native accounts (0.0.xxxxx) for all users | Seamless UX, direct HBAR transfers |
| HBAR | Micropayments for 60/25/15 revenue split | Low-cost, instant settlements |
Integration Flow
Hedera Account Creation
Hospitals & Researchers
Accounts are created during registration. The platform generates an ECDSA key pair, creates a Hedera account (0.0.xxxxx) with EVM compatibility, and stores the encrypted private key.
Patients
Accounts are created immediately during patient registration (same as hospitals and researchers). The platform generates an ECDSA key pair, creates a Hedera account (0.0.xxxxx) with EVM compatibility, and stores the encrypted private key. This ensures patients have accounts ready for revenue distribution.
Process
Platform generates keys → creates Hedera account (operator pays ~$0.05) → encrypts private key → stores account ID and EVM address in database. All accounts are EVM-compatible for smart contract interactions.
Why Hedera?
✅ HCS is unique
No other blockchain offers immutable message logging
✅ Low fees
Enables micropayments at scale (~$0.0001 per HCS message)
✅ High throughput
10,000+ TPS for thousands of daily queries
✅ Carbon negative
Environmentally sustainable
✅ Native accounts
Seamless UX without complex wallet management
✅ EVM compatible
Smart contracts with low gas costs
HCS Topics
MediPact uses Hedera Consensus Service (HCS) topics to store immutable proofs of consent and data hashes. Each message submitted to HCS is cryptographically signed and timestamped, creating an unchangeable audit trail that can be verified on HashScan.
Consent Topic
Stores consent records with anonymous patient IDs, HCS topic IDs, data hashes, and timestamps. Each consent submission creates a new message on the HCS topic.
Data Proof Topic
Stores cryptographic hashes of anonymized datasets. Researchers can verify data integrity by comparing dataset hashes with HCS messages.
HBAR Micropayments
Revenue distribution is handled automatically by the RevenueSplitter smart contract. When a researcher purchases a dataset:
- Payment is received in HBAR by the RevenueSplitter contract
- Contract automatically splits: 60% Patient, 25% Hospital, 15% Platform
- HBAR is transferred directly to Hedera accounts (0.0.xxxxx)
- All transactions are verifiable on HashScan
Benefits: Trustless, Transparent, Instant, Low fees (~$0.0001 per transaction)