IOTA SDK and identity.rs
Code's organization: How are IOTA's libraries structured?
Good news: it's getting easier!
To remind you: it is not the task of this tutorial to explain the libraries in detail. The purpose of the listed modules and features will become clearer when you create a project and use them. It's your responsibility to dive deep into it.
A big step in the right direction
The IOTA SDK consolidates the two deprecated libraries iota.rs and wallet.rs. It also addresses the issue with rocksdb, making it easier for us to use on Android and iOS.
IOTA SDK
In order to better analyze the code, I recommend:
- Downloading the latest version of the source code (either by downloading and extracting the zip file or using git clone) and opening it in your IDE.
- Creating the Rust Docs as described in the chapter Create Rust Docs.
Take a look inside the src/
folder. You'll find the client
and wallet
directories there.
Module | Description |
---|---|
client | A general purpose IOTA client for interaction with the IOTA network (Tangle). High-level functions are accessible via the Client struct. |
wallet | The IOTA Wallet Library to create and use Accounts which can be secured by Stronghold and can be persisted in a database (rocksdb). Needed to send and receive values. |
pow | Provides proof of work implementations and scoring for the IOTA protocol as a means to rate-limit the network. See Message PoW. |
utils | Utility functions for serialization and deserialization. |
typesΒ | Common types required by nodes and clients APIs like blocks, responses and DTOs. |
Your task: Review the feature definitions in sdk/Cargo.toml
. Upon inspection, you'll notice that enabling the wallet feature will inherently incorporate the client feature.
Compare your insights with the source code in sdk/src/lib.rs
:
The source code of the modules client, wallet and pow can be included or excluded from the IOTA SDK Library, depending on the definition in YOUR PROJECT's Cargo.toml
.
identity.rs
The main package of this workspace is located in the identity_iota/
directory. This package will be built as a crate with the name "identity_iota" (use this name to search for it in https://crates.io). The other packages of this workspace are dependencies of the main package.
π Β Complete latest Documentation
π Β Wiki - IOTA's Identity Framework
The main module "identity_iota" contains the IOTA DID method implementation for the IOTA ledger. It implements the W3C Decentralized Identifiers (DID) and Verifiable Credentials specifications.
π Β Decentralized Identifiers (DID)
A look at identity_iota/Cargo.toml
reveals the features of the library crate.