AI-powered medical record verification on Hedera blockchain
MediVerify is an AI-powered platform that verifies medical documents and creates immutable, shareable verification records on the Hedera network. Built for the Hedera Hello Future Apex Hackathon 2026 (Open Track - Theme 4: Healthcare).
Live Demo: https://mediverify.my Demo Video: https://www.youtube.com/watch?v=TPz5t4BIFE4 GitHub: https://github.com/jericho1050/agentverse
Healthcare providers face critical challenges with patient medical records:
- Incomplete Documentation: Missing lab results, medications, or diagnoses delay care
- Inconsistent Data: Conflicting information across multiple providers creates confusion
- Verification Burden: Doctors spend valuable time validating patient-submitted documents
- Fraud & Errors: Altered prescriptions or forged documents pose serious safety risks
- No Audit Trail: Once a document changes hands, there's no provable verification history
Patients waste time gathering records. Doctors waste time validating them. Everyone loses.
MediVerify combines Claude Opus 4.6 AI with Hedera's distributed ledger to create a trusted verification layer for medical documents.
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Patient ββββββΆβ AI Agent ββββββΆβ Hedera β
β Uploads β β Analyzes β β Timestamps β
β Med Docs β β Document β β Validation β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β
βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Doctor βββββββ Patient βββββββ Token Mint β
β Verifies β β Shares β β (MVT/HTS) β
β on HashScan β β Proof Link β β β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
- Document Upload: Patient submits medical records (lab results, prescriptions, discharge summaries) in PDF, TXT, or CSV format
- AI Analysis: Claude Opus 4.6 verifies completeness, detects inconsistencies, flags red flags
- HCS Timestamp: Verification result stamped immutably on Hedera Consensus Service
- Token Issuance: MediVerify Token (MVT) minted to patient's account via Hedera Token Service
- Shareable Proof: Patient receives HashScan link showing verified record on-chain
- Doctor Validation: Healthcare provider verifies authenticity by checking Hedera timestamp
- AI-Powered Validation: Claude analyzes medical terminology, dates, dosages, and document structure
- Immutable Audit Trail: Every verification recorded on HCS with microsecond-precision timestamps
- Reputation Tokens: MVT tokens track patient verification history (HTS fungible token)
- Health Passport: Generate portable digital health records with QR code sharing
- QR Code Sharing: Share verification proof via scannable QR codes
- Data Persistence: Verification records persist across server restarts (JSON file storage)
- Zero-Knowledge Sharing: Share verification proof without exposing sensitive medical data
- Cross-Provider Trust: Doctors across institutions can trust Hedera-stamped verifications
- Escrow Security: Optional payment escrow for premium verification services (EVM smart contract)
MediVerify demonstrates production-grade use of 4 Hedera services for healthcare innovation:
| Service | Purpose | Testnet Entity |
|---|---|---|
| HCS (Consensus Service) | Timestamp verification results with fair ordering and immutability | 0.0.8236051 |
| HTS (Token Service) | Mint MVT reputation tokens to verified patients | 0.0.8236059 |
| Smart Contracts (EVM) | Escrow HBAR for premium verification services | 0xb04e4153F58D8EB7B8DD03b53948e342348EE13b |
| Mirror Node API | Query verification history and token balances | testnet.mirrornode.hedera.com |
HCS Verification Topic: 0.0.8236051 View every medical document verification in real-time. Each HCS message contains:
- Document hash (SHA-256)
- AI verification result (complete/incomplete/flagged)
- Timestamp (consensus-ordered, tamper-proof)
- Patient account ID
Current Stats:
- 27+ HCS verification messages on testnet topic 0.0.8236051
- 12+ MVT tokens minted on HTS token 0.0.8236059
- 7 documents verified, average score 84/100
- 10+ diverse medical document types tested
MVT Token: 0.0.8236059 MediVerify Token (MVT) is minted to patients upon successful document verification. Check your verification count by viewing your account on HashScan.
Escrow Contract: 0xb04e4153F58D8EB7B8DD03b53948e342348EE13b Solidity smart contract securing HBAR payments for premium AI verification services. Funds released only after verification completion.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Patient Browser β
β (Next.js 15 Frontend) β
β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
β β Upload β β Status β β Passport β β History β β
β β Docs β β Monitor β β + QR β β Tokens β β
β ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ β
βββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β
βββββββββββΌββββββββββ
β API Routes β
β (Server-Side) β
βββββββββββ¬ββββββββββ
β
βββββββββββββββΌββββββββββββββ
β AI Verification Engine β
β (Claude Opus 4.6 via β
β AWS Bedrock SDK) β
βββββββββββββββ¬ββββββββββββββ
β
βββββββββββββββββββΌββββββββββββββββββ
β β β
βββββΌβββββ ββββββΌβββββ ββββββΌβββββ
β HCS β β HTS β β EVM β
β Topic β β MVT β β Escrow β
β0.0.XXX β β Token β βContract β
ββββββββββ βββββββββββ βββββββββββ
β β β
βββββββββββββββββββ΄ββββββββββββββββββ
β
βββββββββββΌβββββββββββ
β Hedera Testnet β
β (Mirror Node API) β
ββββββββββββββββββββββ
-
Document Upload Patient uploads medical document (PDF, TXT, or CSV). Document is parsed and sanitized.
-
AI Analysis Claude Opus 4.6 analyzes the document for:
- Completeness (all required fields present)
- Consistency (dates, dosages, terminology align)
- Red flags (unusual patterns, potential errors)
-
HCS Timestamp Verification result + document hash published to HCS topic. Consensus timestamp proves authenticity.
-
Token Mint MVT token minted to patient's Hedera account via HTS. Token tracks verification history.
-
Shareable Link Patient receives HashScan URL pointing to HCS message. No sensitive data exposed.
-
Doctor Validation Healthcare provider clicks link, sees Hedera-stamped verification result, trusts authenticity.
| Category | Technology | Purpose |
|---|---|---|
| Frontend | Next.js 15, React 19, TypeScript | Modern web application framework |
| Styling | TailwindCSS, shadcn/ui | Component library and design system |
| AI Provider | AWS Bedrock (Claude Opus 4.6) | Medical document analysis ($0 via credits) |
| AI SDK | @anthropic-ai/bedrock-sdk |
Native Claude integration with Bedrock |
| Blockchain | @hashgraph/sdk |
Hedera network integration (HCS, HTS, contracts) |
| Smart Contracts | Solidity 0.8.24, Hardhat, ethers.js | Escrow contract for payments |
| State Management | React Context, SWR | Client-side data fetching |
| PDF Processing | pdf-parse |
PDF text extraction for verification |
| QR Codes | qrcode |
QR code generation for health passport sharing |
| Deployment | AWS EC2, IAM Instance Roles | Production hosting with Bedrock access ($0 via credits) |
- Node.js: 20+ (download)
- Hedera Testnet Account: Create at portal.hedera.com
- Fund with testnet HBAR (free from portal)
- AWS Account: For Bedrock access (Claude Opus 4.6)
- Request Bedrock access in us-east-1 region
- Enable Claude Opus 4.6 model (or Claude Sonnet 4.5 as fallback)
-
Clone the repository
git clone https://github.com/jericho1050/agentverse.git cd agentverse -
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env.local
Edit
.env.localwith your credentials:# AWS Bedrock (Claude Opus 4.6 or Sonnet 4.5) AWS_ACCESS_KEY_ID=AKIA... AWS_SECRET_ACCESS_KEY=... AWS_REGION=us-east-1 # Hedera Platform Account HEDERA_OPERATOR_ID=0.0.xxxxx HEDERA_OPERATOR_KEY=302e020100... # ECDSA private key # Hedera Network NEXT_PUBLIC_NETWORK=testnet # HCS Verification Topic HCS_VERIFICATION_TOPIC_ID=0.0.8236051 # HTS Token MVT_TOKEN_ID=0.0.8236059 # Escrow Contract ESCROW_CONTRACT_EVM_ADDRESS=0xb04e4153F58D8EB7B8DD03b53948e342348EE13b # Mirror Node MIRROR_NODE_URL=https://testnet.mirrornode.hedera.com/api/v1
-
Setup Hedera infrastructure (one-time)
# Create HCS verification topic npx ts-node scripts/setup-topic.ts # Create MVT token on HTS npx ts-node scripts/create-token.ts # Deploy escrow smart contract npx hardhat run scripts/deploy-escrow.ts --network hedera_testnet
-
Run the development server
npm run dev
-
Open your browser
Navigate to http://localhost:3000
-
Upload Medical Document
- Click "Upload Document" button
- Select lab result, prescription, or discharge summary (PDF, TXT, or CSV)
- Submit for AI verification
-
Wait for AI Analysis
- Claude analyzes document (5-10 seconds)
- Verification result displayed in real-time
-
Receive Verification Proof
- HCS topic link on HashScan
- MVT token minted to your account
- Access Health Passport at
/passportpage - Share via QR code or direct link with your doctor
-
Receive HashScan Link
- Patient shares verification link
- Click to view on HashScan
-
Verify Authenticity
- Check HCS timestamp (consensus-ordered)
- Review AI verification result
- Trust Hedera-stamped proof
-
Proceed with Care
- No need to re-validate document
- Focus on patient treatment
hedera-ai/
βββ src/
β βββ app/ # Next.js 15 App Router
β β βββ page.tsx # Dashboard with stats + CTA
β β βββ verify/page.tsx # Main verification page (upload + SSE progress)
β β βββ records/page.tsx # Verified documents grid
β β βββ passport/page.tsx # Health Passport with circular score + QR
β β βββ activity/page.tsx # Real-time HCS message feed (EventSource)
β β βββ share/[id]/page.tsx # Public verification proof page
β β βββ api/
β β βββ verify/route.ts # POST: SSE stream for 6-step verification
β β βββ documents/route.ts # GET: verified documents list
β β βββ stats/route.ts # GET: verification statistics
β β βββ share/[id]/route.ts # GET: verification proof by ID
β β βββ activity/route.ts # GET: SSE activity feed
β β βββ recent-activity/route.ts # GET: JSON recent activity
β β βββ qr/route.ts # GET: QR code SVG generator
β β βββ parse-file/route.ts # POST: PDF/text file parsing
β βββ components/
β β βββ DashboardLayout.tsx # Sidebar navigation, emerald theme
β β βββ ui/ # shadcn/ui components
β βββ lib/
β β βββ agents/
β β β βββ orchestrator.ts # 6-step verification async generator
β β β βββ llm-client.ts # Child process LLM caller (avoids webpack OOM)
β β β βββ prompts.ts # Medical document analysis prompts
β β βββ hedera/
β β β βββ client.ts # Hedera client factory
β β β βββ hcs.ts # HCS publish + Mirror Node queries
β β β βββ hts.ts # HTS token transfer + balance
β β β βββ escrow.ts # EVM escrow contract via ethers.js
β β β βββ mirror.ts # Generic Mirror Node REST client
β β βββ store.ts # globalThis store + JSON file persistence
β β βββ config.ts # Typed env config with Zod validation
β β βββ utils.ts
β βββ types/index.ts # TypeScript definitions
βββ contracts/
β βββ AgentEscrow.sol # Minimal escrow (create/complete/refund)
βββ scripts/
β βββ llm-call.mjs # Standalone Bedrock LLM (runs outside webpack)
β βββ setup-topics.ts # Create HCS topics
β βββ create-token.ts # Create MVT token on HTS
β βββ deploy-escrow.ts # Deploy escrow contract
β βββ seed-agents.ts # Register agents on HCS
β βββ setup-accounts.ts # Setup Hedera accounts
β βββ run-verifications.sh # Run batch verification tests
βββ hardhat.config.ts
βββ next.config.ts
βββ package.json
βββ tsconfig.json
βββ README.md
MediVerify uses Claude Opus 4.6 to analyze medical documents across multiple dimensions:
- Patient name, date of birth, medical record number
- Provider name, facility, contact information
- Document type (lab result, prescription, etc.)
- Date of service, test results, diagnoses
- Signatures, credentials, license numbers
- Date alignment (service date β€ document date)
- Dosage format (valid units, ranges)
- Medical terminology (correct spelling, abbreviations)
- Cross-field validation (diagnosis matches prescribed medication)
- Unusual patterns (e.g., dosage out of typical range)
- Missing critical fields (e.g., no provider signature)
- Inconsistent formatting (potential tampering)
- Expired documents (old test results presented as recent)
{
"status": "verified",
"completeness": 0.95,
"consistency": 0.92,
"redFlags": [],
"summary": "Lab results complete with all required fields. No inconsistencies detected.",
"timestamp": "2026-03-20T15:30:00Z",
"documentHash": "sha256:abc123..."
}Event: Hedera Hello Future Apex Hackathon 2026 Track: Open Track (Theme 4: Healthcare) Deadline: March 23, 2026 at 11:59 PM ET Prize Pool: $120,000 total
- GitHub Repository: https://github.com/jericho1050/agentverse
- Live Demo: https://mediverify.my
- Demo Video: https://www.youtube.com/watch?v=TPz5t4BIFE4
- Pitch Deck: included in repo (PDF)
- Real-World Healthcare Impact: Solves actual problem doctors and patients face daily
- Deep Hedera Integration: Uses 4 core services (HCS, HTS, Smart Contracts, Mirror Node)
- AI + Blockchain Synergy: Claude provides intelligence, Hedera provides trust
- Production-Ready Architecture: Built on battle-tested Next.js + Hedera SDK
- Zero Cost to Operate: AWS credits for Bedrock + hosting, Hedera testnet free
- Verifiable on HashScan: Every verification publicly auditable with proof links
- Privacy-Preserving: Share verification proof without exposing sensitive medical data
- 27+ HCS verification messages on testnet topic 0.0.8236051
- 12+ MVT tokens minted on HTS token 0.0.8236059
- 7 documents verified, average score 84/100
- 10+ diverse medical document types tested
- 100% uptime on HCS topic
- Sub-10-second verification latency
- Data persistence across server restarts
- AWS EC2 with IAM instance role for permanent Bedrock access
# Smart contract tests
npx hardhat test
# Integration tests
npm test
# E2E tests (requires testnet accounts)
npm run test:e2enpm run build
npm startMediVerify is deployed on an AWS EC2 instance with an IAM instance role for persistent Bedrock access (no expiring SSO tokens).
-
Launch EC2 instance (Ubuntu, t3.medium or similar)
-
Attach IAM instance role with
AmazonBedrockFullAccesspolicy# This gives the EC2 instance permanent Bedrock access β no AWS keys needed aws iam create-role --role-name MediVerifyEC2Role ... aws ec2 associate-iam-instance-profile ... -
Clone, install, and build on EC2
git clone https://github.com/jericho1050/agentverse.git cd agentverse npm install npm run build -
Set environment variables in
.env.local(Hedera keys, topic/token IDs) -
Run with PM2 for process management
npm install -g pm2 pm2 start npm --name mediverify -- start pm2 save
-
Point domain (e.g.,
mediverify.my) to EC2 public IP
Key Architecture Decision: The AI LLM call runs as a child process (scripts/llm-call.mjs) outside of webpack to avoid AWS SDK + Next.js RegExp OOM crashes. The EC2 IAM role eliminates credential rotation issues.
- AI document analysis with Claude Opus 4.6
- HCS verification timestamps
- MVT token minting on HTS
- Smart contract escrow for payments
- Shareable HashScan proof links
- Health Passport feature
- QR code sharing
- PDF upload support
- Data persistence (JSON file storage)
- Live testnet deployment (https://mediverify.my)
- HTTPS support (Let's Encrypt)
- Demo video (YouTube) + pitch deck (PDF)
- AWS EC2 deployment with IAM instance role for Bedrock
- OCR for scanned documents (extract text from images)
- Multi-language support (Spanish, Chinese, etc.)
- HIPAA compliance audit
- Mobile app (React Native)
- Doctor dashboard for bulk verifications
- Mainnet launch
- Integration with EHR systems (Epic, Cerner)
- Insurance claim verification
- Telemedicine platform integration
- Global medical record portability
- Decentralized patient identity (DID)
- Cross-chain verification (Hedera + other networks)
- Minimal Data Storage: Only verification metadata persisted (document hash, score, timestamp) - not full document contents
- Hash-Only on HCS: Only SHA-256 hash + verification result published on-chain
- Zero-Knowledge Sharing: HashScan link proves verification without exposing document contents
- Encrypted Transit: Production deployment on AWS EC2
- OpenZeppelin Contracts: Industry-standard escrow implementation
- Audited Code: Contract tested with Hardhat test suite
- Testnet First: Extensive testing before mainnet deployment
- Claude Opus 4.6: State-of-the-art medical language model
- No Training on User Data: AWS Bedrock does not use customer data for training
- Human-in-the-Loop: Doctors make final decisions, AI provides verification support
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use TypeScript for all code
- Follow existing code style (ESLint + Prettier)
- Write tests for new features
- Update documentation as needed
- Keep commits atomic and well-described
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Built with passion for improving healthcare through blockchain innovation.
Developer: Jericho Wenzel GitHub: @jericho1050
- Hedera Hashgraph for the incredible DLT infrastructure
- Anthropic for Claude AI and medical language understanding
- AWS Bedrock for LLM hosting
- HashScan for blockchain explorer and verification links
- Healthcare professionals who provided feedback on the verification flow
- Hackathon organizers and judges
Built on Hedera. Powered by AI. Trusted by healthcare.
Explore the Live Demo β’ Watch the Demo β’ View on HashScan