55 releases (36 major breaking)

38.0.0 Sep 26, 2024
37.0.0 Jul 18, 2024
36.0.0 Jul 12, 2024
35.0.0 Jun 24, 2024
2.0.0-alpha.5 Mar 24, 2020

#1 in #deposit

Download history 1599/week @ 2024-08-26 935/week @ 2024-09-02 1451/week @ 2024-09-09 1494/week @ 2024-09-16 2105/week @ 2024-09-23 2072/week @ 2024-09-30 1679/week @ 2024-10-07 1943/week @ 2024-10-14 2447/week @ 2024-10-21 2047/week @ 2024-10-28 2099/week @ 2024-11-04 21524/week @ 2024-11-11 26376/week @ 2024-11-18 29292/week @ 2024-11-25 23972/week @ 2024-12-02 29524/week @ 2024-12-09

110,470 downloads per month
Used in 72 crates (9 directly)

Apache-2.0

2.5MB
40K SLoC

pallet-identity

Identity Pallet

Overview

A federated naming system, allowing for multiple registrars to be added from a specified origin. Registrars can set a fee to provide identity-verification service. Anyone can put forth a proposed identity for a fixed deposit and ask for review by any number of registrars (paying each of their fees). Registrar judgements are given as an enum, allowing for sophisticated, multi-tier opinions.

Some judgements are identified as sticky, which means they cannot be removed except by complete removal of the identity, or by the registrar. Judgements are allowed to represent a portion of funds that have been reserved for the registrar.

A super-user can remove accounts and in doing so, slash the deposit.

All accounts may also have a limited number of sub-accounts which may be specified by the owner; by definition, these have equivalent ownership and each has an individual name.

The number of registrars should be limited, and the deposit made sufficiently large, to ensure no state-bloat attack is viable.

Usernames

The pallet provides functionality for username authorities to issue usernames. When an account receives a username, they get a default instance of IdentityInfo. Usernames also serve as a reverse lookup from username to account.

Username authorities are given an allocation by governance to prevent state bloat. Usernames impose no cost or deposit on the user.

Users can have multiple usernames that map to the same AccountId, however one AccountId can only map to a single username, known as the primary.

Interface

Dispatchable Functions

For General Users
  • set_identity - Set the associated identity of an account; a small deposit is reserved if not already taken.
  • clear_identity - Remove an account's associated identity; the deposit is returned.
  • request_judgement - Request a judgement from a registrar, paying a fee.
  • cancel_request - Cancel the previous request for a judgement.
  • accept_username - Accept a username issued by a username authority.
  • remove_expired_approval - Remove a username that was issued but never accepted.
  • set_primary_username - Set a given username as an account's primary.
  • remove_dangling_username - Remove a username that maps to an account without an identity.
For General Users with Sub-Identities
  • set_subs - Set the sub-accounts of an identity.
  • add_sub - Add a sub-identity to an identity.
  • remove_sub - Remove a sub-identity of an identity.
  • rename_sub - Rename a sub-identity of an identity.
  • quit_sub - Remove a sub-identity of an identity (called by the sub-identity).
For Registrars
  • set_fee - Set the fee required to be paid for a judgement to be given by the registrar.
  • set_fields - Set the fields that a registrar cares about in their judgements.
  • provide_judgement - Provide a judgement to an identity.
For Username Authorities
  • set_username_for - Set a username for a given account. The account must approve it.
For Superusers
  • add_registrar - Add a new registrar to the system.
  • kill_identity - Forcibly remove the associated identity; the deposit is lost.
  • add_username_authority - Add an account with the ability to issue usernames.
  • remove_username_authority - Remove an account with the ability to issue usernames.

License: Apache-2.0

Release

Polkadot SDK stable2409

Dependencies

~17–32MB
~531K SLoC