How to create a Cosmos address
In order to do some operations on Cosmos Hub, you need to hold some ATOMs and the first thing you need to do is to create your own Cosmos address. There are many ways to create a Cosmos address.
1. Using a mobile wallet — Cosmostation Wallet
Cosmostation has developed a mobile wallet which has both iOS and Android versions. They have also open-sourced their codes so anyone can review them and verify if there are any security issues.
When you open the wallet the first time, it will ask you to “Import” or “Create” an address. Let’s create a new address by tapping “CREATE”. It will then ask you to create your own 4-digit + 1-character password. Make sure you remember the combination as this password is for you to manage the wallet.
Then it will generate a 24-word mnemonic seed phrase. This phrase is used to create your key pair in your wallet so please make sure you don’t lose it as this is the only information you can rely on to restore your wallet if you have deleted the app or lost your phone. Tap “Create Wallet” and choose “COSMOS” in the next screen. A new address will be created.
You can find your address in the wallet app. This represent where you hold your ATOMs and it is an identity on the Cosmos Hub.
Using a mobile software wallet is considered less secured as you cannot verify if the application you have installed is the same as the codes provided publicly. Also if your mobile device is compromised, your key could be stolen as your mobile phone is always connected to the internet.
2. Using Command Line Interface (CLI)
This works for Linux and Mac users. For Windows users, please install Windows Subsystem for Linux and follow the Linux instructions.
The CLI can be built directly from the source of gaia
which is the software for running a Cosmos Hub full node. It is developed in Go
so first you have to installGo 1.12+.
For Linux (Ubuntu as an example)
Run the following commands in your Linux terminal. It will install Go
and required packages for building the software.
sudo apt install -y git gcc make
sudo snap install --classic go
For Mac
Open Terminal and run the following commands. It will install Homebrew
and Go
. During the installation of Homebrew
, it will ask you to install xcode-select
and please install as it prompts.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install go git
After successfully installing Go
, you can test running it and see the version you have installed.
go version
And you will see a response like this.
go version go1.12.7 darwin/amd64
Now get the gaia
source codes and build the software.
git clone https://www.github.com/cosmos/gaia
cd gaia
git checkout v1.0.0-rc1
make install
After a few minutes, two binary files gaiad
and gaiacli
will be created and placed under $HOME/go/bin
by default. You can run gaiacli version --long
and you should see this.
name: gaia
servername: gaiad
clientname: gaiacli
version: 1.0.0-rc1
gitcommit: fd2691818f4fbb5b03b79481ae8e2f07d9a7d0b0
buildtags: netgo,ledger
goversion: go version go1.12.7 darwin/amd64
Now you are ready to create your Cosmos address on your local computer.
Run gaiacli keys add <your_name>
, for example,
gaiacli keys add kwun
It will ask you to enter a passphrase twice which is for encrypting your key on the disk.
Enter a passphrase to encrypt your key to disk:
Repeat the passphrase:
After entering the passphrase, your key is created and you can see output similar to this.
- name: kwuntype: localaddress: cosmos1wze8mn5nsgl9qrgazq6a92fvh7m5e6psjcx2du
pubkey: cosmospub1addwnpepqd5xvvdrw7dsfe89pcr9amlnvx9qdkjgznkm2rlfzesttpjp50jy2lueqp2
mnemonic: ""
threshold: 0
pubkeys: []**Important** write this mnemonic phrase in a safe place.It is the only way to recover your account if you ever forget your password.insane hero kingdom bench song van acquire mixture cliff pear envelope artefact firm kangaroo save lake acquire juice boat leave wave coach lab minimum
You can find the address, which is cosmos1wze8mn5nsgl9prgazq6a92fvh7me6psjcx2du
in the above example, in the output and the last line is the 24-word mnemonic seed phrase which can be used to restore your key if you have lost it. So make sure you don’t lose this phrase.
Using CLI on your computer is still not considered as a very secured way of storing your key either. It has the same risk considerations if your computer is always connecting to the internet and might be compromised. However, you can ensure you are running the trusted codebase by building the binary from source codes directly. You may consider storing the key in an offline and clean computer.
3. Using a hardware wallet — Ledger Nano X
A Cosmos address can also be created directly on a Ledger Nano S or Ledger Nano X. You can get one directly from https://www.ledger.com/.
For a brand new Ledger Nano X, it will ask you to enter a 4–8 digit pin which is used to lock the Ledger and ask you to choose the length of the mnemonic phrase, please choose 24-word when you see the prompt. Follow the on-screen instructions will help you setup the Ledger correctly and a key is created inside the Ledger. You can get your Cosmos address by install the Cosmos App on it.
Download and install Ledger Live. You can manage your Ledger Nano S on Mac, Linux & Windows and also on iOS and Android for Ledger Nano X via bluetooth using Ledger Live. The first time you open Ledger Live, it will guide you to setup and link up with your Ledger.
The Cosmos App cannot be found in the app list by default. After Ledger Live is set up, open Settings
and turn on Developer mode
.
Now, make sure your Ledger is unlocked and connected to your computer and click “Manager” on the left menu. Allow Ledger Live to access your Ledger by confirming on Ledger. Then you can search for “Cosmos” in the Manager and found this.
Click install and it will install the Cosmos app onto your Ledger. Run the app on your Ledger and choose “Show Address” by pressing the both buttons. Pressing both buttons again twice which choose “Account 0” and “Index 0”. Your Cosmos address will be shown on the Ledger.
This is the most secure way among these methods to store ATOMs as the key is stored in a separate device which it only has functions on managing the key and it will not be connected unless you need it.
With the Cosmos address, you can now store ATOMs on it. You can use the CLI to send transactions or if you have you address on a Ledger, you can log in The Big Dipper with your Ledger to send ATOMs or delegate them to any validators to earn rewards.
Welcome to the Cosmos!