MedVault is a secure healthcare platform that enables patients to maintain ownership and control of their medical records through blockchain-based access control, decentralized storage, and end-to-end encryption.
The platform combines smart contracts, IPFS storage, client-side cryptography, wallet authentication, and immutable audit logs to provide secure emergency medical record access while preserving patient privacy.
Live Demo: https://med-vault-khaki.vercel.app
Traditional healthcare systems often rely on centralized databases that can create security, privacy, and accessibility challenges during emergencies.
MedVault addresses these challenges by allowing patients to:
- Own and control their medical records
- Encrypt records before they leave their device
- Grant access to authorized healthcare personnel
- Revoke access at any time
- Maintain an immutable audit trail of every interaction
- Upload encrypted medical records
- Store records on IPFS
- Grant access to doctors and paramedics
- Revoke access at any time
- Immutable blockchain audit trail
- Wallet-based authentication
- Client-side encryption before upload
- Decentralized storage architecture
- Real-time permission management
- Blockchain-backed access verification
Patient
│
▼
Client-side AES-256 Encryption
│
▼
IPFS (Pinata)
│
▼
CID Storage
│
▼
MedVault Smart Contract
│
▼
Access Control Layer
│
▼
Authorized Medical Personnel
│
▼
Audit Events
│
▼
Immutable Blockchain Ledger
MedVault is a blockchain-powered Emergency Medical Record Access System that enables patients to securely manage healthcare records using decentralized technologies.
The platform integrates:
- Blockchain smart contracts for access control
- IPFS for decentralized storage
- AES-256 encryption for data privacy
- Wallet-based authentication
- Immutable audit trails
The result is a secure, transparent, and patient-controlled healthcare record system.
Select Medical Record
↓
Generate AES-256 Key
↓
Encrypt File Locally
↓
Upload Encrypted File to IPFS
↓
Receive CID
↓
Store CID on Blockchain
↓
Grant Access to Medical Personnel
Enter Patient Wallet Address
↓
Verify Permission On-Chain
↓
Retrieve CID
↓
Fetch Encrypted File from IPFS
↓
Decrypt Using Authorized Key
↓
View Medical Record
User Action
↓
Smart Contract Event
↓
Blockchain Storage
↓
Immutable Audit Record
↓
Frontend Audit Dashboard
Medical records are encrypted in the browser before transmission using AES-256-GCM encryption.
Encryption keys are wrapped individually for each authorized recipient.
Smart contracts enforce permissions and ownership verification.
Every upload, access request, grant, and revocation is recorded on-chain.
Patients retain full control and may revoke access at any time.
MedVault.sol
Core responsibilities:
- Medical record registration
- Permission management
- Access validation
- Audit logging
Key Functions:
uploadRecord(cid)
grantAccess(grantee, wrappedKey)
revokeAccess(grantee)
getRecord(patient)Events:
RecordUploaded
AccessUpdated
AccessAttemptBuilt using React and Vite.
Core pages:
- Upload Medical Record
- Access Patient Records
- Audit Log Viewer
Features:
- MetaMask integration
- Encryption utilities
- Smart contract interaction
- IPFS integration
- Event monitoring
- BlockDAG Awakening Testnet
- Solidity Smart Contracts
- Foundry Framework
- IPFS
- Pinata
- Cloudflare Workers
- Pinata Gateway Services
- Solidity
- Foundry
- Ethers.js
- BlockDAG Testnet
- React 18
- Vite
- JavaScript
- React Router
- IPFS
- Pinata
- AES-256-GCM
- Web Crypto API
- @noble/secp256k1
- Cloudflare Workers
- Vercel
- Smart Contract Development
- Solidity Programming
- Blockchain Event Logging
- Access Control Systems
- AES-256 Encryption
- Secure Key Management
- Cryptographic Workflows
- Permission Systems
- MetaMask Integration
- Wallet Authentication
- Decentralized Storage
- IPFS Workflows
- React Development
- Frontend Architecture
- API Integration
- Cloud Deployment
MedVault/
├── contracts-foundry/
│ ├── contracts/
│ │ └── MedVault.sol
│ ├── script/
│ └── test/
│
├── frontend/
│ ├── src/
│ │ ├── pages/
│ │ ├── utils/
│ │ └── components/
│
├── DOCUMENTATION.md
├── BUILD_VERIFICATION.md
├── PROJECT_STRUCTURE.md
└── README.md
git clone https://github.com/codeandbe/MedVault.git
cd MedVaultbash init_medvault.shVITE_PINATA_API_KEY=
VITE_PINATA_SECRET_API_KEY=
VITE_RPC_URL=
VITE_CHAIN_ID=1043
VITE_CONTRACT_ADDRESS=cd frontend
npm install
npm run devcd contracts-foundry
forge test
forge test -vvv
forge test --gas-report- Upload encrypted medical records
- Grant access permissions
- Retrieve authorized records
- Revoke permissions
- Verify blockchain audit logs
- Time-limited permissions
- Emergency access codes
- Multi-file support
- Record categorization
- Mobile applications
- Biometric authentication
- Secure messaging
- Appointment integration
- AI-assisted healthcare insights
- Decentralized Identity (DID)
- Zero-Knowledge Proofs
- EHR interoperability
- Multi-chain support
This project is a Proof of Concept and should not be used in production healthcare environments without:
- Smart contract security audits
- HIPAA compliance review
- GDPR compliance assessment
- Infrastructure hardening
- Enterprise key management systems
MIT License
Iyobosa Amaddin Majid
GitHub: https://github.com/codeandbe
Version: v1.0.0 MVP
Status: Proof of Concept
Deployment: BlockDAG Awakening Testnet
Live Demo: https://med-vault-khaki.vercel.app





