MedChain is a decentralized platform for secure, private, and controlled sharing of medical research data using Sui blockchain technology, Walrus and Zero-Knowledge Proofs.
- Decentralized Data Ownership: Researchers maintain full control over their data assets
- Privacy-Preserving Access: Zero-Knowledge Proofs protect sensitive information during verification
- Granular Access Control: Grant and revoke access to specific researchers with detailed permissions
- Immutable Audit Trail: Blockchain-based tracking of all access and modifications for compliance
- End-to-End Encryption: AES-256 encryption for all stored data
- Decentralized Storage: Integration with Walrus decentralized storage network
- Frontend: Next.js 14 with App Router, React, TypeScript
- UI Components: Tailwind CSS, shadcn/ui
- Blockchain: Sui blockchain
- Storage: Walrus decentralized storage
- Authentication: Wallet-based authentication
- Database: PostgreSQL (for metadata and access control)
- Security: Zero-Knowledge Proofs, AES-256 encryption
- Node.js 18.x or higher
- PostgreSQL database
- Sui wallet (Sui Wallet, Ethos Wallet, etc.)
- Access to Sui blockchain (mainnet, testnet, or devnet)
- Walrus API key (or mock implementation for development)
-
Clone the repository: ```bash git clone https://github.com/your-username/medchain.git cd medchain ```
-
Install dependencies: ```bash npm install ```
-
Set up environment variables: Create a
.env.localfile in the root directory with the following variables: ```DATABASE_URL=postgresql://username:password@localhost:5432/medchain
SUI_RPC_URL=https://sui-testnet.mystenlabs.com SUI_NETWORK=testnet
WALRUS_API_KEY=your_walrus_api_key WALRUS_ENDPOINT=https://api.walrus-storage.network ```
-
Initialize the database: ```bash npm run db:init ```
-
Run the development server: ```bash npm run dev ```
-
Open http://localhost:3000 in your browser.
| Variable | Description | Example |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | postgresql://username:password@localhost:5432/medchain |
SUI_RPC_URL |
Sui blockchain RPC endpoint | https://sui-testnet.mystenlabs.com |
SUI_NETWORK |
Sui network (mainnet, testnet, devnet) | testnet |
WALRUS_API_KEY |
API key for Walrus storage | your_walrus_api_key |
WALRUS_ENDPOINT |
Endpoint for Walrus storage API | https://api.walrus-storage.network |
- Click on "Connect Wallet" in the sidebar or header
- Select your preferred Sui wallet
- Approve the connection request in your wallet
- Authenticate to access the platform features
- Navigate to the "Register Data" page
- Fill in the dataset metadata (title, description, data type, etc.)
- Upload your research data files
- Configure encryption settings
- Submit the transaction to register your data on the blockchain
- Navigate to the "Access Control" page
- Select a dataset you own
- Grant access to specific researchers by wallet address
- Set access levels and expiration dates
- Monitor access requests and usage
- Navigate to the "Audit Trail" page
- View a complete history of data access and modifications
- Filter by dataset, user, or action type
- Export audit logs for compliance reporting
MedChain follows a layered architecture:
- Presentation Layer: Next.js frontend with React components
- Application Layer: API routes and server actions
- Domain Layer: Business logic and service implementations
- Infrastructure Layer: Database, blockchain, and storage integrations
- Wallet Integration: Connects to Sui wallets for authentication and transactions
- Blockchain Client: Interacts with the Sui blockchain for data registration and verification
- Storage Client: Manages encrypted data storage on the Walrus network
- Access Control: Enforces permissions and manages access grants
- Audit System: Tracks all actions for compliance and transparency
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some 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.
For questions or support, please contact us farhiyaomar24@gmail.com or open an issue on GitHub.