-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Limit derived accounts per parachain? #3641
Description
Background: parachains need a way for smart contracts to control relay chain accounts
As of now, the relay chain supports 1 sovereign account (on the relay chain) per parachain. Each parachain can send upward XCM to the relay chain to dispatch actions on behalf of this account.
For example, if a parachain account owns a relay chain token derivative stored on the parachain, they could burn the token derivative on the parachain to trigger an upward XCM that transfers a proportional amount of relay chain token out of the parachain's sovereign account to an account they control on the relay chain.
However, the above example assumes the user burning the token derivative on the parachain is an individual who controls the private key of a relay chain account. If the user is a smart contract on the parachain, then that contract needs a way to control a relay chain account from the parachain.
Parachain solution: account derivation from sovereign account
The Moonbeam team implemented an attempted workaround wherein the parachain derives proxy accounts from its relay chain sovereign account and dispatches calls for these proxy accounts on behalf of its smart contracts. A similar implementation could use pallet_utility::as_derivative
to control up to u16::MAX
derived accounts from a single sovereign account.
While this approach would work from the parachain perspective, discussions have revealed a preference to limit the number of relay chain accounts controlled by each parachain. This desire to limit parachain-controlled relay chain accounts is related to a practical limit on the number of balance-holding accounts for any given substrate chain (related frontier issue).
Accessibility for creating relay chain accounts should be independent of parachain-controlled relay chain accounts; unbounded parachain-controlled accounts could lead to the relay chain ExistentialDeposit increasing such that creating new relay chain accounts for users is inaccessible.
Feature request: bounded account derivation from sovereign account
Due to the above justification, the relay chain will likely filter deriving accounts from the parachain sovereign account if this functionality is (ab)used.
The purpose of this issue is to request an explicit limit on the number of derived accounts controlled by a parachain. The number mentioned in previous discussions was 1_000
accounts to start.
Parachains will need to implement some simple auction to decide who controls the limited number of derived relay chain accounts.