• Stars
    star
    285
  • Rank 139,765 (Top 3 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created about 4 years ago
  • Updated 28 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

banner

StackExchange Discord Discord Apache 2.0 license Dependencies Coverage Status

Introduction β—ˆ Bindings β—ˆ Documentation & Resources β—ˆ Getting Started β—ˆ Example β—ˆ Roadmap β—ˆ Contributing


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 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

  • API Reference: Package documentation (cargo docs).
  • Identity Documentation Pages: Supplementing documentation with context around identity and simple examples on library usage.
  • Examples: Practical code snippets to get you started with the library.
  • IOTA Identity Experience Team Website: Website for a collaborative effort to provide help, guidance and spotlight to the IOTA Identity Community through offering feedback and introducing consistent workflows around IOTA Identity.

Prerequisites

Getting Started

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

[dependencies]
identity_iota = { version = "0.7.0-alpha" }

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

Example: Creating an Identity

The following code creates and publishes a new IOTA DID Document to a locally running private network. See the instructions on running your own private network.

Cargo.toml

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

[dependencies]
identity_iota = { version = "0.7.0-alpha" }
iota-sdk = { version = "0.3.0", default-features = true, features = ["tls", "client", "stronghold"] }
tokio = { version = "1", features = ["full"] }

main.rs

use identity_iota::core::ToJson;
use identity_iota::iota::IotaClientExt;
use identity_iota::iota::IotaDocument;
use identity_iota::iota::IotaIdentityClientExt;
use identity_iota::iota::NetworkName;
use identity_iota::storage::JwkDocumentExt;
use identity_iota::storage::JwkMemStore;
use identity_iota::storage::KeyIdMemstore;
use identity_iota::storage::Storage;
use identity_iota::verification::jws::JwsAlgorithm;
use identity_iota::verification::MethodScope;
use iota_sdk::client::secret::stronghold::StrongholdSecretManager;
use iota_sdk::client::secret::SecretManager;
use iota_sdk::client::Client;
use iota_sdk::crypto::keys::bip39;
use iota_sdk::types::block::address::Address;
use iota_sdk::types::block::output::AliasOutput;
use tokio::io::AsyncReadExt;

// The endpoint of the IOTA node to use.
static API_ENDPOINT: &str = "http://127.0.0.1:14265";

/// Demonstrates how to create a DID Document and publish it in a new Alias Output.
#[tokio::main]
async fn main() -> anyhow::Result<()> {
  // Create a new client to interact with the IOTA ledger.
  let client: Client = Client::builder()
    .with_primary_node(API_ENDPOINT, None)?
    .finish()
    .await?;

  // Create a new Stronghold.
  let stronghold = StrongholdSecretManager::builder()
    .password("secure_password")
    .build("./example-strong.hodl")?;

  // Generate a mnemonic and store it in the Stronghold.
  let random: [u8; 32] = rand::random();
  let mnemonic =
    bip39::wordlist::encode(random.as_ref(), &bip39::wordlist::ENGLISH).map_err(|err| anyhow::anyhow!("{err:?}"))?;
  stronghold.store_mnemonic(mnemonic).await?;

  // Create a new secret manager backed by the Stronghold.
  let secret_manager: SecretManager = SecretManager::Stronghold(stronghold);

  // Get an address from the secret manager.
  let address: Address = client.get_addresses(&secret_manager).with_range(0..1).get_raw().await?[0];

  // Get the Bech32 human-readable part (HRP) of the network.
  let network_name: NetworkName = client.network_name().await?;

  println!("Your wallet address is: {}", address.to_bech32(network_name.as_ref()));
  println!("Please request funds from http://127.0.0.1:8091/, then press Enter.");
  tokio::io::stdin().read_u8().await?;

  // Create a new DID document with a placeholder DID.
  // The DID will be derived from the Alias Id of the Alias Output after publishing.
  let mut document: IotaDocument = IotaDocument::new(&network_name);

  // Insert a new Ed25519 verification method in the DID document.
  let storage: Storage<JwkMemStore, KeyIdMemstore> = Storage::new(JwkMemStore::new(), KeyIdMemstore::new());
  document
    .generate_method(
      &storage,
      JwkMemStore::ED25519_KEY_TYPE,
      JwsAlgorithm::EdDSA,
      None,
      MethodScope::VerificationMethod,
    )
    .await?;

  // Construct an Alias Output containing the DID document, with the wallet address
  // set as both the state controller and governor.
  let alias_output: AliasOutput = client.new_did_output(address, document, None).await?;
  println!("Alias Output: {}", alias_output.to_json()?);

  // Publish the Alias Output and get the published DID document.
  let document: IotaDocument = client.publish_did_output(&secret_manager, alias_output).await?;
  println!("Published DID document: {:#}", document);

  Ok(())
}

Example output

{
  "doc": {
    "id": "did:iota:rms:0x4113f08e360a3c1725bb1f93d94f6e807a1ef88f091d45f93513c3e88dac3248",
    "verificationMethod": [
      {
        "id": "did:iota:rms:0x4113f08e360a3c1725bb1f93d94f6e807a1ef88f091d45f93513c3e88dac3248#key-1",
        "controller": "did:iota:rms:0x4113f08e360a3c1725bb1f93d94f6e807a1ef88f091d45f93513c3e88dac3248",
        "type": "Ed25519VerificationKey2018",
        "publicKeyMultibase": "z7BoQerJn9NxwcA4KHGK9CP5FJRRZJBmsxrGPvWiyuFGG"
      }
    ]
  },
  "meta": {
    "created": "2022-09-06T12:12:11Z",
    "updated": "2022-09-06T12:12:11Z"
  }
}

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
IOTA DID Method βœ”οΈ Finished implementation.
Verifiable Credentials βœ”οΈ Finished implementation.
Account βœ”οΈ Finished implementation.
Selective Disclosure πŸ”Ά
Zero Knowledge Proofs πŸ”Ά
Support Embedded Rust πŸ”Ά
WASM Bindings βœ”οΈ Finished implementation.
Code Examples βœ”οΈ
Documentation Portal πŸ”Ά

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!

Please review the contribution and workflow sections in the IOTA Wiki.

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 channel on the IOTA Discord. You can also ask questions on our Stack Exchange.

More Repositories

1

legacy-wallet-use-trinity-wallet-instead

IOTA Wallet
JavaScript
2,076
star
2

iri

IOTA Reference Implementation
Java
1,158
star
3

iota.js

IOTA JavaScript
TypeScript
966
star
4

stronghold.rs

Stronghold is a secret management engine written in rust.
Rust
489
star
5

firefly

The official IOTA and Shimmer wallet
TypeScript
478
star
6

trinity-wallet

Trinity is IOTA's old, deprecated wallet. Use Firefly instead.
JavaScript
473
star
7

goshimmer

Prototype implementation of IOTA 2.0
Go
389
star
8

iota.go

IOTA Go API Library. Find documentation on https://wiki.iota.org/build/welcome
Go
356
star
9

iota.py

PyOTA: The IOTA Python API Library
Python
344
star
10

hornet

HORNET is a powerful IOTA fullnode software
Go
306
star
11

wasp

Node for IOTA Smart Contracts
Go
285
star
12

bee

A framework for IOTA nodes, clients and applications in Rust
Rust
277
star
13

iota.rs

Official IOTA Rust library.
Rust
229
star
14

streams

IOTA Streams, a framework for cryptographic protocols called Applications. Replaces Masked Authenticated Messaging (MAM). Alpha version.
Rust
217
star
15

wallet.rs

Build wallets and other applications involving IOTA value transfer.
Rust
159
star
16

iota-java

IOTA Java API Library. Find documentation on
Java
144
star
17

entangled

enTangle'd is an amalgamation of all things Tangle
C
110
star
18

iota-wiki

IOTA Wiki
TypeScript
109
star
19

tips

Tangle Improvement Proposals for the IOTA technology stack.
JavaScript
86
star
20

android-wallet-app

IOTA Android Wallet Application
Java
82
star
21

iota.legacy.rs

IOTA implementation ( rust )
Rust
77
star
22

chronicle.rs

A framework for building IOTA permanodes
Rust
73
star
23

iota.c

IOTA client library in C
C
67
star
24

crypto.rs

The canonical source of cryptographic ground-truth for IOTA projects that use Rust.
Rust
66
star
25

MAM

Masked Authentication Messaging
Rust
65
star
26

iota.flash.js

JavaScript
64
star
27

iota.lib.csharp

Iota.Lib.Csharp
C#
62
star
28

IOTA-2.0-Research-Specifications

This is the repository of the IOTA 2.0 Research Specifications.
JavaScript
61
star
29

explorer

Explore the IOTA Tangle
TypeScript
60
star
30

hive.go

A Go library containing data structures, various utils and abstractions which are used by both GoShimmer and Hornet.
Go
60
star
31

one-click-tangle

"One Click Tangle" intends to make lives easier to IOTA adopters by providing pre-configured scripts and recipes that allow to deploy IOTA Networks and Nodes "in one click".
Shell
55
star
32

spark-wallet

A low-security wallet intended for short-term use and to send small amounts of IOTA tokens
Svelte
55
star
33

hub

C++
54
star
34

data-marketplace

Proof of Concept Data Marketplace built using MAM and IOTA Tangle.
JavaScript
54
star
35

documentation-platform

Legacy documentation platform
JavaScript
53
star
36

wiki-legacy

These docs have moved!
52
star
37

iota-sdk

The IOTA SDK provides developers with a seamless experience to develop on IOTA by providing account abstractions and clients to interact with node APIs.
Rust
50
star
38

kerl

IOTA is adding an additional hashing function, based on Keccak, with conversion to ternary. The following document describes the functionality and specification to be implemented.
Rust
50
star
39

industry-marketplace

The world's first autonomous and decentralized Industry Marketplace
JavaScript
49
star
40

node-dashboard

TypeScript
45
star
41

compass

Java
44
star
42

iota-core

Go
43
star
43

qupla

A QUbic Programming LAnguage
Java
43
star
44

meta-iota

OpenEmbedded layer for the IOTA Distributed Ledger
BitBake
42
star
45

cli-wallet

Rust
41
star
46

IOTA-2.0-DevNet-wallet

GUI Wallet for use with the IOTA 2.0 DevNet
TypeScript
39
star
47

curl.lib.js

IOTA Proof-of-Work algorithm ported to Javascript to work in WebGL2-enabled browsers
JavaScript
38
star
48

mam.js

Pure JavaScript implementation of MAMv0
TypeScript
37
star
49

poc-ipfs

Demonstration of combining IOTA with IPFS for data storage.
TypeScript
33
star
50

identity.ts

TypeScript
32
star
51

cli-app

CLI App that acts as a wallet
JavaScript
31
star
52

engineering-updates

Periodical updates from the Engineering teams
31
star
53

ccurl

C port of the Curl library
C
30
star
54

integration-services

TypeScript
30
star
55

wasplib

Go
29
star
56

ict

Java
29
star
57

TangleSim

Go
29
star
58

giotan

The CLI Tool for IOTA in Go
Go
28
star
59

chat.ixi

JavaScript
28
star
60

iota.crypto.js

JavaScript
28
star
61

vdf

Implementation of verifiable delay function.
Python
25
star
62

cliri

Coo Less IRI
Java
24
star
63

introduction-docs

Documentation Page for Chrysalis (IOTA 1.5) and Stardust (Shimmer)
JavaScript
24
star
64

docs

IOTA documentation website - PRs welcome!
JavaScript
24
star
65

ledger-iota-app

C
23
star
66

participation-events

22
star
67

HyperledgerFabric-IOTA-Connector

IOTA connector for Hyperledger Fabric Chaincode
Go
22
star
68

selv-mobile

Svelte
21
star
69

chrysalis-faucet

HTML
21
star
70

qubic

Java
20
star
71

iota-area-codes

IACs are a proposed standard for tagging IOTA transactions with a geo-location, which allows them to be fetched based on their location.
TypeScript
19
star
72

fpc-sim

Fast Probabilistic Consensus Simulator
Go
19
star
73

autopeering-sim

Autopeering Simulator
Go
19
star
74

tangle-utils-website

A web site full of utilities for all things tangle, transaction and IOTA.
TypeScript
18
star
75

iota-gui-beta

Beta of IOTA GUI client.
17
star
76

FirstPartyOracle

JavaScript
16
star
77

gh-tangle-release

GitHub Action to publish release details to the Tangle
JavaScript
16
star
78

ledger.rs

Rust
15
star
79

remote-signer

Rust
15
star
80

client-load-balancer

Perform client side load balancing across a list of nodes
TypeScript
15
star
81

bee-meeting-minutes

14
star
82

outdated-mam.client.js

DEPRECATED MAM js client
JavaScript
14
star
83

trade-poc

IOTA Supply Chain Proof-of-Concept
JavaScript
14
star
84

sandbox

Go
14
star
85

access-server

C
14
star
86

mam-explorer

JavaScript
13
star
87

ccurl.interface.js

cCurl Interface for NodeJS
JavaScript
13
star
88

channels-examples

Sample code for IOTA Channels
Rust
13
star
89

bee-rfcs

RFCs to changes to Bee
Shell
13
star
90

inx-chronicle

IOTA permanode implemented using the IOTA Node Extension (INX) interface.
Rust
13
star
91

chronicle

C
13
star
92

esp32-client-sdk

IOTA Client Software Development Kit(SDK) for ESP32
C
13
star
93

seed-migration-tool

IOTA Seed Migration Tool
HTML
12
star
94

iota-css-theme

SCSS
12
star
95

discord-invite-captcha

Simple webserver that will grant you a one-time-use invite for a Discord server if you solve the Captcha.
HTML
12
star
96

drng

Go
12
star
97

tangle.js

Libraries and utilities that make it easier to build applications on the Tangle
TypeScript
12
star
98

streams-examples

Rust
11
star
99

mam.c

C
11
star
100

iota-identity-tutorial

TypeScript
11
star