Files
pezkuwi-subxt/substrate/frame/alliance
joe petrowski d1f678c0ec Unique Usernames in Identity Pallet (#2651)
This PR allows _username authorities_ to issue unique usernames that
correspond with an account. It also provides two-way lookup, that is
from `AccountId` to a single, "primary" `Username` (alongside
`Registration`) and multiple unique `Username`s to an `AccountId`.

Key features:

- Username Authorities added (and removed) via privileged origin.
- Authorities have a `suffix` and an `allocation`. They can grant up to
`allocation` usernames. Their `suffix` will be appended to the usernames
that they issue. A suffix may be up to 7 characters long.
- Users can ask an authority to grant them a username. This will take
the form `myusername.suffix`. The entire name (including suffix) must be
less than or equal to 32 alphanumeric characters.
- Users can approve a username for themselves in one of two ways (that
is, authorities cannot grant them arbitrarily):
- Pre-sign the entire username (including suffix) with a secret key that
corresponds to their `AccountId` (for keyed accounts, obviously); or
- Accept the username after it has been granted by an authority (it will
be queued until accepted) (for non-keyed accounts like pure proxies or
multisigs).
- The system does not require any funds or deposits. Users without an
identity will be given a default one (presumably all fields set to
`None`). If they update this info, they will need to place the normal
storage deposit.
- If a user does not have any username, their first one will be set as
`Primary`, and their `AccountId` will map to that one. If they get
subsequent usernames, they can choose which one to be their primary via
`set_primary_username`.
- There are some state cleanup functions to remove expired usernames
that have not been accepted and dangling usernames whose owners have
called `clear_identity`.

TODO:

- [x] Add migration to runtimes
- [x] Probably do off-chain migration into People Chain genesis
- [x] Address a few TODO questions in code (please review)

---------

Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
Co-authored-by: Gonçalo Pestana <g6pestana@gmail.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Dónal Murray <donal.murray@parity.io>
2024-01-10 10:30:00 +00:00
..

Alliance Pallet

The Alliance Pallet provides a collective that curates a list of accounts and URLs, deemed by the voting members to be unscrupulous actors. The Alliance

  • provides a set of ethics against bad behavior, and
  • provides recognition and influence for those teams that contribute something back to the ecosystem.

Overview

The network initializes the Alliance via a Root call. After that, anyone with an approved identity and website can join as an Ally. The MembershipManager origin can elevate Allies to Fellows, giving them voting rights within the Alliance.

Voting members of the Alliance maintain a list of accounts and websites. Members can also vote to update the Alliance's rule and make announcements.

Terminology

  • Rule: The IPFS CID (hash) of the Alliance rules for the community to read and the Alliance members to enforce. Similar to a Charter or Code of Conduct.
  • Announcement: An IPFS CID of some content that the Alliance want to announce.
  • Member: An account that is already in the group of the Alliance, including three types: Fellow, or Ally. A member can also be kicked by the MembershipManager origin or retire by itself.
  • Fellow: An account who is elevated from Ally by other Fellows.
  • Ally: An account who would like to join the Alliance. To become a voting member (Fellow), it will need approval from the MembershipManager origin. Any account can join as an Ally either by placing a deposit or by nomination from a voting member.
  • Unscrupulous List: A list of bad websites and addresses; items can be added or removed by voting members.

Interface

Dispatchable Functions

For General Users

  • join_alliance - Join the Alliance as an Ally. This requires a slashable deposit.

For Members (All)

  • give_retirement_notice - Give a retirement notice and start a retirement period required to pass in order to retire.
  • retire - Retire from the Alliance and release the caller's deposit.

For Voting Members

  • propose - Propose a motion.
  • vote - Vote on a motion.
  • close - Close a motion with enough votes or that has expired.
  • set_rule - Initialize or update the Alliance's rule by IPFS CID.
  • announce - Make announcement by IPFS CID.
  • nominate_ally - Nominate a non-member to become an Ally, without deposit.
  • elevate_ally - Approve an ally to become a Fellow.
  • kick_member - Kick a member and slash its deposit.
  • add_unscrupulous_items - Add some items, either accounts or websites, to the list of unscrupulous items.
  • remove_unscrupulous_items - Remove some items from the list of unscrupulous items.
  • abdicate_fellow_status - Abdicate one's voting rights, demoting themself to Ally.

Root Calls

  • init_members - Initialize the Alliance, onboard fellows and allies.
  • disband - Disband the Alliance, remove all active members and unreserve deposits.