Skip to content

Commit 7b958cd

Browse files
committed
pure proxies wip
1 parent 9fdf0a9 commit 7b958cd

File tree

4 files changed

+127
-15
lines changed

4 files changed

+127
-15
lines changed

docs/keys/proxies/create-proxy.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,23 @@
22
toc_max_heading_level: 2
33
---
44

5-
# Create a Proxy in Bittensor
5+
# Create a Proxy Account
66

7-
This page describes creating and managing a proxy using the Polkadot.js web app. You will create a delegate account, add it as a proxy to your real account with a chosen `ProxyType`, and optionally use announcements for delayed execution.
7+
This tutorial walks you through creating a standard proxy and executing a call from the proxy account using the Polkadot.js web app. You will set up a delegate account, add it as a proxy to your real account with a chosen `ProxyType`, and optionally use announcements for delayed execution.
8+
9+
---
10+
11+
A standard proxy links a _delegator_ to a known account. The delegator specifies:
12+
13+
- The _delegate_ account.
14+
- The allowed `ProxyType` (scope of permissions).
15+
- An optional delay.
16+
17+
The delegate has access to funds in the real account and can then execute calls on behalf of the real account within the constraints of the specified `ProxyType`.
18+
19+
:::info When to use standard proxies
20+
Delegating through a standard proxy is a good option when you want to entrust control to trusted individuals or organizations who can act on your behalf. In this setup, the delegate maintains their own independent signing capability, which allows them to initiate and authorize actions without relying on your key. This approach provides maximum operational flexibility while also making the delegate responsible for managing the security of their own keys.
21+
:::
822

923
## Prerequisites
1024

@@ -32,12 +46,12 @@ If the web app does not connect to your local chain, your browser’s privacy or
3246

3347
1. In the navbar menu, navigate to **Developers****Extrinsics**.
3448
2. Under “using the selected account”, pick the funded delegator account.
35-
3. Under “submit the following extrinsic”, choose the `proxy` pallete and call `addProxy(delegate, proxyType, delay)`.
49+
3. Under “submit the following extrinsic”, choose the `proxy` pallet and call `addProxy(delegate, proxyType, delay)`.
3650
4. Fill the parameters:
3751

3852
- `delegate`: select the imported delegate account from the _Accounts_ dropdown.
3953
- `proxyType`: select `SmallTransfer`; this should allow us transfer amounts that do not exceed 0.5τ.
40-
- `delay`: Optionally, include a delay in blocks.
54+
- `delay`: optionally, include a delay in blocks.
4155

4256
5. Click **Submit Transaction** and sign with the _delegator_ account.
4357

@@ -74,6 +88,10 @@ This returns the set of proxies related to the account and their information—`
7488

7589
The runtime verifies that the call is permitted by the proxy filter and that any delay requirements have been met, then dispatches the call as if signed by the Real account.
7690

91+
:::info
92+
After submitting the transaction, check the Polkadot.JS web app's **Explorer** page for a `balances.Transfer` event. Notice the sender is the delegator account.
93+
:::
94+
7795
:::warning
7896

7997
- With the SmallTransfer proxy type, transfers are limited to less than 0.5 TAO (500,000,000 RAO). Use the Transfer proxy type for amounts above this limit.
@@ -93,7 +111,7 @@ Announcing a delayed proxy call requires the hash of the call that you intend to
93111
4. Fill the parameters:
94112
- `dest`: select the recipient account.
95113
- `value`: input the amount to be transferred in RAO—1 TAO = 1<sup>9</sup>RAO.
96-
5. Copy the hex code shown in the **encoded call data** field. You will use this to announce †he call in the next step.
114+
5. Copy the hex code shown in the **encoded call data** field. You will use this to announce the call in the next step.
97115

98116
---
99117

@@ -165,3 +183,4 @@ After the announcement waiting period has passed, the delegate account can now e
165183
- `proxy.Unproxyable`/`system.CallFiltered`: The call is not permitted under the current `ProxyType`.
166184
- `proxy.TooMany`: You exceeded `MaxProxies` or `MaxPending`. Remove unused proxies/announcements.
167185
- `proxy.NotProxy`: Ensure you’re submitting from the delegate account and referencing the correct real account.
186+
- `Token.FundsUnavailable`: Ensure that your real account has enough available funds to cover the transaction.

docs/keys/proxies/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This page introduces the proxy pattern used in Bittensor and explains how it ena
66

77
## What is a proxy?
88

9-
Rather than using funds in a single account, smaller accounts with unique roles can complete tasks on behalf of the main stash account.
9+
Rather than using funds in a single account, accounts with unique roles can complete tasks on behalf of the main stash account.
1010
A proxy lets one account (the delegator, or "real" account) authorize another account (the delegate) to make permitted calls on its behalf. Proxies allow a delegator to keep their "real" accounts safe and "cold", thereby adding an extra layer of security to the tokens in the account.
1111

1212
The permission scope is determined by the `ProxyType` call filter. This call filter allows the delegator account set the roles and limitations of the delegate account. Optionally, actions can require an on-chain announcement period—`delay`, giving the delegator time to reject a call made by a delegate.
@@ -17,7 +17,7 @@ The following concepts define how proxy relationships are set up and managed:
1717

1818
- **Real account**: The account whose identity and funds are at stake.
1919
- **Delegate account**: The account with access to tokens in the real account and allowed to perform certain actions for the real account.
20-
- **ProxyType**: A capability profile that restricts which calls can be made by the delegate account.
20+
- **ProxyType**: A call filter that restricts which calls can be made by the delegate account.
2121
- **Delay/announcement**: Optional time window before a proxy action can be executed.
2222

2323
## Common use cases
@@ -72,7 +72,6 @@ The following table shows the available `ProxyType` options and their descriptio
7272
| `Registration` | Allows registration-related operations. |
7373
| `Transfer` | Allows unrestricted transfer operations. |
7474
| `SmallTransfer` | Allows transfers capped at 0.5 TAO. |
75-
| `RootWeights` | Deprecated. |
7675
| `ChildKeys` | Allows child key operations. |
7776
| `SudoUncheckedSetCode` | Restricted to a single privileged call form. |
7877
| `SwapHotkey` | Allows hotkey swap operations. |

docs/keys/proxies/pure-proxies.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Pure Proxies
2+
3+
Pure proxies are a specialized type of proxy account in Bittensor that provide enhanced security and isolation for complex delegation scenarios. Unlike standard proxies that use existing accounts, pure proxies create new, keyless accounts that can only operate through their delegator relationship.
4+
5+
This page walks you through creating a pure proxy account, executing a transfer through it, and eventually removing it using the Polkadot.js web app. You will set up a new delegate account, add it to your Polkadot.js accounts, and use it to execute transactions on the blockchain.
6+
7+
## Overview of pure proxies
8+
9+
Pure proxies are **keyless, non-deterministic accounts** that are created fresh using the `createPure` extrinsic. They represent a unique approach to account delegation where:
10+
11+
- The proxy account has **no private key** and cannot sign transactions independently
12+
- The proxy can **only act through its delegator** - all operations must be initiated by the delegator
13+
- The account is **completely isolated** and cannot escalate its own permissions
14+
15+
Unlike standard proxies, where the delegate can access the delegator’s funds to execute calls on their behalf, pure proxies operate differently. A pure proxy account must hold its own funds, while the real account acts as an _any proxy_ for it—signing and authorizing transactions on the proxy’s behalf.
16+
17+
:::info when to use pure proxies
18+
Pure proxies are valuable when you want to keep your real account secure by reducing direct key exposure to the blockchain. They provide a keyless, flexible account that enables permissionless management and are especially effective for multisigs, since they allow updates to membership or thresholds without changing the account address.
19+
:::
20+
21+
## Transaction flow in pure proxies
22+
23+
All transactions involving a pure proxy must be signed by the delegator account. Once signed, the transaction is executed on-chain as if it originated directly from the pure proxy. Unlike standard proxies, a pure proxy must hold its own funds to cover fees or transfers. The delegator then acts as an _any proxy_, handling the signing and authorization of calls, but the balance used comes from the pure proxy's account.
24+
25+
When submitting calls with the `proxy(real, forceProxyType, call)` extrinsic, the pure proxy account is passed as the `real` argument, while the delegator signs the transaction. This effectively reverses the usual proxy relationship where the proxy account only authorizes the transaction, while the real account appears as the origin on chain.
26+
27+
:::info
28+
You can modify who signs for a pure proxy by assigning another account as its _any proxy_. This is done by executing a proxy call that creates a standard proxy with the `Any` proxy type. The new account can then sign on behalf of the pure proxy—for example, when updating signers in a multisig wallet.
29+
:::
30+
31+
## Prerequisites
32+
33+
- A locally running subtensor development chain. For more information, see [run a local Bittensor blockchain instance](../../local-build/deploy.md).
34+
- [Polkadot‑JS browser app](https://polkadot.js.org/apps/?#/explorer) connected to your local Bittensor instance and [Polkadot‑JS browser extension](https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd) installed. For information on connecting the Polkadot-JS browser app to your local blockchain instance, see [Connect Polkadot to your local chain](./create-proxy.md#step-1-connect-polkadotjs-to-your-local-chain).
35+
- An accessible 'Alice' wallet. For more information, see [Provision Wallets for Local Deploy](../../local-build/provision-wallets).
36+
- At least 2 different accounts in your Polkadot-JS app:
37+
- Real (delegator) account that controls funds and adds the proxy.
38+
- A recipient account to receive transferred funds.
39+
40+
## Create a pure proxy
41+
42+
Use the `proxy::createPure` extrinsic to create a pure proxy as shown:
43+
44+
1. In the navbar menu, navigate to **Developers****Extrinsics**.
45+
2. Under “using the selected account”, pick the delegator account.
46+
3. Under “submit the following extrinsic”, choose the `proxy` pallet and call `createPure(proxyType, delay, index)`.
47+
4. Fill the parameters:
48+
49+
- `proxyType`: select `SmallTransfer`; this should allow us transfer amounts that do not exceed 0.5τ.
50+
- `delay`: optionally, include a delay in blocks.
51+
- `index`: leave as zero.
52+
53+
5. Click **Submit Transaction** and sign with the _delegator_ account.
54+
55+
### Retrieve and import the proxy account
56+
57+
1. After creating the pure proxy, go to **Network****Explorer** in the Polkadot-JS web app.
58+
2. On the **recent events** panel, find the `proxy.PureCreated` event from the transaction. This event shows details of the proxy created including the address of the newly spawned account.
59+
3. Copy the address of the proxy account.
60+
4. Go to **Accounts****Accounts**.
61+
5. Click **+ Proxied**.
62+
6. Paste the proxy account address in the **proxied account** field and then provide a name for the pure proxy account.
63+
64+
Importing the proxy account makes it selectable in the Polkadot-JS web app UI.
65+
66+
:::tip
67+
68+
- Record the block number and extrinsic index where the pure proxy was created. These values are required when removing the proxy.
69+
- When creating a proxy on mainnet, you can check block details on the [Tao.app block explorer page](https://www.tao.app/blocks).
70+
71+
:::
72+
73+
## Executing calls via a pure proxy
74+
75+
1. Go to **Developer****Extrinsics**.
76+
2. Under “using the selected account”, choose the delegate account—account that created the proxy.
77+
3. Select the `proxy` pallet and choose `proxy(real, forceProxyType, call)`.
78+
4. Fill the parameters:
79+
- `real`: select the pure proxy account from the UI.
80+
- `forceProxyType`: leave option unchecked.
81+
- `call`: the call to be made by the delegate account. Fill the following parameters:
82+
- Select the `balances` pallet and choose the `transferKeepAlive(dest, value)` extrinsic.
83+
- `dest`: select the recipient account.
84+
- `value`: input the amount to be transferred in RAO—1 TAO = 1<sup>9</sup>RAO.
85+
5. Click **Submit Transaction** and sign the transaction from the delegate account.
86+
87+
:::info
88+
89+
- After submitting the transaction, check the Polkadot.JS web app's **Explorer** page for a `balances.Transfer` event. Notice the sender is the pure proxy account.
90+
- Ensure the pure proxy account holds enough funds to cover both the transfer and associated fees.
91+
:::
92+
93+
## Troubleshooting
94+
95+
- funds unavailable
96+
- cant sign with locked key pair: using pure proxy as signer

sidebars.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const sidebars = {
4747
collapsed: true,
4848
items: [
4949
"learn/introduction",
50-
"resources/questions-and-answers",
50+
"resources/questions-and-answers",
5151
"subnets/understanding-subnets",
5252
"learn/anatomy-of-incentive-mechanism",
5353

@@ -90,22 +90,20 @@ const sidebars = {
9090
collapsible: true,
9191
collapsed: true,
9292
link: { type: "doc", id: "keys/proxies/index" },
93-
items: ["keys/proxies/create-proxy"],
93+
items: ["keys/proxies/create-proxy", "keys/proxies/pure-proxies"],
9494
},
9595
"keys/handle-seed-phrase",
9696
"keys/coldkey-hotkey-security",
9797
"keys/multisig",
9898
"keys/schedule-coldkey-swap",
99-
},
99+
],
100+
},
100101
{
101102
type: "category",
102103
label: "Research",
103104
collapsible: true,
104105
collapsed: true,
105-
items: [
106-
"research/synchronized-halving",
107-
"research/halvings-problem",
108-
],
106+
items: ["research/synchronized-halving", "research/halvings-problem"],
109107
},
110108
{
111109
type: "category",

0 commit comments

Comments
 (0)