Skip to main content

Multisig

Multisig wallets, as their name suggests, require multiple signatures to execute transactions, offering an added layer of security and decentralization. They consist of a group of signers with a defined threshold for the number of signatures needed to approve a transaction.

The Multisig Pallet on peaq/krest networks leverages Substrate functionality to enable native approval and dispatch of calls from a multisig. In this Pallet, multiple signers (or signatories) in Substrate approve and dispatch transactions from a derived origin based on their account IDs and the specified threshold.

Functions

  • create_multisig: Creates a new multisignature account.

  • add_signatory: Adds a signatory to a multisignature account.

  • remove_signatory: Removes a signatory from a multisignature account.

  • approve_transaction: Approves a transaction on a multisignature account.

  • execute_transaction: Executes a transaction on a multisignature account.

Code example

// Create a new multisignature account.
let multisig_address = create_multisig(["0x1234567890abcdef", "0xdeadbeef00000000", "0xcafebabe12345678"]);

// Add a signatory to a multisignature account.
let signatory = "0x1234567890abcdef";
add_signatory(multisig_address, signatory);

// Remove a signatory from a multisignature account.
let signatory = "0x1234567890abcdef";
remove_signatory(multisig_address, signatory);

// Approve a transaction on a multisignature account.
let transaction = Transaction.new();
approve_transaction(multisig_address, transaction);

// Execute a transaction on a multisignature account.
let transaction = Transaction.new();
execute_transaction(multisig_address, transaction);