6 releases

0.6.3 Aug 17, 2023
0.6.3-rc.1 Aug 3, 2023
0.6.2 Mar 9, 2023
0.6.1 Jun 30, 2022
0.1.0 Aug 8, 2020

#2174 in Magic Beans

Download history 27/week @ 2023-10-19 30/week @ 2023-10-26 29/week @ 2023-11-02 36/week @ 2023-11-09 23/week @ 2023-11-16 33/week @ 2023-11-23 38/week @ 2023-11-30 14/week @ 2023-12-07 24/week @ 2023-12-14 29/week @ 2023-12-21 11/week @ 2023-12-28 18/week @ 2024-01-04 18/week @ 2024-01-11 22/week @ 2024-01-18 23/week @ 2024-01-25 27/week @ 2024-02-01

92 downloads per month
Used in iota-identity

Apache-2.0

1MB
20K SLoC

IOTA Identity - Account

The Account is an interface for creating and managing identities on the IOTA Tangle, handling publishing and secure storage automatically. It provides convenience functions for:

  • Creating and publishing a new IOTA DID.
  • Updating DID Document contents:
    • Verification Methods.
    • Verification Relationships.
    • Services.
  • Managing private cryptographic keys securely.
  • Signing credentials.
  • Encrypting messages.

Account Creation

Creating an Account is done through the AccountBuilder.

let account: Account = Account::builder()
  .create_identity(IdentitySetup::default())
  .await?;

Update Operations

Updating a DID Document can be performed through the update_identity function on the Account. For example, adding a new verification method to the DID Document:

account
  .update_identity()
  .create_method()
  .content(MethodContent::GenerateEd25519)
  .fragment("my-next-key")
  .apply()
  .await?;

The above code generates a new Ed25519 keypair, writes it to Storage, embeds it in a new verification method, and publishes the updated DID Document to the Tangle.

See the IdentityUpdater for a list of provided update operations.

Dependencies

~19–64MB
~1M SLoC