Decentralized Identity Fundamentals - Part 1 DIDs
DIDs are?easier to explain in the context of an example. When you create a new email account in a service provider like Google, you get an unique identifier for the account and your user profile data. Next time you sign in to Google, you will use that identifier or email address and password to prove it is yours. That identifier can also be used for social authentication on third party websites. The main advantage is that you can use a single pair of credentials everywhere, just an email address and a password. Google will also share minimal information about your profile with those apps so we can keep everything centralized in a single place. However, there is price to pay for that convenience. Google owns that identifier and also your identity information. While this couldn't represent a problem for you, imagine an scenario where you don't have access to that identifier anymore. E.g. your phone was stolen and the attacker took control of your account or something more extreme like Google banning your account. If that happens, you not only lost access to Google and all your information associated with your identifier but also the third-party web apps. Another issue, not so evident is that Google could in theory track all the applications where our credentials where used for authentication.
Having discussed all the issues associated with having your identity controlled by a third party, let's talk about DIDs and how they address those problems.
A DID or Decentralized Identifier is just an string representing an identifier that you can generate and own. This identifier adheres to a few rules that I will discuss next.
Microsoft recently released a Decentralized Identity offering as part of Azure AD Verifiable Credentials. This implementation leverages ION, a decentralized ledger or blockchain as DID registry. That means the DID documents are persisted in this ledger and replicated across all the nodes in the network. A curious fact about ION is that runs on top of Bitcoin.?
The following code shows how to register a new DID on the ION network using the?SDK provided my Microsoft. These are free to use, and connects to the nodes hosted by Microsoft.
领英推荐
let authnKeys = await ION.generateKeyPair()
let did = new ION.DID({
? content: {
? ? publicKeys: [
? ? ? {
? ? ? ? id: 'key-1',
? ? ? ? type: 'EcdsaSecp256k1VerificationKey2019',
? ? ? ? publicKeyJwk: authnKeys.publicJwk,
? ? ? ? purposes: [ 'authentication' ]
? ? ? }
? ? ],
? ? services: [
? ? ? {
? ? ? ? id: 'domain-1',
? ? ? ? type: 'LinkedDomains',
? ? ? ? serviceEndpoint: 'https://foo.example.com'
? ? ? }
? ? ]
? }
});
const requestBody = await did.generateRequest();
const request = new ION.AnchorRequest(requestBody);
let response = await request.submit();
The code above generates a DID document that contains a public key (Elliptic curve) that could be used for authentication, which is the scenario previously discussed. It also adds a linked domain stating that the owner of this DID document and public key also owns the given domain. Azure AD in particular verifies this domain belongs to the user before submitting pushing the DID document to ION.
Once the document is pushed, you get two identifiers or DIDs, a long identifier that can be used to look up for the document in the ledger while the transaction is confirmed or a short identifier after it was confirmed and added to the ledger.
Those identifiers are what you could use to authenticate in third party websites from now on. You own the keys associated to those and also the documents. There is no need to involve an intermediary anymore. Also, when you sign a document for authentication, the third party verifying the signature does not need to contact any central authority. It could pull the DID document associated with the DID, retrieve the public key and verify the signature to make sure it was signed by one of the keys you own.?
That is the magic with decentralized identity.?
In the next article about this serie, we will review Verifiable Credentials, another core aspect of Decentralized identity.