Skip to content

Commit 2b74f6b

Browse files
authored
Merge pull request #78 from latent-to/multisig
Multisig updates
2 parents a928698 + 443721a commit 2b74f6b

File tree

2 files changed

+88
-53
lines changed

2 files changed

+88
-53
lines changed

docs/keys/multisig.md

Lines changed: 80 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
title: "Secure your Coldkey with a Multisig"
2+
title: "Secure your Coldkey with a Multisig Wallet"
33
---
44

5-
# Secure a Coldkey with a Multisig
5+
# Secure a Coldkey with a Multisig Wallet
66

77
A multisig (multiple signatories) wallet is a way of distributing responsibility for a coldkey across a set of wallets, referred to as signatories. Any signatory can propose a transaction, but the action must be agreed by some threshold of others before it will execute. Conventionally, a multisig is described as "$M$ out of $N$", where $M$ is the threshold number of signatories required to sign a transaction and $N$ is the total number of signatories. The signatories on a multisig may be seperate people, or a set of keys controlled by a single individual. This gives multisigs great versatility in providing security against single points of failure, including the loss of a single key or the decision of a team-mate to act irresponsibly.
88

@@ -14,7 +14,7 @@ This page will guide the user through an example practice workflow of creating a
1414

1515
- [Install the latest version of BTCLI](../getting-started/install-btcli)
1616
- Acquire some Testnet TAO.
17-
- Polkadot-JS: This tutorial will employ the Polkadot-JS browser app, which allows users to submit transactions to Polkadot-based chains, including Bittensor. To use your coldkey private keys with the Polkadot-JS app, you must install the wallet browser extension, which is available for Firefox or Chrome.
17+
- Polkadot-JS: This tutorial will employ the Polkadot-JS browser app, which allows users to submit transactions to Polkadot-based chains, including Bittensor. To use your coldkey private keys with the Polkadot-JS app, you must install the wallet browser extension, which is available for [Firefox](https://addons.mozilla.org/en-US/firefox/addon/polkadot-js-extension/) or [Chrome](https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd).
1818

1919
## Provision and configure your workstation
2020

@@ -28,70 +28,101 @@ Coldkeys private keys and seed phrases for wallets with real (mainnet) TAO are *
2828

2929
In a realistic scenario, using wallets with real (mainnet) TAO, it would be crucial to follow proper workstation security. This implies that each coldkey would be provisioned to its own secure coldkey workstation, as maintaining separate workstations for each coldkey is important for minimizing the risk that multiple of the keys are lost or leaked; storing or handling the keys together undermines the purpose of having multiple keys.
3030

31-
See [Coldkey and Hotkey Workstation Security](../getting-started/coldkey-hotkey-security).
31+
See [Coldkey and Hotkey Workstation Security](../getting-started/coldkey-hotkey-security.md).
3232

33-
In the current *practice* scenario, using testnet TAO, we will forego full workstation security for ease, and handle all three keys on a single workstation, which can be an ordinary laptop rather than a secure workstation.
33+
In the current _practice_ scenario, using testnet TAO, we will forego full workstation security for ease, and handle all three keys on a single workstation, which can be an ordinary laptop rather than a secure workstation.
3434

3535
### Configure the target network in the Polkadot-JS web app.
3636

3737
1. Visit the [Polkadot-JS explorer web app](https://polkadot.js.org/apps).
38-
1. Click the blockchain selector tab in the upper lefthand corner of the web page, next to **Accounts**. This is set to **Polkadot** main chain by default.
39-
1. Scroll down and open **Development** at the bottom of the Chains menu, and paste the address for the Bittensor test chain into **custom endpoint**: `wss://test.finney.opentensor.ai:443`.
38+
1. Click the blockchain selector dropdown in the upper lefthand corner of the web page, next to **Accounts**. This is set to **Polkadot** main chain by default.
39+
1. Scroll down and open **Development** at the bottom of the Chains menu, and paste the address for the Bittensor test chain into **custom endpoint** field: `wss://test.finney.opentensor.ai:443`.
40+
1. After pasting the link to the Bittensor test chain, click on the **Switch** button at the top of the menu.
4041

41-
You should see the page update and display live information about Bittensor testnet.
42+
:::tip success
43+
You should see the page update and display live information about Bittensor testnet.
44+
:::
4245

4346
### Create and import 3 coldkey pairs ("accounts") in the Polkadot-JS browser extension
4447

4548
Each of our 3 signatories needs a wallet. Either create them or re-use available test wallets.
4649

4750
1. Use `btcli` to create three coldkeys/wallets, or use practice wallets you already have access to. Alternatively, you can create wallets in the Polkadot-JS browser extension.
4851

49-
See [Creating/Importing a Bittensor Wallet](../working-with-keys).
52+
See [Creating/Importing a Bittensor Wallet](../working-with-keys).
5053

51-
1. Load each key into the Polkadot-JS wallet browser extension:
52-
1. Click to open the browser extension.
53-
1. Click **+**, then select **Import account from pre-existing seed**.
54-
1. Provide your seed phrase to regenerate your wallet's coldkey private key.
54+
1. Load each wallet key into the Polkadot-JS wallet browser extension:
5555

56-
1. Configure your keys to use the custom network (Bittensor's test net). For each key/**account**:
57-
1. Click the menu (three dots) to configure the account.
58-
1. Open the network dropdown selector, and choose **Allow use on any chain**.
56+
1. Click the `polkadot{.js}` extension icon in your browser to open the extension.
57+
1. Click the **+** icon, then select **Import account from pre-existing seed**.
58+
1. Provide your Bittensor wallet's seed phrase to regenerate your wallet's coldkey private key.
59+
1. Open the **NETWORK** dropdown selector, and choose **Allow use on any chain**.
60+
1. Click **Next**. After clicking **Next**, you will be prompted to provide a name and password for the account created.
5961

60-
1. You may need to allow the PolkadotJS webapp to use specific wallets by clicking **connect** in the extension.
62+
1. You will need to allow the PolkadotJS webapp to use specific wallets connecting the imported accounts. To do this:
6163

62-
1. You may need to refresh the PolkadotJS webapp to show updated accounts information.
64+
1. Click the `polkadot{.js}` extension icon in your browser toolbar to open the extension.
6365

64-
1. Confirm success by visiting the [accounts page](https://polkadot.js.org/apps/#/accounts). You should see all three wallets/accounts listed as **accounts available via browser extensions**.
66+
:::info
67+
Make sure you perform this action while on the same browser tab where the Polkadot-JS Explorer is open.
68+
:::
69+
70+
2. Click the **Connect Accounts** button at the top of the extension.
71+
3. Select the accounts that you want to connect to the Polkadot-JS browser app—for this walkthrough, select the three signatory accounts created.
72+
4. Confirm success by visiting the [Accounts page](https://polkadot.js.org/apps/#/accounts). You should see all three wallets/accounts listed as **accounts available via browser extensions**.
73+
74+
:::info
75+
You may need to refresh the PolkadotJS webapp to show updated accounts information.
76+
:::
6577

6678
## Create the multisig
6779

6880
In this step, we'll create the multisig wallet, specifying the signatory wallets.
6981

70-
1. Navigate to the [accounts page](https://polkadot.js.org/apps/#/accounts).
82+
1. Navigate to the [accounts page](https://polkadot.js.org/apps/#/accounts).
83+
84+
1. Click **+ Multisig** to create a new multisig. In the **add multisig** modal:
85+
86+
1. Select from the available signatories, which must be in your address book (if they are not, add them from the Accounts/Address book tab).
87+
1. Set the **threshold**.
88+
1. Set a name for the multisig address on the Polkadot-JS web app.
89+
1. Click **+ Create**.
90+
91+
:::info
92+
You should see the newly created multisig account listed under the **multisig** section on the Accounts page. Select the new account to view its name, balance, and SS58 address.
93+
:::
94+
95+
1. Use the `btcli w regen_coldkeypub` command to add the wallet's public key to BTCLI. To do this, run the following command in your terminal:
96+
97+
```sh
98+
btcli w regen_coldkeypub --wallet-name WALLET_NAME --ss58 MULTISIG_ADDRESS
99+
```
100+
101+
Replace `WALLET_NAME` and `MULTISIG_ADDRESS` with the name and ss58 address of the multisig address created in the Polkadot-JS browser app.
102+
103+
:::info
104+
This command regenerates the public part of a coldkey for the multisig wallet named. You can view its balance information as shown:
71105

72-
1. Click **+ Multisig**. In the **add multisig** modal:
73-
1. Select from the available signatories, which must be in your address book (if they are not, add them from the Accounts/Address book tab).
74-
1. Set the **threshold**.
75-
1. Set a name.
76-
1. Click **create**.
106+
```sh
107+
btcli view dashboard --wallet.name WALLET_NAME
108+
```
77109

78-
1. Use `btcli w regen_coldkeypub --wallet.name multisig` to add the wallet's public key to BTCLI.
79-
1. View its balance information with `btcli view dashboard --wallet.name multisig`.
110+
:::
80111

81112
## Transfer TAO to the multisig wallet.
82113

83-
1. Find the multisig wallet's coldkey public key on the [accounts page](https://polkadot.js.org/apps/#/accounts), listed under **multisig**. Click on the wallet/account to open it's show modal, then click **Copy** by the account name and address/public key to copy it out.
84-
1. Use BTCLI to transfer testnet TAO to the mutlisig wallet.
85-
1. Run `btcli wallet transfer`.
86-
1. Provide the multisig wallet's coldkey public key.
87-
1. Specify the amount. It's recommended to do a small transfer first to confirm the address, even with testnet TAO.
114+
1. Find the multisig wallet's coldkey public key on the [accounts page](https://polkadot.js.org/apps/#/accounts), listed under **multisig**. Click on the wallet/account to open it's show modal, then click **Copy** by the account name and address/public key to copy it out.
115+
1. Use BTCLI to transfer testnet TAO to the multisig wallet.
116+
1. Run `btcli wallet transfer`.
117+
1. Provide the multisig wallet's coldkey public key.
118+
1. Specify the amount. It's recommended to do a small transfer first to confirm the address, even with testnet TAO.
88119
1. To confirm the transfer, view the multisig wallet in the accounts page or the BTCLI dashboard. It should show the TAO from the transfer almost immediately.
89120

90-
## Transfer TAO from the multisig
121+
## Transfer TAO from the multisig
91122

92123
Let's try executing a sensitive operation with the multisig wallet: transferring TAO. Choose any destination wallet that you control. It can be one of the signatories. Note this wallet's balance, so you can confirm the transaction's ultimate success by seeing the increase in that balance.
93124

94-
To transfer TAO out of the multisig wallet requires a multisig transaction, meaning it must be approved by threshold $M$ of the $N$ total signatories. First, one wallet must propose the transaction. This proposal will exist on the blockchain where it can be signed by other signatories, which will execute the proposed transaction.
125+
Transferring TAO out of the multisig wallet requires a multisig transaction, meaning it must be approved by threshold $M$ of the $N$ total signatories. First, one wallet must propose the transaction. This proposal will exist on the blockchain where it can be signed by other signatories, which will execute the proposed transaction.
95126

96127
Note that the signatory that proposes a multisig action must make a deposit that will be returned upon approval or rejection of the transaction, the amount of which will be displayed in the multisig transaction modal. The wallet that will propose the multisig transaction must have a balance above this amount.
97128

@@ -100,33 +131,36 @@ Note that the signatory that proposes a multisig action must make a deposit that
100131
1. In the Polkadot-JS web app, click the **Developer** tab and select Extrinsics, or navigate to the extrinsics page at [polkadot.js.org/apps/#/extrinsics](https://polkadot.js.org/apps/#/extrinsics).
101132
1. Under **using the selected account**, select the multisig wallet. Note that the multisig wallet's TAO balance is displayed.
102133
1. Under **submit the following extrinsic**:
103-
1. Select the `balances` module (from the lefthand dropdown menu).
104-
1. Select `transferKeepAlive`.
134+
1. Select the `balances` module (from the lefthand dropdown menu).
135+
1. Then, select `transferKeepAlive` from the righthand menu.
105136
1. Under **Id: AccountId**, paste in the coldkey public key for the destination wallet.
106-
1. Under **value**, put the amount of TAO to transfer. This amount must be available in the multisig wallet.
107-
A wallet with a test TAO balance sufficient to pay the fee
137+
1. Under **value**, put the amount of TAO to transfer. This amount must be available in the multisig wallet. A wallet with a test TAO balance sufficient to pay the fee.
138+
:::info
139+
The `value` field accepts amounts in RAO, the smallest unit of TAO (`1 rao = 10⁻⁹ TAO`).
140+
For example, to transfer `2 TAO`, you must set `value` to `2,000,000,000`.
141+
:::
108142
1. Copy out the **encoded call data**, which other signatories will need to sign the transaction.
109143
1. Copy out the **encoded call hash**, which other signatories will need to confirm the details of the transaction.
110144
1. Copy out the **link** under **encoding details**, which will allow other signatories to view the details of the transaction and confirm it against the encoded call hash.
111145
1. Click **Submit Transaction**.
112146
1. In the **authorize transaction** modal, select the signatory.
113147

114-
Note that this should be selected as a **multisig signatory**, not as a **proxy account**. You may need to toggle the **Use a proxy for this call** switch to **Don't use a proxy for this call**.
148+
Note that this should be selected as a **multisig signatory**, not as a **proxy account**. You may need to toggle the **Use a proxy for this call** switch to **Don't use a proxy for this call**.
115149

116-
1. Select **Multisig approval with hash (non-final approval)**, not **Multisig message with call (for final approval)**.
150+
1. Click the toggle to select **Multisig approval with hash (non-final approval)** instead of **Multisig message with call (for final approval)**.
117151
1. Click **Sign and Submit**.
118152

119153
### Approve the transaction
120154

121155
1. Return to the [accounts page](https://polkadot.js.org/apps/#/accounts).
122-
1. Find the multisig wallet, noting that it should now display a clickable element for **view pending approvals**. You can also click on the wallets three dot menu and select **Multisig approvals**.
156+
1. Find the multisig wallet; the wallet should now display a clickable element to **View pending approvals**. You can also click on the wallet's menu icon and select **Multisig approvals**.
123157
1. The approval modal will display the **encoded call hash**, allowing signatories to confirm the identity of the proposed transaction, but it does not display details about the call.
124158

125-
To view details of the call, visit the link provided under **encoding details** when creating the transaction proposal.
159+
To view details of the call, visit the link provided under **encoding details** when creating the transaction proposal.
126160

127-
:::caution
128-
Confirm that the **call hash** in the details link matches the **call hash** in the transaction you are approving. This is the only way to be certain you are approving the correct transaction.
129-
:::
161+
:::caution
162+
Confirm that the **call hash** in the details link matches the **call hash** in the transaction you are approving. This is the only way to be certain you are approving the correct transaction.
163+
:::
130164

131165
1. Select the approving signatory, which cannot be the signatory who proposed the transaction.
132166
1. If you are the final approver, enter the **encoded call data**, which was provided when the transaction was created, and is displayed at the top of the page at the **encoding details** link.
@@ -136,4 +170,4 @@ A wallet with a test TAO balance sufficient to pay the fee
136170

137171
### Confirm success
138172

139-
Check the multisig wallet's balance, which should have decreased by the transfer amount, and the destination wallet, which should have increased.
173+
Check the multisig wallet's balance, which should have decreased by the transfer amount, and the destination wallet, which should have increased.

docs/questions-and-answers.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
title: "Frequently asked questions (FAQ)"
3-
hide_table_of_contents: false
3+
hide_table_of_contents: false
44
---
5+
56
import ThemedImage from '@theme/ThemedImage';
67
import useBaseUrl from '@docusaurus/useBaseUrl';
78

@@ -50,7 +51,7 @@ Anyone with the funds and technical know-how can create a subnet, or participate
5051

5152
### How does competition work in a subnet?
5253

53-
The work to be performed by miners is set by the subnet creator in the form of the subnet's incentive mechanism. The miners compete to best perform the task, submitting their work to the validators.
54+
The work to be performed by miners is set by the subnet creator in the form of the subnet's incentive mechanism. The miners compete to best perform the task, submitting their work to the validators.
5455

5556
The validators then rank the quality of the work done by the miners within the subnet. The aggregated scores of the validators determine the quantity of TAO emitted to each miner.
5657

@@ -68,7 +69,7 @@ The blockchain records all the key activity of the subnets in its ledger. It als
6869

6970
### Do subnets talk to each other?
7071

71-
A new abstract base class, called `SubnetsAPI` is released in Bittensor `6.8.0` and your application can use this to enable cross subnet communication. Normally, however, if you are not using the `SubnetsAPI`, then the subtensor blockchain does not mix data from one subnet with another subnet data and a subnet does not communicate with another subnet.
72+
A new abstract base class, called `SubnetsAPI` is released in Bittensor `6.8.0` and your application can use this to enable cross subnet communication. Normally, however, if you are not using the `SubnetsAPI`, then the subtensor blockchain does not mix data from one subnet with another subnet data and a subnet does not communicate with another subnet.
7273

7374
:::tip See also
7475
See [Bittensor Subnets API](https://github.com/opentensor/bittensor/blob/master/README.md#bittensor-subnets-api).
@@ -86,7 +87,7 @@ In Bittensor, "mining", within subnets, has nothing to do with adding blocks to
8687

8788
Yes indeed. In Bittensor, the work of validating the blockchain is performed by the Opentensor Foundation on a Proof-of-Authority model.
8889

89-
### What is the incentive to be a miner or a validator, or create a subnet?
90+
### What is the incentive to be a miner or a validator, or create a subnet?
9091

9192
Bittensor incentivizes participation through emission of TAO. Each day, 7200 TAO are emitted into the network (one TAO every 12 seconds).
9293

@@ -102,19 +103,19 @@ See [Emissions](./emissions.md).
102103

103104
Yes! Most participants will not create their own subnets, there are lots to choose from.
104105

105-
See:
106+
See:
106107

107108
- [Validating in Bittensor](./validators/index.md)
108109
- [Mining in Bittensor](./miners/index.md).
109110

110111
### Is there a central place where I can see compute requirements for mining and validating for all subnets?
111112

112-
Unfortunately no. Subnets are not run or managed by Opentensor Foundation, and the landscape of subnets is constantly evolving.
113+
Unfortunately no. Subnets are not run or managed by Opentensor Foundation, and the landscape of subnets is constantly evolving.
113114

114115
Browse the subnets at [TAO.app](https://tao.app), or on [Discord](https://discord.com/channels/799672011265015819/830068283314929684).
115116

116117
### Can I be a subnet miner or a subnet validator forever?
117118

118119
You can keep trying forever, but your success depends on your performance. Mining and validating in a subnet is competitive. If a miner or validator is one of the three lowest in the subnet, it may be de-registered at the end of the tempo, and have to register again.
119120

120-
See [miner deregistration](./miners/index.md#miner-deregistration).
121+
See [miner deregistration](./miners/index.md#miner-deregistration).

0 commit comments

Comments
 (0)