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 $USER
Retrieve the address:
pocketd keys show $USER -a
Table of Contents
This guide will walk you through creating a new wallet on the Pocket Network.
- Prerequisites: Install
pocketd
- Exporting & Importing Hex Private Keys
- Creating a new wallet Wallet
- Backing Up Your Wallet
- 🔑 HD Derivation Path
- Keyring Backends
Prerequisites: Install pocketd
Ensure you have pocketd
installed on your system.
Follow the installation guide specific to your operating system.
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 --yes
For more details, see:
pocketd keys --help
Creating a new wallet 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 here
Backing 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/0
To use this path, run:
pocketd keys add --coin-type=635
You can view additional options with:
pocketd keys add --help
References:
- BIP-0044: bitcoin/bips/blob/master/bip-0044.mediawiki
- SLIP-0044: 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.
Keyring Directory Behavior: --home
, --keyring-backend
, and --keyring-dir
In the Cosmos SDK (and thus in pocketd
):
--home
sets the root directory for app state (default:~/.pocket
)--keyring-backend
sets how keys are stored (os
,file
,test
,memory
)--keyring-dir
overrides where keys are stored, but still nests by backend
Example:
pocketd keys list --home=. --keyring-backend=test --keyring-dir=./foo
This 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.