Recovery pallet modernization#10482
Merged
Merged
Conversation
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
rockbmb
reviewed
Apr 30, 2026
rockbmb
approved these changes
Apr 30, 2026
rockbmb
left a comment
Contributor
There was a problem hiding this comment.
I created an PET E2E suite for this: open-web3-stack/polkadot-ecosystem-tests#602
it's not complete coverage, plus I had to run it against a patched version of WAH, but the scenarios covered all pass.
LGTM modulo audits (will also revisit as I expand the test suite)
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Alexandre R. Baldé <alexandre.balde@parity.io>
…now how to do it well and its low prio Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
ggwpez
added a commit
to polkadot-fellows/runtimes
that referenced
this pull request
May 4, 2026
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
13 tasks
fellowship-merge-bot Bot
pushed a commit
to polkadot-fellows/runtimes
that referenced
this pull request
May 29, 2026
Integrates SDK release 2604. ## Contracts - [x] @0xRVE — [#11460](paritytech/polkadot-sdk#11460) `CallbackHandle` check - [x] @0xRVE — [#11590](paritytech/polkadot-sdk#11590) Asset-conversion precompile · [4759eb9](4759eb9) - [x] @pgherveou — [#11416](paritytech/polkadot-sdk#11416) Auto-mapping (`AutoMap`) · [6dd3ddc](6dd3ddc) #1165 - [x] @mokita-j — [#11507](paritytech/polkadot-sdk#11507) Revive debug enable ## Bridges - [x] @acatangiu — [#11694](paritytech/polkadot-sdk#11694) `pallet_xcm_bridge_hub_router` `UnpaidExport` flag · [635ac29](635ac29) - [x] @yrong — [#11354](paritytech/polkadot-sdk#11354) Snowbridge inbound nonce API · [c6fa9f2](c6fa9f2) ## Async backing / collator - [x] @sandreim — [#11778](paritytech/polkadot-sdk#11778) Relay-parent offset ## Account recovery - [x] @ggwpez — [#10482](paritytech/polkadot-sdk#10482) pallet-recovery modernization (HoldConsideration follow-up + re-bench) · [7401ea9](7401ea9) ## Penpal / integration tests - [x] @clangenb — [#10726](paritytech/polkadot-sdk#10726) Penpal merged `Assets`/`ForeignAssets` (downstream fixups) · [3a8aa42](3a8aa42) - [x] @clangenb — Encointer pallet integration 2604: Revert this afterwards c944b09 ## General - [ ] Re-benchmark weights #1163 - [x] Check for in-code TODOs - [x] Check for all migrations --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Signed-off-by: Adrian Catangiu <adrian@parity.io> Co-authored-by: Ankan <10196091+Ank4n@users.noreply.github.com> Co-authored-by: clangenb <37865735+clangenb@users.noreply.github.com> Co-authored-by: Christian Langenbacher <clangenb@pm.me> Co-authored-by: Monica Jin <monicachenjin@gmail.com> Co-authored-by: Adrian Catangiu <adrian@parity.io> Co-authored-by: Andrei Trandafir <142614787+andreitrand@users.noreply.github.com> Co-authored-by: Christian Langenbacher <clangenb+gh@protonmail.ch> Co-authored-by: Paolo La Camera <paolo@parity.io> Co-authored-by: Branislav Kontur <bkontur@gmail.com> Co-authored-by: GitHub Action <action@github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recovery Pallet
Pallet Recovery allows you to have friends or family recover access to your account if you lose
your seed phrase or private key.
Terminology
lost: An account that has lost access to its private key and needs to be recovered.friend: A befriended account that can approve a recovery process.initiator: An account that initiated a recovery attempt.recovered: An account that has been successfully recovered.inheritor: An account that is inheriting access to a lost account after recovery.attempt: An attempt to recover a lost account by an initiator.order: The level of trust that an account has in a friend group.deposit: The amount that a friends of this group needs to reserve to initiate an attempt.threshold: The number of friends that need to approve an attempt.inheritance delay: How long an attempt will be delayed before it can succeed.provided block: The blocks that are provided by theT::BlockNumberProvider.Scenario: Recovering a lost account
Story of how the user Alice loses access and is recovered by her friends.
inheritoraccount that will inherit the access to her account foreach friend group. This could be a multisig.
set_friend_groups.lostaccount.initiator) of Alice's friend groups become aware of the situation andstarts a recovery
attemptviainitiate_attempt.approve_attempt.thresholdfriends approve the attempt (further approvals will fail since they areuseless).
finish_attemptafter at least inheritance delayblocks since the initiation have passed.
recoveredand accessible by theinheritoraccount.inheritormay callcontrol_inherited_accountat any point to transfer Alice's fundsto her new account.
Scenario: Multiple friend group try to recover an account
Alice may have configured multiple friend groups that all try to recover her account at the same
time. This can lead to a conflict of which friend group should eventually inherit the access.
In the case above you see how the Friends group is now unable to recover Alice account since
the Family group already did it and has a lower inheritance order.
Now, imagine the case that the Friends group would have started on day 4 and would have
already recovered the account on day 24. Two days later, the Family group can take access back
and will replace the inheritor account with their own. The Friends group had access for two
days since they were faster.
If Alice account has most balance locked in 28 day staking this would not make a big difference,
since only the free balance would be immediately transferable.
After a recovery attempt was completed, friend groups with a higher inheritance order cannot
open a new attempt to recover the account.
Data Structures
The pallet has three storage items, see the in-code docs [
FriendGroups], [Attempts] and[
Inheritor]. Storage items may contain deposit "tickets" or similar noise and should thereforenot be read directly but only through the API.
API
Reading data can be done through the view functions:
provided_block_number: The block number that will be used to measure time.friend_groups: The friend groups of an account that can initiate recovery attempts.attempts: Ongoing recovery attempts for a lost account.inheritor: The account that inherited full access to the lost account.inheritance: All the recovered accounts that an account inherited access to.TODO