Skip to content

Latest commit

 

History

History

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

banner

IOTA Identity Examples

This folder provides code examples to learn how IOTA Identity can be used.

You can run each example using

cargo run --example <example_name>

For instance, to run the example 0_create_did, use:

cargo run --release --example 0_create_did

Note: Running the examples with the release flag will be significantly faster due to stronghold performance issues in debug mode.

Basic Examples

The following basic CRUD (Create, Read, Update, Delete) examples are available:

Name Information
0_create_did Demonstrates how to create a DID Document and publish it in a new Alias Output.
1_update_did Demonstrates how to update a DID document in an existing Alias Output.
2_resolve_did Demonstrates how to resolve an existing DID in an Alias Output.
3_deactivate_did Demonstrates how to deactivate a DID in an Alias Output.
4_delete_did Demonstrates how to delete a DID in an Alias Output, reclaiming the storage deposit.
5_create_vc Demonstrates how to create and verify verifiable credentials.
6_create_vp Demonstrates how to create and verify verifiable presentations.
7_revoke_vc Demonstrates how to revoke a verifiable credential.

Advanced Examples

The following advanced examples are available:

Name Information
0_did_controls_did Demonstrates how an identity can control another identity.
1_did_issues_nft Demonstrates how an identity can issue and own NFTs, and how observers can verify the issuer of the NFT.
2_nft_owns_did Demonstrates how an identity can be owned by NFTs, and how observers can verify that relationship.
3_did_issues_tokens Demonstrates how an identity can issue and control a Token Foundry and its tokens.
4_alias_output_history Demonstrates fetching the history of an Alias Output.
5_custom_resolution Demonstrates how to set up a resolver using custom handlers.
6_domain_linkage Demonstrates how to link a domain and a DID and verify the linkage.
7_sd_jwt Demonstrates how to create and verify selective disclosure verifiable credentials.
8_status_list_2021 Demonstrates how to revoke a credential using StatusList2021.
11_linked_verifiable_presentation Demonstrates how to link a public Verifiable Presentation to an identity and how it can be verified.