Loading...
Loading...
Migrate an existing nansen-cli wallet from insecure password storage (env files, .credentials) to the new secure keychain-backed flow.
npx skill4agent add nansen-ai/nansen-cli nansen-wallet-keychain-migration~/.nansen/.env.envmemory.md⚠ Password loaded from insecure .credentials filewallet show# 1. Check if a wallet exists at all
nansen wallet list 2>&1
# 2. Check for insecure password stores
ls -la ~/.nansen/.env 2>/dev/null && echo "FOUND: ~/.nansen/.env (insecure)"
ls -la ~/.nansen/wallets/.credentials 2>/dev/null && echo "FOUND: .credentials file (insecure)"
# 3. Try an operation that requires the password (without setting env var)
nansen wallet export default 2>&1export⚠ Password loaded from ~/.nansen/wallets/.credentialsPASSWORD_REQUIRED~/.nansen/.env~/.nansen/.env"Your wallet password is currently stored in ~/.nansen/.env, which is insecure. I can migrate it to your OS keychain. Please confirm the password you used when creating the wallet, or I can read it from ~/.nansen/.env if you authorize it."
sourcenansen wallet securesource ~/.nansen/.env 2>/dev/null && nansen wallet secure# Unset env var to prove keychain works, then export to verify decryption
unset NANSEN_WALLET_PASSWORD
nansen wallet export default 2>&1Incorrect passwordnansen wallet forget-passwordrm -f ~/.nansen/.env.credentialswallet createnansen wallet securenansen wallet securenansen wallet export default 2>&1NANSEN_WALLET_PASSWORD# Persist the env var password to keychain
nansen wallet secureunset NANSEN_WALLET_PASSWORD
nansen wallet export default 2>&1"Your wallet password cannot be recovered. If you have funds in this wallet, they may be inaccessible. You can create a new wallet and transfer any remaining accessible funds."
# Create a fresh wallet (human must provide a new password)
NANSEN_WALLET_PASSWORD="<new_password_from_user>" nansen wallet create --name new-wallet# Unset env var to prove keychain works
unset NANSEN_WALLET_PASSWORD
# This MUST succeed — it proves the keychain password decrypts the wallet
nansen wallet export default 2>&1Incorrect passwordnansen wallet forget-password
NANSEN_WALLET_PASSWORD="<correct_password>" nansen wallet securestderr.credentialssecret-toolsecuritynansen wallet forget-password.credentialsNANSEN_WALLET_PASSWORDnansen wallet secure--human~/.nansen/.envsource ~/.nansen/.env && nansen wallet securenansen wallet export defaultwallet show