MultiSig in Substrate

The basic concept of MultiSig

We know that in the blockchain, the perception is that a private key corresponds to the ownership of an account, as the classic saying goes:

Not your keys, not your coins.

As blockchain technology evolves, the need for more secure and decentralized wallets is becoming increasingly important. multisig wallets offer a solution to this problem. In a multisig wallet, a threshold and a set of signers are established to approve transactions. This method of approval increases the security and decentralization of the wallet. Typically, the threshold is set to require more than half of the signers to approve a transaction, making the process more democratic. By using a multisig wallet, users can ensure that their assets are safe and secure, and they can have confidence that a trusted group is approving their transactions of individuals.

MultiSig design and implementation in Substrate

If we want to implement a multisig function, we first need to have two key parameters, the signer (signatories in Substrate) and the threshold, which are the most basic parameters required for a multisig. We also need to maintain the multisig with a number of other parameters, including

Event design

Thus, a fully functional multi-signature solution is designed, in which we need to build in some events to complete the deposit_event, including

General checks

In general, when we make multisig function calls, there are a number of generic checks that are performed to ensure state certainty, including

Pallet Implementation

We need to use the above design to complete a pallet implementation. The current multisig pallet includes four main functions

Of course, we have abstracted some of the operations performed and come up with an operate function

MultiSig Operate function workflow

Current problem

We can currently build a multi-signature with Polkadot.js, but its poor UX makes the whole process seem very unfriendly, with the following problems

As multisig are deterministic events, there is a requirement for signatories to be deterministic, once a participant changes, the multisig will no longer be valid. In Substrate we support proxy accounts, so we can use the pure proxy feature to set up a proxy account for all signatories, thus creating a multisig of proxy accounts, so that we can change the multisig at will.

Sign up for our newsletter

Stay up to date with the roadmap progress, announcements and exclusive discounts feel free to sign up with your email.

© By Whisker —@whisker17