Revolutionary blockchain-based health passport built on Starknet, providing secure, private, and globally accessible medical credential management.
- π Live Application: https://stark-med.vercel.app/
- π₯ Demo Video: Watch on YouTube
- π Documentation: Complete Guide
StarkMed is a cutting-edge decentralized health passport platform that leverages Starknet's advanced blockchain technology to provide secure, private, and verifiable medical credential management. Built with IPFS storage and blockchain technology, StarkMed ensures that patients have complete control over their medical data while enabling instant, global verification.
- End-to-end encryption for all medical records
- Advanced cryptographic protocols ensuring absolute privacy
- Zero-knowledge proof technology for data verification without exposure (planned for future implementation)
- Built on Starknet's high-performance blockchain infrastructure
- IPFS storage for truly decentralized, censorship-resistant data management
- No single point of failure or control
- Generate secure QR codes for immediate credential sharing
- Real-time blockchain verification
- Cross-border medical compatibility
- Seamless integration with verified healthcare providers
- Hospital and medical institution network
- Trusted decentralized provider registry
- Complete ownership of health data
- Granular access control and permissions
- Selective sharing with healthcare providers
- Emergency access protocols
- Tamper-proof medical history storage
- Permanent, verifiable credential records
- Full audit trail of all access and modifications
- CredentialManager Contract: Core contract managing all health credentials
- Provider Registry: Verified healthcare provider management
- Access Control: Granular permission system for data sharing
- Ownership Management: Secure transfer and management capabilities
- Modern UI/UX: Built with React, TypeScript, and Tailwind CSS
- Wallet Integration: Support for ArgentX, Braavos, and other Starknet wallets
- Real-time Updates: Live blockchain state synchronization
- Responsive Design: Mobile-first approach for global accessibility
- IPFS: Decentralized file storage via Pinata
- Blockchain: Immutable credential metadata on Starknet
- Local Cache: Client-side caching for improved performance
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β User Visits β -> β Connect Wallet β -> β Register Patientβ
β StarkMed β β (ArgentX/Braavos)β β On-Chain β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
βContract Owner β -> β Admin Panel β -> βRegister Providerβ
β Access β β Access β β On-Chain β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
βProvider Creates β -> βDocument Upload β -> β IPFS Storage β
β New Credential β β & Encryption β β (Pinata) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Patient β <- β Credential β <- βBlockchain Mint β
β Notification β β Available β β (Starknet) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Patient β -> β Generate QR β -> βThird-Party β
β Shares Cred β β Code/Link β β Verification β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Verification β <- β Blockchain β <- β Input Cred β
β Result β β Verification β β ID β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Credential β -> β Manage Access β -> βGrant/Revoke β
β Owner β β Modal β β Permissions β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β
βΌ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Authorized β <- β Access Granted β <- β On-Chain Tx β
β Viewers β β Confirmed β β Confirmation β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
- Starknet: Layer 2 scaling solution for Ethereum
- Cairo: Smart contract programming language
- Scarb: Cairo package manager and build tool
- React 18: Modern UI library
- TypeScript: Type-safe development
- Vite: Fast build tool and development server
- Tailwind CSS: Utility-first CSS framework
- Starknet Kit: Wallet connection library
- Lucide React: Modern icon library
- IPFS: Decentralized file storage
- Pinata: IPFS pinning service
- RPC Providers: Blockchain node access
StarkMed/
βββ credential_manager/ # Smart Contract Layer
β βββ src/
β β βββ credential_manager.cairo # Main contract
β β βββ lib.cairo # Contract exports
β βββ tests/ # Contract tests
β βββ deploy.js # Deployment script
β βββ Scarb.toml # Project configuration
β βββ deployment-sepolia.json # Deployment info
β
βββ frontend/ # Frontend Application
β βββ src/
β β βββ components/ # UI Components
β β βββ contexts/ # React contexts
β β βββ hooks/ # Custom hooks
β β βββ lib/ # Utilities & contracts
β β βββ pages/ # Application pages
β β βββ services/ # Business logic
β β βββ types/ # TypeScript definitions
β βββ public/ # Static assets
β βββ package.json # Dependencies
β
βββ LICENSE # MIT License
βββ README.md # This file
- Node.js (v18 or higher)
- Starknet Wallet (ArgentX or Braavos)
- Cairo (for smart contract development)
- Git
git clone https://github.com/rtb-12/starkmed.git
cd starkmedcd credential_manager
# Install dependencies
scarb build
# Configure environment
cp .env.example .env
# Edit .env with your credentials
# Deploy to Sepolia (optional)
node deploy.jscd ../frontend
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Add your Pinata API keys and contract address
# Start development server
npm run devOpen http://localhost:8080 in your browser and connect your Starknet wallet.
# Pinata IPFS Configuration
VITE_PINATA_API_KEY=your_pinata_api_key
VITE_PINATA_SECRET_KEY=your_pinata_secret_key
# Contract Configuration
VITE_CONTRACT_ADDRESS=0x0746c9da88a54a60f534cfaefae0e72da73e7dc0ad3da449ffe60021622daa45
VITE_NETWORK=sepolia
# Application Configuration
VITE_APP_NAME=StarkMed
VITE_APP_VERSION=1.0.0# Network Configuration
STARKNET_NETWORK=sepolia
RPC_URL=https://starknet-sepolia.public.blastapi.io
# Account Configuration
ACCOUNT_ADDRESS=your_account_address
PRIVATE_KEY=your_private_key
CONTRACT_OWNER_ADDRESS=your_owner_addressverify_credential(credential_id)- Verify credential authenticitycredential_exists(credential_id)- Check if credential existsis_provider(address)- Check provider statusis_patient(address)- Check patient registrationget_credential_count()- Get total credential count
issue_credential(patient, metadata_hash)- Issue new credentialregister_patient()- Register as patient
register_provider(address, name)- Register healthcare providertransfer_ownership(new_owner)- Transfer contract ownership
createCredential(form, walletAddress)- Create new credentialverifyCredential(credentialId)- Verify credentialgetCredentials()- Get user credentials
getAllProviders()- Get registered providersregisterProvider(address, name)- Register new providertransferOwnership(newOwner)- Transfer ownership
cd credential_manager
scarb testcd frontend
npm test- End-to-end encryption for all medical documents
- Zero-knowledge proofs for verification without data exposure (planned for future implementation)
- Decentralized storage with IPFS prevents single points of failure
- Role-based permissions (Owner, Provider, Patient)
- Granular access control for individual credentials
- Time-limited access with automatic expiration
- Audit trails for all access and modifications
- Owner-only admin functions with on-chain verification
- Input validation for all contract interactions
- Reentrancy protection and safe external calls
- Event logging for transparency and monitoring
- Contract Address:
0x0746c9da88a54a60f534cfaefae0e72da73e7dc0ad3da449ffe60021622daa45 - Network: Starknet Sepolia
- Explorer: View on Starkscan
For production deployment:
- Smart Contract: Deploy to Starknet Mainnet
- Frontend: Deploy to Vercel, Netlify, or similar
- IPFS: Configure production Pinata account
- Monitoring: Set up blockchain monitoring and alerts
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Starknet Team for the amazing L2 infrastructure
- OpenZeppelin for security best practices
- Pinata for reliable IPFS services
- Cairo Community for development resources
β‘ Built with β€οΈ on Starknet - Empowering patients, securing health data, revolutionizing healthcare. β‘
