Using a hardware wallet to store your private keys comes in handy and improves the security of your crypto assets. The Ledger device acts as an enclave of the seed phrase (mnemonic) and private keys and thereby the process of signing transaction takes place within it. Your private information is secure and will not leak from the Ledger device. Here is a short tutorial on using the Persistence Ledger app with the PersistenceCore CLI.
At the core of a Ledger device there is a mnemonic (seed phrase) that is used to generate private keys. The seed phrase is generated when you initialize your Ledger. The mnemonic is compatible with Persistence and can be used to seed new accounts.
::: Danger Do not lose or share your 24 words seed phrase with anyone. To prevent theft or loss of funds, we recommend you to keep multiple copies of your mnemonic stored in safe and secure locations. Please be aware that if someone gains access to your mnemonic, they can fully control your associated accounts. :::
Installing the Persistence application on your ledger device is required before you
use persistenceCore
. To do so, you need to:
- Install Ledger Live on your machine.
- Using Ledger Live, update your Ledger Device with the latest firmware . On the Ledger Live application, navigate to the Menu and then the Manager menu item.
- Connect your Ledger Nano device and select the Allow Ledger Manager on your device check box.
- On the Ledger Live application, search for Persistence.
- Install the Persistence application by clicking Install.
You can sign into your Persistence Wallet and do all transactions using the Ledger Nano device without having the need to use your private key or mnemonic.
Prerequisites: Install the Persistence app on your Ledger Nano before doing the following task.
- After connecting your Ledger device to the computer, unlock it with the PIN and open the Persistence Wallet app on your Ledger device.
- Open the Persistence Wallet in your web browser.
- Select Sign in on the web wallet.
- You can now start using Persistence Wallet with your Ledger Nano.
Note: When you transact on Persistence Wallet (Send or Stake), you need to confirm the transaction on your Ledger device. An indication is displayed on your Persistence Wallet app to approve or reject the transaction.
After you're signed in, you can verify your wallet address with the address on the Ledger device by using the Verify
button.
Note: You need to install the Persistence app on your Ledger Nano before performing this task.
The tool used to generate addresses and transactions on the Persistence is persistenceCore. Here is how to get started.
Verify that persistenceCore is installed correctly with the following command:
persistenceCore version --long
➜ name: persistenceCore
server_name: persistenceCore
version: 0.1.3-2-gebc7dc7
commit: ebc7dc7
build_tags: netgo,ledger
go version go1.14.5 darwin/amd64
- Connect and unlock your Ledger device.
- Open the Persistence app on your Ledger device.
- Create an account in persistenceCore from your ledger key.
::: Tip Change the keyName parameter to a meaningful name so that you can identify it with ease. The Ledger flag indicates persistenceCore to use your Ledger to seed the account. :::
persistenceCore keys add <keyName> --ledger
➜ NAME: TYPE: ADDRESS: PUBKEY:
<keyName> ledger persistence1... persistencepub1...
Persistence uses HD wallets. This means you can setup multiple accounts using the same Ledger seed. To create another account from your Ledger device, run (change the integer i to some value >= 0 to choose the account for HD derivation):
persistenceCore keys add <secondKeyName> --ledger --account <i>
Run this command to display your address on the device. Use the keyName that you entered on your ledger key. The -d flag is supported in version 1.2.0 and higher.
persistenceCore keys show <keyName> -d
Confirm that the address displayed on the device matches the one that's displayed when you added the key.
Next, you need to configure persistenceCore with the URL of a Persistence full node and the appropriate chain_id . In this example, we connect to the public load balanced full node operated by Persistence on the core-1 chain. You can point your persistenceCore to any Persistence full node. Be sure that the chain-id is set to the same chain as the full node.
Test your connection with a query such as:
persistenceCore query staking validators --node https://rpc.core.persistence.one:443 --chain-id core-1
::: Tip To run your own full node locally read more here.. :::
You are now ready to start signing in and sending transactions. Send a transaction with persistenceCore using the ** tx send** command.
persistenceCore tx bank send --help # to see all available options.
::: Tip Ensure that you unlock your device with the PIN and then open the Persistence app before trying to run these commands :::
Use the keyName you set for your Ledger key and persistenceCore will connect with the Persistence Ledger app to then to sign your transaction.
persistenceCore tx bank send <keyName> <destinationAddress> <amount><denomination> --node https://rpc.core.persistence.one:443 --chain-id core-1
When you are shown the message, Confirm transaction before signing, select Answer Y.
When you are prompted to review and approve the transaction on your Ledger device, make sure to inspect the transaction JSON displayed on the screen. You can scroll through each field and each message. Scroll down to read more about the data fields of a standard transaction object.
Now, you are all set to start sending transactions on the network.
To receive funds to the Persistence Wallet account on your Ledger device, retrieve the address to your Ledger account (
the ones with TYPE ledger
) with this command:
persistenceCore keys list
➜ NAME: TYPE: ADDRESS: PUBKEY:
<keyName> ledger persistence1... persistencepub1...
If you aren't sure what persistenceCore can do, just run the command without arguments to output documentation for the commands it supports.
::: Tip
The persistenceCore help commands are nested. So $ persistenceCore
will output docs for the top level commands (
status, config, query, and tx). You can access documentation for sub commands with further help commands.
For example, to print the query commands:
persistenceCore query --help
Or to print the tx (transaction) commands:
persistenceCore tx --help
:::
Transactions in Persistence embed the Standard Transaction type from the Cosmos SDK. The Ledger device displays a serialized JSON representation of this object for you to review before signing the transaction. Here are the fields and what they mean:
- chain-id: The chain to which you are broadcasting the tx, such as the test-core-2 testnet or core-1: mainnet.
- account_number: The global ID of the sending account assigned when the account receives funds for the first time.
- sequence: The nonce for this account, incremented with each transaction.
- fee: JSON object describing the transaction fee, its gas amount and coin denomination
- memo: optional text field used in various ways to tag transactions.
- msgs_/: The array of messages included in the transaction. Double click to drill down into the nested fields of the JSON.
For any questions or support, do reach us out on our Telegram channel.