What is Salud Health Records?
Salud Health Records is a privacy-preserving medical records management system built on the Aleo blockchain using the Leo programming language. It enables patients to:- Store encrypted medical records as private records on-chain
- Grant temporary access to healthcare providers via secure tokens
- Revoke access automatically after expiration (block height based)
- Maintain full control over their health data
Key Features
Privacy by Design
The smart contract leverages Aleo’s zero-knowledge architecture to ensure:- Private Medical Records: Health data is stored in private records, only visible to the owner
- Public Access Verification: Access grants are stored in public mappings for transparent verification
- Cryptographic Access Tokens: Tokens are generated using secure hash functions to prevent prediction
- Automatic Expiration: Access automatically expires based on block height, no manual cleanup required
Security Model
| Security Layer | Implementation | Purpose |
|---|---|---|
| Private Records | Aleo record type | Only patient can view encrypted health data |
| Access Verification | Public mappings | Doctors verify their access permissions |
| Token Generation | BHP256 hash + nonce | Unpredictable, unique access tokens |
| Expiration Enforcement | Block height comparison | Automatic, immutable access timeouts |
Program Constants
The contract defines three critical constants for access duration management:Block Time Calculations
Aleo blockchain produces approximately 1 block every 15 seconds, which translates to:- 4 blocks per minute
- 240 blocks per hour
- 5,760 blocks per day
- 40,320 blocks per week
Core Workflow
The typical user journey follows three main steps:Grant Access
Patient grants temporary access to a healthcare provider by generating an access token.
Data Privacy Guarantees
Medical Data
Stored in private records - only the patient can decrypt and read the contents. Not visible to validators or other network participants.
Access Grants
Stored in public mappings - anyone can verify if a doctor has valid access, but the actual medical data remains private.
Access Tokens
Cryptographically generated using BHP256 hash function with patient-provided nonces to prevent prediction attacks.
Expiration
Enforced via block height comparison - mathematically guaranteed expiration without requiring off-chain systems.
Record Types
The contract supports 10 different categories of medical records:| Type | Category | Use Case |
|---|---|---|
| 1 | General Health | Routine checkups, physical exams |
| 2 | Laboratory Results | Blood tests, urinalysis, biopsies |
| 3 | Prescriptions | Medication records, dosage info |
| 4 | Imaging/Radiology | X-rays, MRIs, CT scans |
| 5 | Vaccination Records | Immunization history |
| 6 | Surgical Records | Operation notes, procedures |
| 7 | Mental Health | Therapy notes, assessments |
| 8 | Dental Records | Dental exams, treatments |
| 9 | Vision/Ophthalmology | Eye exams, prescriptions |
| 10 | Other/Miscellaneous | Uncategorized records |
Why Leo on Aleo?
The choice of Leo language and Aleo blockchain provides unique advantages for healthcare:Native Privacy
Native Privacy
Aleo’s zero-knowledge architecture means private records are truly private - not just encrypted, but invisible to all network participants except the owner.
Predictable Costs
Predictable Costs
On-chain execution costs are deterministic and predictable, making it feasible for healthcare organizations to budget for blockchain operations.
Type Safety
Type Safety
Leo’s strongly-typed system prevents many common smart contract vulnerabilities at compile time, critical for medical applications.
Provable Computation
Provable Computation
All access verifications are cryptographically provable, providing an immutable audit trail for compliance purposes.
Next Steps
Architecture
Dive deep into the smart contract architecture, data structures, and state management
Functions
Explore all available transitions and their parameters
Integration
Learn how to integrate the contract with your frontend application
Testing
Run tests and deploy your own instance