Manage Keys

Note: We are in the Alpha Testnet stage (Chain ID: nubit-alphatestnet-1), so the API may undergo incompatible changes in the future. If you encounter any issues, please join our Discord to get in touch with the Nubit Team.


List Keys

Use the following command to view your Nubit address list:

$HOME/nubit-node/bin/nkey list --p2p.network nubit-alphatestnet-1 --node.type $NODE_TYPE

Export Keys

If initializing the light node for the first time, a Nubit address named my_nubit_key will be automatically generated.

Please securely store your MNEMONIC, PUBKEY and AUTHKEY. The PUBKEY will serve as the unique credential for your light node address and play a crucial role in authentication during the alpha testnet campaign.

If you missed the mnemonic phrase for your address, no need to worry; you can use the following command to view your mnemonic phrase:

cat $HOME/nubit-node/mnemonic.txt

You can also use the following command to view the unarmored hex private key for the address: (Make sure your light node is running!)

$HOME/nubit-node/bin/nkey export my_nubit_key --unarmored-hex --unsafe --p2p.network nubit-alphatestnet-1 --node.type light

Replace my_nubit_key with the name of the address you want to query.

To check your PUBKEY, please use this command: (Make sure your light node is running!)

$HOME/nubit-node/bin/nkey list --p2p.network nubit-alphatestnet-1 --node.type light

Your Nubit light node address PUBKEY will be shown in this area.

Store Keys in Keplr Wallet

Nubit DA Alpha Testnet has been integrated with the Keplr wallet. Please refer to Connect Keplr Wallet for more details. To better manage your nubit address, you can import it into your Keplr wallet by following these steps.

Visit the Keplr Chains website at chains.keplr.app, search for "Nubit Alpha Testnet," and add it to your wallet.

Open the Keplr wallet extension and click the user avatar in the top right corner. Select "Add Wallet," then choose either "Import an existing wallet" or "Create a new wallet." Opt for the "24 words recovery phrase" and enter your mnemonic phrase, or opt for the "private key" and enter your unarmored hex private key.

Set a custom name for your wallet, select "Nubit Alpha Testnet" Chain and confirm. Your Nubit address will now appear in the Keplr wallet extension, ready for receive and send transactions. For more faucet details, please refer to Get NUB.

Import Keys

You can create a Nubit address in the Keplr wallet (please refer to Connect Keplr Wallet) and import its mnemonic phrase into nubit-node. Replace my_keplr_key with the desired key name. When prompted with "Enter your bip39 mnemonic," enter your mnemonic phrase:

$HOME/nubit-node/bin/nkey add my_nubit_key --recover --keyring-backend test --node.type light --p2p.network nubit-alphatestnet-1

Nubit-node also supports importing addresses using private key files. Refer to the following command, replacing my_nubit_key with the desired key name and ~/nubit-da/nubit-node/account1.private with the actual location of your private key file:

$HOME/nubit-node/bin/nkey import my_nubit_key ~/nubit-da/nubit-node/account1.private --keyring-backend test --node.type light --p2p.network nubit-alphatestnet-1

Delete Keys

Please note that nubit-node will only use the first key it encounters. If you wish to switch to a new key, you need to delete the previous key. This command will clear all your address data in nubit-node, so proceed with caution! We recommend exporting your keys and storing them safely before deleting any addresses to ensure you can reuse them later:

rm -rf $HOME/.nubit-light-nubit-alphatestnet-1

You can also use the following command to delete specific key:

nkey delete <The Name of Key> -f --node.type light --p2p.network nubit-alphatestnet-1

For optimal management, we recommend saving only one set of key named my_nubit_key and avoiding the retention of multiple keys. Additionally, when deciding to delete a key, always remember to export your key and save it securely before deletion. This precaution ensures that you can restore it later if needed.

Last updated