Overview
To use Salud Health, you need an Aleo wallet to secure your medical records and manage access. This guide covers everything from creating a new wallet to connecting existing wallets like Leo Wallet or Shield Wallet.Why Salud Requires a Private Key
Understanding the Technical Difference
You might wonder why you can’t just click “Connect Wallet” like on other dApps. Here’s why Salud is different:Standard dApp (Browser Wallet Connection)
Standard dApp (Browser Wallet Connection)
How it works:What it does:
- Wallet extension signs transactions
- Data sent to blockchain in standard format
- Suitable for DeFi, NFTs, and public transactions
Salud Health (Private Key Encryption)
Salud Health (Private Key Encryption)
How it works:What it does:
- Encrypts medical data before leaving your browser
- Generates cryptographic proofs for zero-knowledge verification
- Creates encrypted access tokens for sharing
- Maintains server-side session for blockchain interaction
Why Browser Wallets Don’t Work
The Privacy Benefit
This design actually provides stronger security for medical data:| Feature | Regular dApp | Salud Health |
|---|---|---|
| Connection | Click “Connect” | Paste private key |
| Data Encryption | ❌ Not encrypted | ✅ Encrypted with your key |
| Medical Data Privacy | ❌ Visible to dApp | ✅ Only you can decrypt |
| Server Can Read Data | ❌ Yes | ✅ No (zero-knowledge) |
| Sharing with Doctors | ❌ Not possible | ✅ Time-limited access tokens |
| Security Level | Standard | HIPAA-grade encryption |
Bottom LineSalud requires a private key because it provides medical-grade privacy that browser wallets can’t offer. Your health data deserves the highest level of protection!
Getting an Aleo Private Key
You have four options for obtaining an Aleo private key:Option 1: Export from Leo Wallet (Recommended)
If you already have Leo Wallet installed:Navigate to Settings
Click on your account name or avatar, then go to Settings → Security & Privacy.
Copy the Key
Your private key will be displayed (starts with
APrivateKey1...). Copy it to your clipboard.Option 2: Export from Shield Wallet
If you use Shield Wallet:Option 3: Generate New Account (Testing)
Don’t have a wallet yet? Generate a new account directly in Salud:Save Your Private Key
A new Aleo account will be generated with a private key. Save this key securely - you’ll need it to access your account later.
Option 4: Use Existing Aleo Account
If you already have an Aleo account from:- Aleo SDK development
- Other Aleo dApps
- Previous Salud sessions
- Command-line wallet generation
APrivateKey1...).
Understanding Your Wallet
Private Key Format
Aleo private keys have a specific format:- Starts with
APrivateKey1 - Total length: 59 characters
- Contains alphanumeric characters
- Case-sensitive
If your key doesn’t match this format, it’s not a valid Aleo private key.
What Your Private Key Controls
🔐 Wallet Ownership
🔐 Wallet Ownership
Your private key proves ownership of your Aleo wallet address. It’s like the password to your bank account.
📝 Transaction Signing
📝 Transaction Signing
When creating records or granting access, your private key signs transactions to authorize them on the Aleo blockchain.
🔒 Data Encryption/Decryption
🔒 Data Encryption/Decryption
Your private key encrypts medical data before storage and decrypts it when you view records. This is critical for privacy!
🎫 Access Token Generation
🎫 Access Token Generation
When sharing records with doctors, your private key generates cryptographic access tokens that prove viewing rights.
Deriving Your Wallet Address
Your public wallet address is derived from your private key:Connecting to Salud Health
First-Time Connection
Navigate to Salud Health
Open
http://localhost:5173 (or your deployed Salud Health URL) in your browser.Wait for Verification
Salud Health will:
- Verify your private key format
- Derive your wallet address
- Create a server-side session
- Fetch your existing records from the Aleo blockchain
Reconnecting
Each time you visit Salud Health, you’ll need to reconnect:- Your session expires when you close the browser or after a timeout period
- No credentials are stored locally for security reasons
- Simply paste your private key again to reconnect
Why No Persistent Login?For maximum security, Salud doesn’t store your private key. While this means reconnecting each visit, it ensures your key can’t be compromised through the application.
Security Best Practices
Storing Your Private Key
Recommended storage methods:Password Manager (Recommended)
Password Manager (Recommended)
Store your private key in a reputable password manager like:
- 1Password
- Bitwarden
- LastPass
- Dashlane
Hardware Wallet
Hardware Wallet
For production use with sensitive medical data, consider storing your Aleo private key on a hardware wallet like:
- Ledger
- Trezor
Encrypted File
Encrypted File
Save your private key in an encrypted file:
- Use built-in OS encryption (FileVault on macOS, BitLocker on Windows)
- Store in an encrypted container (VeraCrypt)
- Keep backups in separate secure locations
Paper Backup
Paper Backup
Write your private key on paper and store it in a secure location:
- Safe deposit box
- Home safe
- Fireproof document storage
Using Salud Securely
Verify URL
Check that you’re on the legitimate Salud Health domain before entering your private key.
Use Private Browsing (Optional)
Consider using incognito/private mode when accessing sensitive medical records to prevent browser history storage.
Network Security
Session Management
- Session Timeout: Your Salud session expires after inactivity
- Manual Disconnect: No explicit disconnect button - sessions are memory-only
- Browser Closure: Closing the browser immediately ends your session
- Private Key Handling: Your key is only kept in browser memory during active sessions
Using Your Existing Wallet
Can I Use My Leo/Shield Wallet Balance?
Yes! The private key you export from Leo Wallet or Shield Wallet is the same key that controls your wallet. This means:- ✅ Same Aleo wallet address
- ✅ Same token balance
- ✅ Same transaction history
- ✅ Access to the same on-chain records
Managing Multiple Applications
Think of it like this:- Leo Wallet = A secure vault for your private key that lets you sign transactions
- Salud Health = A specialized medical app that needs your private key for encryption
- Your Wallet = The underlying Aleo account controlled by the same private key
Switching Between Wallets
You can use different Aleo wallets in Salud:- Personal Records Wallet: For your own medical records
- Professional Wallet: If you’re a doctor accessing patient records
- Family Member Wallets: Managing records for dependents
Troubleshooting
'Invalid private key' error
'Invalid private key' error
Possible causes:
- Private key doesn’t start with
APrivateKey1 - Key is not exactly 59 characters
- Extra spaces or line breaks were copied
- Wrong format (not an Aleo private key)
- Re-export from your wallet carefully
- Check for hidden characters or spaces
- Verify the key starts with
APrivateKey1 - Try generating a new key if unsure
Cannot connect to backend
Cannot connect to backend
Possible causes:
- Backend server not running (if self-hosting)
- Firewall blocking connection
- Incorrect API URL configuration
- Ensure backend is running on port 3001
- Check
VITE_API_URLin frontend.env - Verify firewall settings
- Check browser console for connection errors
Private key not recognized after copy-paste
Private key not recognized after copy-paste
Possible causes:
- Clipboard added extra characters
- Key was split across multiple lines
- Copy-paste encoding issue
- Type the key manually
- Use a text editor to clean up formatting
- Copy from wallet extension again
- Check for invisible Unicode characters
Lost private key - can I recover my records?
Lost private key - can I recover my records?
Unfortunately, no.Aleo blockchain uses cryptographic encryption where your private key is the only way to decrypt your records. There is no password reset or recovery mechanism.Prevention:
- Store multiple encrypted backups
- Use a password manager
- Write down paper backups
- Test recovery process periodically
Different wallet address than expected
Different wallet address than expected
Possible causes:
- Using a different private key than intended
- Multiple accounts in your wallet extension
- Exported key from wrong account
- Verify which account is active in Leo/Shield Wallet
- Check that the exported key matches the expected address
- Derive the public address from your private key to confirm
Advanced Topics
Demo Mode (Testing)
For testing without spending Aleo credits:-
Configure backend
.env: -
In demo mode:
- ✅ All features work normally
- ✅ Records stored in localStorage
- ✅ No real blockchain transactions
- ⚠️ Records won’t persist across browsers/devices
Testnet vs Mainnet
Salud Health currently uses Aleo Testnet:- Free to use (test credits)
- Perfect for development and testing
- Records are real but use testnet tokens
- No real value at stake
ALEO_API_URL in backend .env:
Checking Your Balance
To check your Aleo wallet balance:- Via Salud: Dashboard displays your balance after connection
- Via Leo Wallet: Check balance in the wallet extension
- Via Aleo Explorer: Visit
https://explorer.aleo.organd search your address - Via API: GET
/api/wallet/balance/:sessionIdendpoint
Importing Generated Keys to Leo Wallet
If you generated a new account in Salud and want to manage it via Leo Wallet:Next Steps
Now that your wallet is set up:Patient Guide
Learn how to create and manage your medical records
Doctor Guide
Understand how to access shared patient records
Security Checklist
Before using Salud Health, ensure:- Private key is securely stored (password manager or hardware wallet)
- Multiple backups exist in separate secure locations
- Using HTTPS connection to Salud Health
- Verified the application URL is legitimate
- Understand that sessions are temporary and require reconnection
- Know that lost private keys cannot be recovered
- Using a secure network (not public WiFi)
- Device is protected with strong password/biometrics
- Antivirus/security software is active and updated