Search code examples
substrate

How to determine multisig account in substrate?


I've added multisig pallet to my substrate node. https://docs.rs/pallet-multisig/2.0.1/pallet_multisig/index.html

Is it possible to check for account type (is it multisig or not) inside another pallet?

Example:

AccountId sent as param to my extrinsic. How can I know is it multisig account or not?


Solution

  • With the included FRAME Multisig Pallet, it is not possible to tell whether the account in your system is a multisig or a regular account.

    The point of the pallet is to generate access to an account that looks like any regular system account. As such, they are indistinguishable from the eyes of another pallet.

    There are two ways to solve this for a custom made pallet which has extra logic for detecting such multisig account:

    • Create a new Origin which is used when generating a multisig and conveys the information about the account being a multisig.
    • Create a storage map which tracks a list of all the multisig accounts which you can reference when needed.

    Both of these would probably require you to fork the pallet and make it your own.