Decentralized Identifiers (DIDs) are a new type of identifier for verifiable, self-sovereign digital identity that is fully under the control of the identity holder. These identifiers are designed to enable the holder to prove the control of the identifier without having to rely on a centralized registry or certificate authority.
DIDs are URLs that relate a DID subject to a DID document allowing the subject to provide DID proofs which are cryptographic attestations of the authenticity of the DID document.
This blog post provides an overview of DIDs, how they work, and their application in creating a more secure and privacy-respecting web.
# install the 'did' library (Python) pip install did
# Python from did import DID # Generate a new DID did = DID() print('New DID:', did) print('DID Document:', did.document)
The above Python code generates a new DID using the 'did' Python library, then prints the DID and its associated DID Document.
DIDs are decentralized. This means that they do not require a central authority to issue, revoke, or manage them.
DIDs use public key cryptography, allowing any party to verify the controller of the DID.
# Python from did import DID # Load a DID did = DID('did:example:123456789abcdefghi') # Check if a public key verifies a given signature verification_method = did.document['verificationMethod'][0]['id'] message = b'Some message' signature = '6a1f5e0a4b5d...4c4341a5bdda' print(did.verify(verification_method, message, signature))
The above Python code checks if a given signature
of message
is correctly verified by one of the verificationMethod
listed in the did.document
.
Once created, DIDs are persistent. This means they do not need to change unless the controller decides to revoke them.
DIDs are an integral part of the Web 3.0 vision, offering decentralization and user-controlled digital identities. They hold the potential to revolutionize the way we establish and verify identity online, making the internet a much safer and more private space.
Remember, the decentralized promise of blockchain technology and DIDs also comes with responsibility. As a user, you also take on the obligation to secure and manage your own digital identities.