You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: develop/parachains/maintenance/unlock-parachain.md
+102-3Lines changed: 102 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
-
title: Unlock Parachain
2
+
title: Unlock a Parachain
3
3
description: TODO
4
4
---
5
5
6
-
# Unlock Parachain
6
+
# Unlock a Parachain
7
7
8
8
## Introduction
9
9
@@ -22,4 +22,103 @@ A parachain can be unlocked only with following conditions:
22
22
23
23
## Check if a Parachain is Locked
24
24
25
-
To check if a parachain is locked,
25
+
To check if a parachain is locked:
26
+
27
+
1. In [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}, connect to the relay chain, navigate to the **Developer** dropdown and select the **Chain State** option
28
+
29
+
2. Query the parachain locked status:
30
+
1. Select **`registrar`**
31
+
2. Choose the **`paras`** option
32
+
3. Input the parachain ID you want to check as a parameter (e.g. `2006`)
Unlocking a parachain is then allowed by sending an XCM call to the relay chain with the parachain origin or by executing this from the governance of the relay chain as a roo call.
41
+
42
+
From a parachain, the XCM message has to be sent from the Root origin. Depending on the parachain, this can be done by using the Sudo pallet or by using the governance mechanism of the parachain.
43
+
44
+
This guide explains how to send this message assuming your parachain has a Sudo pallet (and the XCM configuration/pallets).
45
+
46
+
### Prepare the Call
47
+
48
+
First, you need to prepara the call that will be executed on the relay chain. To do this:
49
+
50
+
1. In [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}, connect to the relay chain, navigate to the **Developer** dropdown and select the **Extrinsics** option
51
+
52
+
2. Build the `registrar.removeLock` extrinsic
53
+
1. Select the **registrar** pallet
54
+
2. Choose the **removeLock** extrinsic
55
+
3. Fill in the parachain ID parameter (e.g. `2006`)
3. Check the transaction weight for executing the call. You can estimate this by executing the `transactionPaymentCallApi.queryCallInfo` runtime call with the encoded call data previously obtained:
The [sovereign account](https://github.com/polkadot-fellows/xcm-format/blob/10726875bd3016c5e528c85ed6e82415e4b847d7/README.md?plain=1#L50){target=\_blank} of your parachain on the relay chain needs adequate funding to cover the XCM transaction fees.
67
+
To determine your parachain's sovereign account address, you can:
68
+
69
+
- Use the **"Para ID" to Address** section in [Substrate Utilities](https://www.shawntabrizi.com/substrate-js-utilities/){target=\_blank} with the **Sibling** option selected
70
+
71
+
- Calculate it manually:
72
+
73
+
1. Identify the appropriate prefix:
74
+
75
+
- For parent/child chains use the prefix `0x70617261` (which decodes to `b"para"`)
76
+
77
+
2. Encode your parachain ID as a u32 [SCALE](https://docs.polkadot.com/polkadot-protocol/basics/data-encoding/#data-types){target=\_blank} value:
78
+
79
+
- For parachain 2006, this would be `d6070000`
80
+
81
+
3. Combine the prefix with the encoded ID to form the sovereign account address:
To unlock your parachain, you will submit an XCM from your parachain to the relay chain using Root origin.
89
+
90
+
The XCM needs to execute these operations:
91
+
92
+
1. Withdraw DOT from your parachain's sovereign account on the relay chain
93
+
2. Buy execution to pay for transaction fees
94
+
3. Execute the `registrar.removeLock` extrinsic
95
+
4. Refund surplus DOT back to the sovereign account
96
+
97
+
Here's how to submit this XCM using Astar (Parachain 2006) as an example:
98
+
99
+
1. In [Polkadot.js Apps](https://polkadot.js.org/apps/#/explorer){target=\_blank}, connect to the parachain, navigate to the **Developer** dropdown and select the **Extrinsics** option
100
+
101
+
2. Create a `sudo.sudo` extrinsic that executes `polkadotXcm.send`:
102
+
1. Use the `sudo.sudo` extrinsic to execute the following call as Root
After successful execution, your parachain should be unlocked. To verify this, check the status of the parachain lock again using the method described in the [Check if a Parachain is Locked](#check-if-a-parachain-is-locked) section. You should see that the lock has been removed.
0 commit comments