Security practices for private key management and safe Web3 operations with WalletAgent.
WalletAgent Security Features
WalletAgent includes multiple security layers:
Mock Mode Default - Safe testing environment
Transaction Previews - See exactly what will happen
Input Validation - Prevents common mistakes
Encrypted Storage - AES-256-GCM for private keys
Session Management - Automatic timeouts and cleanup
Never Logs Secrets - Private keys never written to logs
Mock Mode Security
Why Start with Mock Mode
Mock mode provides complete safety for learning:
Get wallet info
Safe Mock Mode Output:
🔧 Wallet Configuration
- Type: Mock (safe for testing) ✅
- Available Accounts: 3
- Current Chain: Anvil (31337)
- Native Currency: ETH
💡 You're in mock mode - perfect for learning!
🛡️ No real funds at risk
Mock Mode Benefits
✅ Zero Risk - No real money involved
✅ Unlimited Funds - Test wallets never run out
✅ All Operations - Practice everything safely
✅ Reversible Learning - Make mistakes without consequences
Import private key from MAIN_WALLET_KEY environment variable with label 'Production Main'
Import additional private key with label 'Backup Trading Account'
List my encrypted keys to see stored addresses and labels
Check keystore status to confirm setup
Lock keystore when not actively trading
Unlock keystore only when needed for operations
Check keystore status
Unlock encrypted keystore for today's operations
Connect to my encrypted wallet address
Send 1 ETH to recipient # Uses encrypted key transparently
Check my balance # Shows balance for encrypted address
Transfer 100 USDC tokens # All operations use encrypted keys securely
Lock encrypted keystore for security
Unlock encrypted keystore
Import new private key with label 'DeFi Operations'
List encrypted keys to confirm addition
Update label for key 0x... to 'Main Trading Account'
Remove old encrypted key that's no longer needed
List encrypted keys to see current organization
Change keystore master password quarterly for security
Verify all encrypted keys are properly labeled
Check keystore status regularly
Create encrypted keystore with master password
Import encrypted private key from PRIVATE_KEY_ENV
Send 1 ETH to 0x70997970C51812dc3A010C7d01b50e0d17dc79C8
# Good practices:
"Confirm this address: 0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
"Is this the correct recipient for my payment?"
"Double-check this address format"
# Bad practices:
❌ Trusting addresses from unverified sources
❌ Not checking addresses character by character
❌ Copying addresses from suspicious websites
Simulate transfer 100 USDC to 0x7099
# Safe approach:
"Get contract info for 0x..."
"Simulate mint function before executing"
"What does this contract do?"
# Risky approach:
❌ Interacting with unverified contracts
❌ Signing transactions without understanding
❌ Trusting contract addresses from untrusted sources
# Conservative approach:
Approve 100 USDC for specific transaction
# Risky approach:
❌ Approve unlimited USDC for unknown contract
Revoke all USDC approvals
Check all token approvals for my wallet
What chain am I on?
❌ Never share:
- Private keys
- Seed phrases
- Master passwords
- Session tokens
✅ Safe to share:
- Public addresses
- Transaction hashes
- Public keys
- Wallet connection status