[Feature Request]: Secure Wallet Management for Aptos CLI #14883
Labels
enhancement
New feature or request
stale-exempt
Prevents issues from being automatically marked and closed as stale
Current Situation
The Aptos CLI currently stores private keys and mnemonics in plain text within a
.aptos
folder typically located in a project's root directory. This approach has several drawbacks:Proposed Solution
Implement a secure wallet management system for the Aptos CLI, similar to Foundry's wallet commands, while maintaining compatibility with the existing profile-based system. This system should:
Feature Details
New Wallet Commands
Introduce the following wallet commands to the Aptos CLI:
aptos wallet
: Display wallet management help and available subcommands.aptos wallet list
: List all available wallets.aptos wallet new [name]
: Create a new wallet with an optional name.aptos wallet import [name]
: Import an existing private key or mnemonic.aptos wallet export [name]
: Securely export a wallet's private key or mnemonic.aptos wallet remove [name]
: Remove a wallet from the management system.aptos wallet sign [name] [message]
: Sign a message using the specified wallet.aptos wallet verify [address] [signature] [message]
: Verify a signature.aptos wallet link [wallet_name] [profile_name]
: Associate a wallet with an existing profile(profiles could still be local to a prjoect?).aptos wallet info [wallet_name]
: Display wallet information, such as associated profiles.Integration with Existing CLI Commands
To maintain compatibility with existing CLI commands:
Modify the
aptos init
command to optionally use a wallet:Introduce a new
--wallet
flag as an alternative to--profile
in all existing commands:Maintain support for the current
--profile
flag in all existing commands.When a profile is specified, the CLI will first check if it's associated with a wallet. If so, it will use the wallet's credentials. If not, it will fall back to the current behavior of using the profile's stored private key.
Usage Examples
Creating a multisig account using a profile (current method, backward compatible):
Creating a multisig account using a wallet directly:
Implementation Considerations
~/.aptos/wallets/
) rather than in individual project directories.Benefits
The text was updated successfully, but these errors were encountered: