Adding an Identity
You can associate a crosschain identity with a DEMOS address by creating a signature using your private key and sending it to the DEMOS network.DEMOS network supports linking Web2 identities too (for example, login with Twitter or with Github).See web2 identities
Check out how to create a signature on the “Signing Messages” section of
the respective crosschain SDK documentation. eg.
EVM
0. Imports
1. Creating the signature
Connect your wallet to the XM instance and create a signatureThe signature will be verified on the network to prevent adding identities not
owned by you
2. Creating the DEMOS payload
The payload to add a Sepolia address would look like this:3. Connecting to the network
Create a newDemos object and connect the RPC and your private key.
4. Sending the payload
Then send the identity payload to the network using theidentities instance as shown:
Use identities.inferXmIdentity to create a transaction that adds your identity to the blockchain. Then broadcast the transaction using demos.broadcast.
Getting Identities
After theconfirmationBlock has been forged, you can retrieve all the identities associated with your DEMOS address as shown: