It is possible to create a multi-signature account in Geode. A multi-signature account is composed of one or more addresses and a threshold. The threshold defines how many signatories (participating addresses) need to agree on submitting an extrinsic for the call to be successful. For example, Alice, Bob, and Charlie set up a multi-sig with a threshold of 2. This means Alice and Bob can execute any call even if Charlie disagrees with it. Likewise, Charlie and Bob can execute any call without Alice. A threshold is typically a number smaller than the total number of members but can also be equal to it, which means they all have to agree.

Multi-signature accounts have several uses:

  • Securing your own stash: use additional signatories as a 2FA mechanism to secure your funds. One signer can be on one computer, and another can be on another or in cold storage. This slows down your interactions with the chain but is orders of magnitude more secure.
  • Board decisions: legal entities such as businesses and foundations use multi-sigs to govern over the entity’s treasury collectively.
  • Group participation in governance: a multi-sig account can do everything a regular account can. A multi-sig account could even win a single seat on the Council in Geode’s governance, allowing a set of community members to vote as one entity.

Multi-signature accounts cannot be modified after being created. Changing the set of members or altering the threshold is not possible and instead requires the dissolution of the current multi-sig and creation of a new one. As such, multi-sig account addresses are deterministic, i.e. you can always calculate the address of a multi-sig by knowing the members and the threshold, without the account existing yet. This means one can send tokens to an address that does not exist yet, and if the entities designated as the recipients come together in a new multi-sig under a matching threshold, they will immediately have access to these tokens.

Generating Addresses of Multi-signature Accounts

ADDRESSES THAT ARE PROVIDED TO THE MULTI-SIG WALLETS MUST BE SORTED. The below methods for generating will sort the accounts for you, but if you are implementing your own sorting, then be aware that the public keys are compared byte-for-byte and sorted ascending before being inserted in the payload that is hashed.

Addresses are deterministically generated from the signers and threshold of the multisig wallet. For a code example (in TypeScript) of generating you can view the internals of @w3f/msig-util here.

The @w3f/msig-util is a small CLI tool that can determine the multi-signature address based on your inputs.

$ npx @w3f/msig-util@1.0.7 derive –addresses 15o5762QE4UPrUaYcM83HERK7Wzbmgcsxa93NJjkHGH1unvr,1TMxLj56NtRg3scE7rRo8H9GZJMFXdsJk1GyxCuTRAxTTzU –threshold 1

npx: installed 79 in 7.764s

——————————–

Addresses: 15o5762QE4UPrUaYcM83HERK7Wzbmgcsxa93NJjkHGH1unvr 1TMxLj56NtRg3scE7rRo8H9GZJMFXdsJk1GyxCuTRAxTTzU

Threshold: 1

Multisig Address (SS58: 0): 15FKUKXC6kwaXxJ1tXNywmFy4ZY6FoDFCnU3fMbibFdeqwGw

——————————–

The Geode Portal also supports multi-sig accounts, as documented in the Account Generation page. This is a lot easier than generating them manually.

Making Transactions with a Multi-signature Account

There are three types of actions you can take with a multi-sig account:

  • Executing a call.
  • Approving a call.
  • Cancelling a call.

In scenarios where only a single approval is needed, a convenience method as_multi_threshold_1 should be used. This function takes only the other signatories and the raw call as its arguments.

However, in anything but the simple one approval case, you will likely need more than one of the signatories to approve the call before finally executing it. When you create a new call or approve a call as a multi-sig, you will need to place a small deposit. The deposit stays locked in the pallet until the call is executed. The deposit is to establish an economic cost on the storage space that the multi-sig call takes up on the chain and discourage users from creating dangling multi-sig operations that never get executed. The deposit will be reserved in the caller’s accounts, so participants in multi-signature wallets should be sure to have spare funds available.

The deposit is dependent on the threshold parameter and is calculated as follows:

Deposit = DepositBase + threshold * DepositFactor

Where DepositBase and DepositFactor are chain constants set in the runtime code.

Pin It on Pinterest

Tell Your Friends

Be the hero...Get your friends in early!