Decentralized Identifiers (DIDs)
This document details how to use the did:near
method for decentralized identifiers on the NEAR blockchain, how it complies with W3C DID Core, and how it integrates with verifiable credentials (VCs), proof registries, and resolution tooling.
What is a DID?
A Decentralized Identifier (DID) is a persistent, unique identifier that does not require a centralized registry. On NEAR, DIDs are created based on either account names or raw public keys, and they are fully compatible with the W3C DID standard.
The did:near
Method
This method supports two types of DIDs:
Type | Example | Description |
---|---|---|
Named Account | did:near:alice.testnet | Derived from an on-chain NEAR account |
Base58 Public Key | did:near:7YzVXb8vKw3... | Directly represents an Ed25519 key |
DID Document Format
Example output from resolving a did:near
:
{
"@context": "https://w3id.org/did/v1",
"id": "did:near:alice.testnet",
"verificationMethod": [
{
"id": "did:near:alice.testnet#owner",
"type": "Ed25519VerificationKey2018",
"controller": "did:near:alice.testnet",
"publicKeyBase58": "3gfD2z7q..."
}
],
"authentication": ["did:near:alice.testnet#owner"],
"assertionMethod": ["did:near:alice.testnet#owner"]
}
This structure follows the W3C DID Core Spec, including:
- A DID identifier (
id
) - Key references (
verificationMethod
) - Authentication and assertion capabilities
- Base58-encoded Ed25519 public keys