Saga Docs
Back to Saga
  • Introduction
    • Pegasus Overview
    • Saga Overview
      • Saga Topology
      • Saga Chainlets
      • Saga Shared Security
      • Validator Orchestration Tools
      • Token Mechanism and Economics
      • Validator Selection
      • Partnership Models
      • Paying for Chainlets
      • Staking on Saga
        • Staking your Saga on Keplr
        • Auto-compound your staking rewards with Restake.app
  • Saga Web App
    • Getting Access
    • Quickstart Guide
      • Testnet Quickstart Guide
      • Mainnet Quickstart Guide
    • Account Management
      • Requesting Tokens from Saga Faucet
      • Deposit Funds into Escrow
      • Withdraw Funds from Escrow
      • View Escrow Account Information
    • Working with Chainlet
      • Launch your Chainlet on Testnet
      • Launch your Chainlet on Mainnet
      • Get Chainlet Information
      • View Listing of Chainlets Launched
      • Chainlet APIs & BlockExplorer
      • Configuring Metamask Network
      • Chainlet Billing
      • Restarting a Stopped Chainlet
  • Sagacli
    • Getting Access
    • Quickstart Guide
      • Testnet Quickstart Guide
      • Mainnet Quickstart Guide
    • Download Saga CLI
    • Install Saga CLI
    • Configure Saga CLI
    • Key Management
      • Adding Keys
      • Listing Keys
      • Display Key Details
      • Deleting Keys
      • Renaming Keys
    • Account Management
      • Checking Account Balances
      • Requesting Tokens from Saga Faucet
      • Deposit Funds into Escrow
      • Withdraw Funds from Escrow
      • View Escrow Account Information
    • Working with Chainlet
      • View Listing of Chainlet Types
      • Launch your Chainlet on Testnet
      • Launch your Chainlet on Mainnet
      • Get Chainlet Information
      • View Listing of Chainlets Launched
      • Chainlet APIs & BlockExplorer
      • Configuring Metamask Network
      • Update Chainlet Version
      • Chainlet Billing
      • Restarting a Stopped Chainlet
    • Configuring sagacli - A Deep Dive
    • Searching for Transactions
  • Get Help & Support
Powered by GitBook
On this page
  • Command
  • Deleting Key Example
  • Checking Deletion
  • Further Details
  1. Sagacli
  2. Key Management

Deleting Keys

Command

To delete a key from sagacli, you can use the key delete command in the following manner:

sagacli keys delete <keyname>

IMPORTANT:: Please bear in mind that before you delete a key, you should ensure that

  1. There are no assets i.e. chainlets associated to the address belonging to the key being deleted. If there are any assets, you will not be able to transact with these assets as those transactions would require signatures provided by the key.

  2. The address associated with the key does not have an escrow balance. If the balance exists, you can only withdraw this balance if you have a way to regenerate the key being deleted.

  3. Most importantly, you should ensure that you have a way to regenecrate the key i.e. you have the mnemonic phrase used to create the key. Without this mnemonic, the key cannot be regenerated once deleted.

Deleting Key Example

In the following example, we have a key called test that we'd like to delete from sagacli

Here are the details of the key indicating that it is present in sagacli

$ sagacli keys show test1
- address: saga1z0uscdcprxcun2mlnyrz5kelemmjw768sdrgz5
  name: test1
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A+u4iLJZWZHHcRIEbme8ppbmk1jYTpZVio8anPqAIQ31"}'
  type: local

Note: It is a good idea to get prompted for confirmation while deleting a key. However, if you do not wish to be prompted for confirmation, simply pass the -y flag:

sagacli keys delete <keyname> -y

To delete with confirmation:

$ sagacli keys delete test1
Key reference will be deleted. Continue? [y/N]: y
Key deleted forever (uh oh!)

Checking Deletion

Here we list all existing keys in sagacli (default os keyring) to check that the key named test1 has actually been deleted.

$ sagacli keys list
- address: saga14hyhswxf0shnpzup406yvjejmfsrjnvzq897re
  name: fundkey
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A4lAzjJ4bZnZIEhYQvW+qsgg9SzwQOkOgFG+q5enEv4l"}'
  type: local
- address: saga1tkax73wxs047nc8kaalhfc4ar6gay2sde28crx
  name: mykey1
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A1YCpZPIzs6MXTiMAOnlEK6Cq8+JQMii9a4vUnyQ0qGs"}'
  type: local

Further Details

To get a full list of options on the keys delete command, type

sagacli keys delete --help
PreviousDisplay Key DetailsNextRenaming Keys

Last updated 1 year ago