Skip to main content

PeaqDid

Machines can locate one another, carry out transactions, verify assertions, preserve privacy, and uphold sovereignty thanks to the PeaqDid pallet. One of peaq’s DID fundamental value propositions is the standardization of machine interaction, which was designed in collaboration with Gaia-X and MoveID consortium consisting of an industry-leading experts and companies in the automotive sector.

peaq DID format

Below is the format of peaq DID:


peaq-did = "did:peaq:" + id-string
id-string  = 1* idcha
idchar   = 1-9 / A-H / J-N / P-Z / a-k / m-z

Functions

  • Add Attribute: Add DID attribute to the DID document.

  • Update Attribute: Update DID attribute in the DID document. Returns "Not Found" error if the attribute doesn't exist. Only DID document owner can update attributes.

  • Read Attribute: Read DID attribute if it exists on the DID document else return error. Everyone can read DID document.

  • Remove Attribute: Delete DID attribute from the DID document. Dispatch error if it doesn't exist. Only DID document owner can delete attributes.

TIP

More info on how to interact with peaqDid pallet can be found in our GitHub repo

DID document schema examples

  1. Consumer DID

{
"id": "did:pq:5HRNr4pXH7PYKEmeW1jzJVxepXyg8w2Q3YpgRNHpH8foNr5i",
"service": [
  {
"id": "did:pq:5HRNr4pXH7PYKEmeW1jzJVxepXyg8w2Q3YpgRNHpH8foNr5i#payment",
"type": "payment",
"address": "5HRNr4pXH7PYKEmeW1jzJVxepXyg8w2Q3YpgRNHpH8foNr5i"
}
]
}
  1. Provider DID

{
"id": "did:pq:3HRNr4pXH7PYKEmeW1jzJVxepXyg8w2Q3YpgRNHpH8foNr5i",
"service": [
{
"id": "did:pq:3HRNr4pXH7PYKEmeW1jzJVxepXyg8w2Q3YpgRNHpH8foNr5i#charging-station",
"type": "service-offered",
"serviceEndpoint": "http://device-url-out-of-peaq-network.some.domain.com/rest-schema"
},
{
"id": "did:pq:3HRNr4pXH7PYKEmeW1jzJVxepXyg8w2Q3YpgRNHpH8foNr5i#metadata",
"type": "metadata",
"price": "10",
"unit": "kWh"
},
{
"id": "did:pq:3HRNr4pXH7PYKEmeW1jzJVxepXyg8w2Q3YpgRNHpH8foNr5i#payment",
"type": "payment",
"address": "5HRNr4pXH7PYKEmeW1jzJVxepXyg8w2Q3YpgRNHpH8foNr5i"
 }
]