Create InfraDID
This tutorial explains how to create a DID on InfraDID parachain.
Last updated
This tutorial explains how to create a DID on InfraDID parachain.
Last updated
Before you start, make sure to do the following:
Creating an InfraDID doesn't require communication with the blockchain itself.
The format of an InfraDID involves composing the DID method-specific identifier
part as an SS58 address. In other words, if you structure it as did:infra:{networkID}:{SS58 address}
, it becomes your own DID. You can use the public key and its corresponding private key, which can be obtained from the SS58 address, as the key pair you can use by default.
If you want to register multiple public keys or other data using the same DID or want to use other data, you'll need to go through the process of registering the DID on the chain.
To register InfraDID on the chain, follow these steps:
Access the *InfraBlockchain Explorer and follow the steps below:
Go to Developer
- Extrinsics
- select newOnchain
extrinsic of the didModule
palette.
Configure as shown below and execute the extrinsic.
Check the events to ensure that the DID was created successfully.
Query the storage to confirm that the DID was registered correctly on the chain.
You can create InfraDID using the *InfraBlockchain Explorer, but you can also create InfraDID using the infra-did-js
JavaScript library.
To create InfraDID using the infra-did-js
library, follow these steps:
Install the infra-did-js
library.
Write the code as shown below to set up the basic configuration to access InfraDID chain using the infra-did-js
library.
Write the code to create an InfraDID.
The console.log
output will be as follows:
Write the code to register the created InfraDID on the chain.