Skip to content

Implementation of the Decentralized Identity standards such as DID and Verifiable Credentials by W3C for the IOTA Tangle.

License

Notifications You must be signed in to change notification settings

adrian-grassl/identity.rs

 
 

Repository files navigation

banner

StackExchange Discord Discord Apache 2.0 license Dependencies Coverage Status

IntroductionBindingsDocumentation & ResourcesGetting StartedExampleRoadmapContributing


Introduction

IOTA Identity is a Rust implementation of decentralized digital identity, also known as Self-Sovereign Identity (SSI). It implements standards such as the W3C Decentralized Identifiers (DID) and Verifiable Credentials and the DIF DIDComm Messaging specifications alongside supporting methods. This framework can be used to create and authenticate digital identities, creating a trusted connection and sharing verifiable information, establishing trust in the digital world.

The individual libraries are developed to be agnostic about the utilized Distributed Ledger Technology (DLT), with the exception of the IOTA integration and higher level libraries. Written in stable Rust, it has strong guarantees of memory safety and process integrity while maintaining exceptional performance.

⚠️ WARNING ⚠️

This library is currently in its beta stage and under development and might undergo large changes! Until a formal third-party security audit has taken place, the IOTA Foundation makes no guarantees to the fitness of this library. As such, it is to be seen as experimental and not ready for real-world applications. Nevertheless, we are very interested in feedback about user experience, design and implementation, and encourage you to reach out with any concerns or suggestions you may have.

Bindings

Foreign Function Interface (FFI) Bindings of this Rust library to other programming languages are a work in progress (see Roadmap below). Currently available bindings are:

Documentation and Resources

Getting Started

If you want to include IOTA Identity in your project, simply add it as a dependency in your cargo.toml:

[dependencies]
identity = { git = "https://github.com/iotaledger/identity.rs", branch = "main"}

To try out the examples, you can also do this:

  1. Clone the repository, e.g. through git clone https://github.com/iotaledger/identity.rs
  2. Build the repository with cargo build
  3. Run your first example using cargo run --example getting_started

If you would like to build the API Reference yourself from source, you can do so using:

cargo doc --document-private-items --no-deps --open

Example: Creating an Identity

Cargo.toml

[package]
name = "iota_identity_example"
version = "1.0.0"
edition = "2018"

[dependencies]
identity = { git = "https://github.com/iotaledger/identity.rs", branch = "main"}
pretty_env_logger = { version = "0.4" }
tokio = { version = "1.5", features = ["full"] }

main.rs

use std::path::PathBuf;

use identity::account::Account;
use identity::account::AccountStorage;
use identity::account::IdentityCreate;
use identity::account::IdentitySnapshot;
use identity::account::Result;
use identity::iota::IotaDID;
use identity::iota::IotaDocument;

#[tokio::main]
async fn main() -> Result<()> {
  pretty_env_logger::init();

  // The Stronghold settings for the storage
  let snapshot: PathBuf = "./example-strong.hodl".into();
  let password: String = "my-password".into();

  // Create a new Account with Stronghold as the storage adapter
  let account: Account = Account::builder()
    .storage(AccountStorage::Stronghold(snapshot, Some(password)))
    .build()
    .await?;

  // Create a new Identity with default settings
  let snapshot1: IdentitySnapshot = account.create_identity(IdentityCreate::default()).await?;

  // Retrieve the DID from the newly created Identity state.
  let document1: &IotaDID = snapshot1.identity().try_did()?;

  println!("[Example] Local Snapshot = {:#?}", snapshot1);
  println!("[Example] Local Document = {:#?}", snapshot1.identity().to_document()?);
  println!("[Example] Local Document List = {:#?}", account.list_identities().await);

  // Fetch the DID Document from the Tangle
  //
  // This is an optional step to ensure DID Document consistency.
  let resolved: IotaDocument = account.resolve_identity(document1).await?;

  println!("[Example] Tangle Document = {:#?}", resolved);

  Ok(())
}

Example output

DID Document Transaction > https://explorer.iota.org/mainnet/message/de795095cc7970c2aa4efabfe9885bd07be6664219464697b4b7506d9a87fbe3

The output link points towards the DID Document transaction, viewable through the IOTA Tangle Explorer, see here. You can see the full DID Document as transaction payload.

Roadmap and Milestones

For detailed development progress, see the IOTA Identity development kanban board.

IOTA Identity is in heavy development, and will naturally change as it matures and people use it. The chart below isn't meant to be exhaustive, but rather helps to give an idea for some of the areas of development and their relative completion:

Basic Framework

Feature Not started In Research In Development Done Notes
Implement IOTA DID Method ✔️ Finished implementation.
Verifiable Credentials ✔️ Finished implementation.
Account 🔶 Base implementation done, more features to be added.
DID Comms 🔶 Initial version done, but more to come
Identity Actor 🔶
Selective Disclosure 🔶
Zero Knowledge Proofs 🔶
Support Embedded Rust 🔶
WASM Bindings 🔶 implemented for low-level APIs
Code Examples 🔶
API Reference 🔶
mdBook Documentation 🔶

Next Milestones

At the current state, the framework is in beta. As the framework matures we expect to support more and more types of applications. We recommend no use in real-world applications until the consumed libraries are audited, but experimentation and Proof-of-Concept projects are encouraged at the different stages.

The next milestone is the release of version 1.0, which will stabilize the APIs, support backwards compatibility and versioned identities. This makes updating to future versions much easier. In addition it will provide full documentation coverage and the release will be audited.

Afterwards, we are already planning a future update containing privacy enhancing features such as Selective Disclosure and Zero Knowledge Proofs.

Contributing

We would love to have you help us with the development of IOTA Identity. Each and every contribution is greatly valued!

To contribute directly to the repository, simply fork the project, push your changes to your fork and create a pull request to get them included!

The best place to get involved in discussions about this framework or to look for support at is the #identity-discussion channel on the IOTA Discord. You can also ask questions on our Stack Exchange.

About

Implementation of the Decentralized Identity standards such as DID and Verifiable Credentials by W3C for the IOTA Tangle.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 97.6%
  • JavaScript 2.3%
  • Other 0.1%