Overview
Salud enables you to create and manage encrypted medical records stored on the Aleo blockchain. Each record is cryptographically secured, ensuring only you can view and share your health data.All medical records are encrypted before leaving your browser and stored as private records on the Aleo blockchain.
How Medical Records Work
Medical records in Salud are built on Aleo’s privacy-preserving blockchain technology. Here’s what makes them secure:Private by Default
Records are stored as private Aleo records - only you can decrypt and view them
Client-Side Encryption
Data is encrypted in your browser before reaching the blockchain
Permanent Storage
Records are permanently stored on Aleo blockchain with cryptographic integrity
Zero-Knowledge
Even the backend server cannot read your medical data
Record Structure
Each medical record contains the following information:Each record can store approximately 126 bytes of encrypted data. For larger records, data is automatically chunked across multiple record parts.
Record Types
Salud supports 10 different medical record categories:General Health (Type 1)
General Health (Type 1)
General health checkups and assessments
Laboratory Results (Type 2)
Laboratory Results (Type 2)
Blood tests, urine analysis, and other lab work
Prescription (Type 3)
Prescription (Type 3)
Medication prescriptions and dosage information
Imaging (Type 4)
Imaging (Type 4)
X-rays, MRI, CT scans, and ultrasounds
Vaccination (Type 5)
Vaccination (Type 5)
Immunization records and vaccine history
Surgical (Type 6)
Surgical (Type 6)
Surgery records and post-operative notes
Mental Health (Type 7)
Mental Health (Type 7)
Psychological assessments and therapy notes
Dental (Type 8)
Dental (Type 8)
Dental examinations and treatments
Vision (Type 9)
Vision (Type 9)
Eye exams and vision prescriptions
Other (Type 10)
Other (Type 10)
Other medical records not covered by specific categories
Creating a Medical Record
From the UI
- Navigate to the My Records page
- Click the New Record button
- Fill in the record details:
- Title: Brief description (e.g., “Annual Physical”)
- Description: Detailed medical information
- Record Type: Select from 10 categories
- Click Create Record
- Your record is encrypted and submitted to the blockchain
Using the Contract
Records are created using thecreate_record transition:
data_part1-4: Pre-encrypted medical data (client-side encryption)record_type: Category of record (1-10)data_hash: Hash of original data for integrity verificationnonce: Client-provided randomness for unique ID generationmake_discoverable: Whether to add to public index (optional)
Viewing Your Records
All your medical records are automatically synchronized from the blockchain when you connect your wallet.Record List Features
Search
Search records by title or description
Filter by Type
Filter records by medical category
Grid or List View
Toggle between card grid or list layout
Auto-Sync
Records sync automatically from blockchain
Implementation Example
Here’s how records are fetched and displayed:Record Synchronization
Records are fetched from the blockchain and synchronized locally:- On Wallet Connect: All records are fetched from the blockchain
- Background Sync: Records automatically update every few minutes
- Manual Sync: Click the sync button to refresh immediately
- Local Cache: Records are cached in browser for faster access
Record synchronization may take 10-15 seconds as data is fetched from the Aleo blockchain.
Data Encryption
Medical records use multiple layers of encryption:Client-Side Encryption
- Before Blockchain: Data is encrypted in your browser using your private key
- Field Elements: Encrypted data is split into Aleo field elements
- Integrity Hash: A hash is computed for data integrity verification
Privacy Model
| Data Type | Visibility | Purpose |
|---|---|---|
| Medical Records | Private (record) | Only patient can view encrypted health data |
| Record Metadata | Optional public | Enable discovery if user opts in |
| Data Hash | On-chain | Verify data integrity |
Best Practices
Be Specific with Titles
Use clear, descriptive titles like “2024 Annual Physical” instead of “Checkup”
Include Relevant Details
Add important information like dates, doctor names, and key findings
Choose Correct Type
Select the appropriate record category for easier filtering later
Regular Backups
While records are on blockchain, keep copies of important documents
Troubleshooting
Records not appearing
Records not appearing
- Wait 10-15 seconds for blockchain sync to complete
- Click the manual sync button
- Check browser console for sync status
- Ensure you’re connected with the correct wallet
Failed to create record
Failed to create record
- Check that you have sufficient Aleo credits in your wallet
- Verify the backend server is running and accessible
- Try enabling Demo Mode for testing without blockchain
Cannot decrypt record
Cannot decrypt record
- Ensure you’re using the same private key that created the record
- Check that the record wasn’t corrupted during storage
- Verify your wallet connection is active
Next Steps
Share Records
Learn how to share records with doctors
QR Code Sharing
Generate QR codes for quick access