Skip to content

Commit

Permalink
Fixed some commands and outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
galina-opentensor committed Jul 3, 2024
1 parent 2f97cf6 commit eb6d304
Showing 1 changed file with 32 additions and 30 deletions.
62 changes: 32 additions & 30 deletions docs/getting-started/wallets.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Use this option if you are creating a subnet or participating as a subnet valida

After you have [installed Bittensor](installation.md), you can create a local wallet on your machine in the following two ways:

- Using `btcli`.
- Using Python.
- [Using `btcli`](#creating-a-coldkey-using-btcli)
- [Using Python](#creating-a-wallet-using-python)

### Coldkey and hotkey

Expand All @@ -66,7 +66,7 @@ If you plan to perform any of the following tasks, you only need to create a col

**However, if you want to validate or mine in a subnet, you will need to create hotkey also**. See the below section [Creating a hotkey using `btcli`](#creating-a-hotkey-using-btcli).

Run the following command on your terminal by giving a name to your wallet, replacing the `my_coldkey`.
Run the following command on your terminal by giving a name to your wallet, replacing the `<my_coldkey>`.

```bash
btcli wallet new_coldkey --wallet.name <my_coldkey>
Expand Down Expand Up @@ -96,15 +96,15 @@ If you plan to validate or mine in a subnet, then you must create both a coldkey

First create a coldkey as described above in the [Creating a coldkey using `btcli`](#creating-a-coldkey-using-btcli). Then provide this coldkey as a parameter to generate a hotkey. This will pair the hotkey with the coldkey. See below.

Use the below command to generate the hotkey. Replace `<my_coldkey>` with the coldkey generated above, and `<my_first_hotkey>` with a name for your hotkey.
Use the below command to generate the hotkey. Replace `<my_coldkey>` with the coldkey generated above, and `<my_hotkey>` with a name for your hotkey.

```bash
btcli wallet new_hotkey --wallet.name <my_coldkey> --wallet.hotkey <my_first_hotkey>
btcli wallet new_hotkey --wallet.name <my_coldkey> --wallet.hotkey <my_hotkey>
```

For example,
```bash
btcli wallet new_hotkey --wallet.name test-coldkey --wallet.hotkey my_first_hotkey
btcli wallet new_hotkey --wallet.name test-coldkey --wallet.hotkey test-hotkey
```

You will see the terminal log like below. The mnemonic is hidden for security reasons.
Expand All @@ -128,18 +128,18 @@ btcli wallet new_hotkey --use_password

## Creating a wallet using Python

Copy and paste the following three lines into your Python interpreter. Replace the string values for `name` (`my_coldkey`) and `hotkey` (`my_first_hotkey`) with your own.
Copy and paste the following three lines into your Python interpreter. Replace the string values for `name` (`my_coldkey`) and `hotkey` (`my_hotkey`) with your own.

```python showLineNumbers
import bittensor as bt
wallet = bt.wallet(name = 'my_coldkey', hotkey = 'my_first_hotkey' )
wallet = bt.wallet(name = 'my_coldkey', hotkey = 'my_hotkey' )
wallet.create_if_non_existent()
```

You will see a terminal output like this for an example wallet with `name` as `tst1_coldkey` and `hotkey` as `tst1_hotkey`. The mnemonic is hidden for security reasons.
You will see a terminal output like this for an example wallet with `name` as `test-coldkey` and `hotkey` as `test-hotkey`. The mnemonic is hidden for security reasons.
```text
>>> import bittensor as bt
>>> wallet = bt.wallet(name = 'tst1_coldkey', hotkey = 'tst1_hotkey')
>>> wallet = bt.wallet(name = 'test-coldkey', hotkey = 'test-hotkey')
>>> wallet.create_if_non_existent()
IMPORTANT: Store this mnemonic in a secure (preferable offline place), as anyone who has possession of this mnemonic can use it to regenerate the key and access your tokens.
Expand All @@ -151,8 +151,6 @@ The mnemonic to the new coldkey is:
You can use the mnemonic to recreate the key in case it gets lost. The command to use to regenerate the key using this mnemonic is:
btcli w regen_coldkey --mnemonic **** **** **** **** **** **** **** **** **** **** **** ****
Specify password for key encryption:
Password not strong enough. Try increasing the length of the password or the password complexity
Specify password for key encryption:
Retype your password:
Expand All @@ -165,8 +163,7 @@ The mnemonic to the new hotkey is:
You can use the mnemonic to recreate the key in case it gets lost. The command to use to regenerate the key using this mnemonic is:
btcli w regen_hotkey --mnemonic **** **** **** **** **** **** **** **** **** **** **** ****
wallet(tst1_coldkey, tst1_hotkey, ~/.bittensor/wallets/)
>>>
wallet(test-coldkey, test-hotkey, ~/.bittensor/wallets/)
```

## Location and addresses of the local wallets
Expand All @@ -182,22 +179,23 @@ You will see an output like this:
```bash
tree ~/.bittensor/
/Users/docwriter/.bittensor/ # The Bittensor root directory.
└── wallets # The folder containing all Bittensor wallets.
└── tst1_coldkey # The name of the wallet.
   ├── coldkey # The password-encrypted coldkey.
   ├── coldkeypub.txt # The unencrypted version of the coldkey.
   └── hotkeys # The folder containing all this coldkey's hotkeys.
   └── tst1_hotkey # The unencrypted hotkey information.
└── wallets # The folder containing all Bittensor wallets.
└── test-coldkey # The name of the wallet.
   ├── coldkey # The password-encrypted coldkey.
   ├── coldkeypub.txt # The unencrypted version of the coldkey.
   └── hotkeys # The folder containing all this coldkey's hotkeys.
   └── test-hotkey # The unencrypted hotkey information.
```

and listing out the contents of the `coldkeypub.txt` file:

```bash
cd ~/.bittensor/wallets/tst1_coldkey
cd ~/.bittensor/wallets/test-coldkey
cat coldkeypub.txt | jq
{
"accountId": "0x36e49805b105af2b5572cfc86426247df111df2f584767ca739d9fa085246c51",
"publicKey": "0x36e49805b105af2b5572cfc86426247df111df2f584767ca739d9fa085246c51",
"privateKey": null,
"secretPhrase": null,
"secretSeed": null,
"ss58Address": "5DJgMDvzC27QTBfmgGQaNWBQd8CKP9z5A12yjbG6TZ5bxNE1"
Expand All @@ -214,20 +212,21 @@ The contents of the `coldkeypub.txt` are to be interpreted as below:
Use this site [SS58.org](https://ss58.org/) to verify the conversions between `publicKey` and `ss58Address` fields.
:::

Similarly, listing out the contents of the `hotkeys/tst_hotkey` file:
Similarly, listing out the contents of the `hotkeys/test-hotkey` file:

```bash
cat hotkeys/tst1_hotkey | jq
cat hotkeys/test-hotkey | jq
{
"accountId": "0xc66695556006c79e278f487b01d44cf4bc611f195615a321bf3208f5e351621e",
"publicKey": "0xc66695556006c79e278f487b01d44cf4bc611f195615a321bf3208f5e351621e",
"privateKey": "0x38d3ae3b6e4b5df8415d15f44f * * * 0f975749f835fc221b * * * cbaac9f5ba6b1c90978e3858 * * * f0e0470be681c0b28fe2d64",
"secretPhrase": "pyramid xxx wide slush xxx hub xxx crew spin xxx easily xxx",
"secretSeed": "0x6c359cc52ff1256c9e5 * * * 5536c * * * 892e9ffe4e4066ad2a6e35561d6964e",
"ss58Address": "5GYqp3eKu6W7KxhCNrHrVaPjsJHHLuAs5jbYWfeNzVudH8DE"
}
```

The contents of the `hotkeys/tst1_hotkey` file are to be interpreted as below:
The contents of the `hotkeys/test-hotkey` file are to be interpreted as below:

- The fields `accountId` and `publicKey` contain the same value, just as seen in `coldkeypub.txt`.
- The `secretPhrase` and `secretSeed` are shown because the hotkey is by default not encrypted.
Expand All @@ -243,11 +242,11 @@ You will see a terminal output like this:
```text
Wallets
└─
tst1_coldkey (5DJgMDvzC27QTBfmgGQaNWBQd8CKP9z5A12yjbG6TZ5bxNE1)
└── tst1_hotkey (5GYqp3eKu6W7KxhCNrHrVaPjsJHHLuAs5jbYWfeNzVudH8DE)
test-coldkey (5DJgMDvzC27QTBfmgGQaNWBQd8CKP9z5A12yjbG6TZ5bxNE1)
└── test-hotkey (5GYqp3eKu6W7KxhCNrHrVaPjsJHHLuAs5jbYWfeNzVudH8DE)
```

The output will show only the `ss58Address` field values from the `coldkeypub.txt` and `tst1_hotkey` files of the wallets.
The output will show only the `ss58Address` field values from the `coldkeypub.txt` and `test-hotkey` files of the wallets.

:::tip Use the ss58Address keys as destinations for TAO
Use the above shown `ss58Address` field values as your public wallet addresses, i.e., as destinations for TAO transfers from another wallet to your wallet. For example, when using a command: `btcli wallet transfer`.
Expand Down Expand Up @@ -421,8 +420,11 @@ It is important that you update any legacy Bittensor wallets to the new NaCL for
See the below example command and the terminal output:
```bash
btcli wallet update
>> Do you want to update all legacy wallets? [y/n]: n
>> ===== wallet(tst1_coldkey, default, ~/.bittensor/wallets/) =====
```
You will see an output like this:
```bash
>> Do you want to update all legacy wallets? [y/n]: y
>> ===== wallet(test-coldkey, default, ~/.bittensor/wallets/) =====
>> ✅ Keyfile is updated.
>> 🔑 Keyfile (NaCl encrypted, ~/.bittensor/wallets/tst1_coldkey/coldkey)>
>> 🔑 Keyfile (NaCl encrypted, /Users/docwriter/.bittensor/wallets/test-coldkey/coldkey)>
```

0 comments on commit eb6d304

Please sign in to comment.