TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/provablehq/leo/llms.txt
Use this file to discover all available pages before exploring further.
leo account command provides tools for managing Aleo accounts, including generating keys, importing accounts, signing messages, and verifying signatures.
Syntax
Subcommands
new
Generate a new Aleo account with a random private key.import
Import an Aleo account from a private key.sign
Sign a message using your Aleo private key.verify
Verify a signature from an Aleo address.decrypt
Decrypt a record ciphertext using your private or view key.New Options
Seed the RNG with a numeric value for reproducible key generation.
Write the private key to the
.env file in the current directory.Print sensitive information (private key) to an alternate screen for privacy.
Network type:
mainnet, testnet, or canary.Network endpoint URL.
Import Options
Private key to import. If not provided, will prompt interactively.
Write the private key to the
.env file.Print sensitive information discreetly.
Network type.
Network endpoint URL.
Sign Options
Private key to use for signing.
Path to file containing the private key.
Message (Aleo value) to sign.
Parse the message as bytes instead of Aleo literals.
Network type.
Verify Options
Address to use for verification.
Signature to verify.
Message (Aleo value) to verify against.
Parse the message as bytes instead of Aleo literals.
Network type.
Decrypt Options
Private key or view key to use for decryption.
Path to file containing the private key or view key.
Record ciphertext to decrypt (starts with
record1).Network type.
Examples
Generate New Account
Generate and Write to .env
.env:
Generate with Seed (Testing)
Generate Discreetly
Import Account
Import Interactively
Import and Write to .env
Sign a Message
Sign Aleo Literal
Sign from File
Sign Raw Bytes
Verify a Signature
Verify Raw Message
Decrypt Record with Private Key
Decrypt Record with View Key
View keys can decrypt records but cannot spend them.
Decrypt from File
Key Formats
Private Key
Format:APrivateKey1zkp...
A private key allows:
- Signing transactions
- Decrypting records
- Deriving view key and address
- Full account control
View Key
Format:AViewKey1...
A view key allows:
- Decrypting records
- Viewing transaction details
- Cannot spend funds
Address
Format:aleo1...
A public address for:
- Receiving funds
- Identifying accounts
- Public visibility
Key Derivation
The relationship between keys:- Private Key: Full control, keep secret
- View Key: Read-only access, can share selectively
- Address: Public identifier, safe to share
Security Best Practices
1. Generate Securely
2. Store Safely
3. Never Share Private Keys
4. Use View Keys for Read-Only Access
5. Backup Securely
6. Test with Small Amounts
Message Signing Use Cases
Authentication
Prove account ownership without revealing private key:Data Integrity
Sign data to prove authenticity:Timestamping
Create unforgeable timestamps:Record Decryption
Records are encrypted on-chain. Decrypt them with your key:- Credits records (from
credits.aleo) - Custom program records
- Fee records
Environment Variables
Store account info in.env:
Troubleshooting
Invalid Private Key Format
- Private key starts with
APrivateKey1 - Full key is provided (not truncated)
- No extra whitespace
Signature Verification Failed
- Address matches the signing private key
- Message exactly matches signed message
- Signature is complete and correct
Decryption Failed
- Ciphertext starts with
record1 - Key corresponds to the record owner
- Record ciphertext is complete