Create a New Account (CLI)
⚠️ ALWAYS back up your key and/or mnemonic after creating a new account ⚠️
Store it in a secure location accessible only to you, such as a password manager, or written down in a safe place.
Quickstart tl;dr
Add a new wallet:
pocketd keys add $USERRetrieve the address:
pocketd keys show $USER -aPrerequisites: Install pocketd
pocketdEnsure you have pocketd installed on your system.
Follow the installation guide specific to your operating system:
https://dev.poktroll.com/explore/account_management/pocketd_cli
Exporting & Importing Hex Private Keys
You can import a hex private key into your keyring like so:
pocketd keys import-hex <wallet_name> <hex_private_key>And export a hex private key from your keyring like so:
pocketd keys export <wallet_name> --unsafe --unarmored-hex --yesFor more details, see:
pocketd keys --helpCreating a new wallet
To create a new wallet, use the pocketd keys add command followed by your desired wallet name. This will generate a new address and mnemonic phrase for your wallet.
pocketd keys add <insert-your-desired-wallet-name-here>After running the command, you'll receive an output similar to the following:
- address: pokt1beef420
name: myNewWallet
pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A31T7iUyr6SwT5Wyy3BNgRqlObq3FqYpW4cTAkfE+6c2"}'
type: local
**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.
your seed mnemonic phase hereBacking Up Your Wallet
After creating your wallet, YOU MUST back up your mnemonic phrase. This phrase is the key to your wallet, and losing it means losing access to your funds.
Here are some tips for securely backing up your mnemonic phrase:
Write it down on paper and store it in multiple secure locations.
Consider using a password manager to store it digitally, ensuring the service is reputable and secure.
Avoid storing it in plaintext on your computer or online services prone to hacking.
🔑 HD Derivation Path
pocketd supports BIP-0044-compatible HD wallets, with POKT registered under coin_type = 635 ( path_component = 0x8000027b). This assignment is defined in SLIP-0044.
The default derivation path used is:
m/44'/635'/0'/0/0To use this path, run:
pocketd keys add --coin-type=635You can view additional options with:
pocketd keys add --helpReferences:
BIP-0044: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki
SLIP-0044: https://github.com/satoshilabs/slips/blob/master/slip-0044.md
Keyring Backends
Before proceeding, it's critical to understand the implications of keyring backends for securing your wallet.
By default, --keyring-backend=test is used for demonstration purposes in this documentation, suitable for initial testing.
In production, operators should consider using a more secure keyring backend such as os, file, or kwallet. For more information on keyring backends, refer to the Cosmos SDK Keyring documentation:
https://docs.cosmos.network/main/user/run-node/keyring
Keyring Directory Behavior: --home, --keyring-backend, and --keyring-dir
--home, --keyring-backend, and --keyring-dirIn the Cosmos SDK (and thus in pocketd):
--homesets the root directory for app state (default:~/.pocket)--keyring-backendsets how keys are stored (os,file,test,memory)--keyring-diroverrides where keys are stored, but still nests by backend
Example:
pocketd keys list --home=. --keyring-backend=test --keyring-dir=./fooThis creates:
./foo/keyring-test/So --keyring-dir works, but the backend (e.g. test) decides the final subfolder. That’s why you see foo/keyring-test.
This creates the keyring directory inside of the path you provide to --keyring-dir, with a subfolder corresponding to the backend you choose.
Was this helpful?
