If you want to benefit from Self-Sovereign Identity, you need to create a Decentralized Identity. This identity consists of many parts that have different functions.
Note that the Iota Identity Framework follows IOTA DID Method Specification.
Identity Generation Process
1. Get Funds to Cover the Storage Deposit
If you want to use the main Shimmer or IOTA networks, you will need an output with actual Shimmer or IOTA funds to create a new Alias Output that represents a DID.
2. Create the Content for the DID Document
As a bare minimum, a DID document needs at least one verification method.
At this point the DID itself is unknown since the Alias Output is not published yet and didn't get an
Alias ID assigned.
You can use a placeholder
did:iota:0x0000000000000000000000000000000000000000000000000000000000000000 to reference
the DID inside the document.
3. Construct a New Alias Output
Next, you need to construct a new Alias Output that includes the
DID Document in the State Metadata.
The created Alias Output contains an encoded version of the DID Document in its
State Metadata, and has the state
controller and the governor set to the generated Ed25519 address.
Note that controllers don't need to be Ed25519 addresses, they can be any type of output. However, they must be unlocked in order perform a state or governance transition when the DID Document is updated or destroyed.
4. Publish the generated Alias Output.
The byte cost for the document is automatically calculated and a new transaction is published that includes the Basic Output as input and the newly generated Alias Output as output, as well as another Basic Output which contains the remaining token.
The DID is only known once the Alias Output is successfully published,
since the DID's Tag contains the
Once the transaction is confirmed, the
Alias ID is assigned, and the DID can be derived from it,
the DID Document is stored on the ledger and can be resolved using any node.
Full Example Code
- Typescript (Node.js)
Running a Private Network
In order to run the examples, you will need to run a private network needs to run locally. You can refer to Hornet repository for instructions on how to run a private network.
If your local private network uses different ports than Hornet, modify the API and faucet endpoints in the examples to match your local setup.