Giter Site home page Giter Site logo

centrifuge / substrate-pallet-multi-account Goto Github PK

View Code? Open in Web Editor NEW
11.0 17.0 6.0 2.58 MB

A pallet/runtime module for Substrate with multisig functionality with a static `AccountId` and a dynamic `threshold` and set of `signatories`.

License: GNU Lesser General Public License v3.0

Rust 100.00%
parity parity-substrate substrate polkadot blockchain substrate-runtime

substrate-pallet-multi-account's Introduction

Substrate Multi Account Pallet

License: LGPL v3 Build Status codecov

A pallet/runtime module for Substrate with multisig functionality with a static AccountId and a dynamic threshold and set of signatories.

DEPRECATED

This library has been deprecated in favor of a combined usage of Substrate Proxy and Multisig.

Overview

This module contains functionality to create, update and remove multi accounts, identified by a deterministically generated account ID, as well as (potentially) stateful multisig dispatches.

This module is closely implemented after the multisig functionality of Substrate's utility pallet. The main difference is that this module stores static account ids on chain which are not changing when the threshold or signatories are updated.

This module allows multiple signed origins (accounts) to coordinate and dispatch calls from a previously created multi account origin. When dispatching calls, the threshold defined in the multi account defines the number of accounts from the multi account signatory set that must approve it. In the case that the threshold is just one then this is a stateless operation. This is useful for multisig wallets where cryptographic threshold signatures are not available or desired or where a dynamic set of signatories with a static account ID is desired.

The motivation for this module is that a deterministically created account ID from threshold and a set of signatories as in the utility pallet has certain downsides:

  1. When using multisigs for token holdings and changing signatories or the threshold, the tokens need to be transferred to a new account ID, which might be a taxable event, depending on jurisdiction. Even if it's not, it complicates communication with accountants/tax advisors.
  2. When using multisigs for staking and changing signatories or the threshold, the account needs to unbond, transfer tokens and re-stake again. That can lead to months of lost staking rewards, depending on the unbonding time.
  3. When using multisigs for voting and changing signatories or the threshold, the accounts needs to unvotes, transfer tokens and vote again, which is cumbersome.

The downside of using this multi account module is that it is slightly more complex than the utility multisigs and that it introduces additional state and the requirement of creating multi accounts before using multisigs.

Example

Alice creates a multisig operation: Alice creates a multisig operation

Bob approves it: Bob approves it

The multisig operation is executed: The multisig operation is executed

Interface

Dispatchable Functions

For multi account management

  • create - Create a new multi account with a threshold and given signatories.
  • update - Update an existing multi account with a new threshold and new signatories.
  • remove - Remove an existing multi account.

For multisig operations/dispatch

  • call - Approve and if possible dispatch a call from a multi account origin.
  • approve - Approve a call from a multi account origin.
  • cancel - Cancel a call from a multi account origin.

Notes

Multi account thresholds and signatories can only be updated and removed if all active/ongoing multisig operations have been cancelled. To prevent an outgoing multi account member to block updates/removals, the multi account itself can cancel any active multisig.

substrate-pallet-multi-account's People

Contributors

ivanceras avatar mikiquantum avatar philipstanislaus avatar vedhavyas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

substrate-pallet-multi-account's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.