Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Glossary

DID Key Method

A DID method where the Decentralized Identifier (DID) itself is a public key, allowing for self-generated, portable identities without a blockchain or external registry.
Chainscore © 2026
definition
DECENTRALIZED IDENTIFIER SPECIFICATION

What is DID Key Method?

A DID Key Method is a specific set of rules defining how to create, resolve, update, and deactivate a Decentralized Identifier (DID) using a cryptographic key pair as its foundation.

Formally defined in the W3C's DID Core specification, a DID Method is a URI scheme that specifies the precise operations for a given DID system. The did:key method is a simple, self-contained method where the DID itself is derived directly from a public key, most commonly using the did:key: prefix followed by a multibase-encoded public key. This creates a self-certifying identifier, meaning the cryptographic proof of control is intrinsic to the identifier's structure, eliminating the need for an external registry or blockchain to resolve it.

The primary advantage of the did:key method is its simplicity and portability. Since the DID document—containing the public key and verification methods—is generated algorithmically from the key material, it requires no network lookup or consensus mechanism. This makes it ideal for offline use cases, peer-to-peer interactions, and as a foundational component in more complex DID ecosystems. Common cryptographic suites used include Ed25519, secp256k1, and the P-256 elliptic curve, with the specific encoding defined by the method specification.

However, this simplicity comes with a key limitation: a did:key is fundamentally static. Its corresponding DID document cannot be updated, rotated, or revoked without creating an entirely new DID. This makes it unsuitable for long-lived identities where key rotation is a security requirement. Therefore, did:key is often used for ephemeral identifiers, device-specific IDs, or as a temporary key agreement mechanism within a larger protocol, before anchoring a more permanent did:ethr or did:ion identifier on a blockchain.

how-it-works
DECENTRALIZED IDENTIFIER

How DID Key Method Works

A DID Key Method is the specific set of cryptographic rules that defines how a Decentralized Identifier (DID) is created, resolved, updated, and deactivated using a public key as its foundational component.

A DID Key Method is a technical specification that defines how a Decentralized Identifier (DID) is derived directly from a cryptographic public key, making the key itself the persistent identifier. This approach, formalized as the did:key method in the W3C DID specification, creates a self-contained DID document without requiring an external registry or blockchain. The DID string is generated by encoding the public key material (e.g., an Ed25519 or secp256k1 public key) using a multicodec prefix and Base58 encoding, resulting in a compact, verifiable identifier like did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK.

The core operational mechanism involves keypair generation and inline resolution. A user first generates a cryptographic keypair. The public key is then transformed into the DID itself. To resolve this DID to its corresponding DID Document, a resolver performs a local cryptographic operation rather than querying a network. The document is constructed on-the-fly and contains the same public key, along with verification methods for authentication and assertion. This makes did:key portable and immediately verifiable, as the proof of control is intrinsic to the identifier's structure.

The primary use cases for the DID Key Method center on simplicity and offline verifiability. It is ideal for: - Peer-to-peer interactions where two parties can exchange DIDs directly. - Static verifiable credentials that do not require key rotation. - Development and testing environments due to its lack of dependency on external systems. However, its key limitation is the inability to rotate keys or update the DID Document without changing the DID itself, as the identifier is cryptographically bound to a single keypair. For scenarios requiring key management, methods like did:ethr or did:ion that use verifiable data registries are more appropriate.

From an architectural perspective, the DID Key Method exemplifies the principle of minimal viable decentralization. It provides a self-sovereign identity primitive that is entirely under the controller's custody, with no intermediaries. This makes it a foundational building block for understanding more complex DID methods, as it isolates the core cryptographic relationship between an identifier and a verification method. Its specification ensures interoperability by defining a standard encoding format for various public key types, allowing different systems to generate and resolve did:key identifiers predictably.

key-features
DECENTRALIZED IDENTIFIER METHOD

Key Features of DID Key Method

The did:key method is a simple, self-contained DID method that encodes a public key directly into the DID identifier, enabling immediate cryptographic verification without requiring a blockchain or external resolver.

01

Self-Contained & Portable

A did:key identifier is a self-contained cryptographic object. The DID itself is a direct encoding of a public key (e.g., using multibase and multicodec), meaning the verification material is embedded within the identifier string. This eliminates dependencies on external ledgers or resolution services, making it highly portable and ideal for peer-to-peer interactions and offline verification scenarios.

02

Immediate Cryptographic Verification

Because the public key is embedded, a verifier can instantly derive it from the DID string. This allows for direct cryptographic operations like:

  • Verifying signatures in Verifiable Credentials
  • Establishing encrypted communication channels
  • Authenticating messages without performing a network lookup to a DID resolver, ensuring low-latency and reliable verification.
03

Algorithm Agnostic

The method supports multiple cryptographic suites through standardized multicodec prefixes. Common supported key types include:

  • Ed25519 (EdDSA with Curve25519)
  • secp256k1 (used in Bitcoin/Ethereum)
  • P-256 (NIST curve, common in WebAuthn)
  • RSA This flexibility allows did:key to integrate with a wide range of existing cryptographic libraries and hardware security modules.
04

No Registry or Blockchain Required

did:key is a non-registrable DID method. It does not require writing to a blockchain, distributed ledger, or any centralized registry for creation. This makes it free to generate, eliminates consensus overhead, and avoids associated transaction fees. Its existence is proven cryptographically, not by a ledger entry.

05

Limitation: No Key Rotation or Revocation

A core trade-off of its simplicity is the inability to rotate or revoke the embedded public key. If a private key is compromised, the entire did:key identifier becomes untrustworthy and must be abandoned. This makes it unsuitable for long-lived identities where key lifecycle management is critical, favoring its use for ephemeral sessions, device identities, or static data signing.

06

Common Use Cases & Examples

did:key is optimal for scenarios requiring lightweight, instant verification:

  • Static Data Signing: Signing software packages, Git commits, or legal documents.
  • Peer-to-Peer Protocols: Establishing secure sessions in messaging apps or IoT device handshakes.
  • Developer Testing & Prototyping: A simple DID for building and testing SSI applications without ledger infrastructure.
  • Example DID: did:key:z6MkiTBz1ymuepAQ4HEHYSF1H8quG5GLVVQR3djdX3mDooWp
examples
DID KEY METHOD

Examples & Use Cases

A DID Key Method is a specific implementation for creating Decentralized Identifiers (DIDs) using cryptographic key pairs. These methods define the syntax and generation rules for DIDs that are entirely self-contained, meaning the DID document is derived directly from the key material itself.

03

JOSE/JWK Integration

Key Method DIDs are natively compatible with standard web cryptography. The public key material within a did:key can be directly expressed as a JSON Web Key (JWK) in the DID document.

  • Interoperability: This allows DIDs to be used seamlessly with JSON Web Signatures (JWS) and JSON Web Encryption (JWE).
  • Example: Signing a Verifiable Credential or securing an API request using a DID as the issuer or subject, leveraging existing JOSE library support.
04

Verifiable Credential Signing

A Key Method DID serves as the issuer identifier or subject identifier in a Verifiable Credential (VC). The corresponding private key signs the VC, providing cryptographic proof of origin.

  • Flow: Issuer creates a did:key, embeds it in the VC's issuer field, and signs the VC. A verifier resolves the DID to get the public key and verifies the signature.
  • Advantage: Eliminates the need for a central certificate authority, enabling trustless verification of claims.
05

Secure P2P Messaging

In frameworks like Aries and protocols like DIDComm, did:peer and did:key are used to establish encrypted communication channels. Each party uses their DID to exchange keys and authenticate messages.

  • Process: DIDs are exchanged during connection setup (DID Exchange protocol).
  • Outcome: Creates an end-to-end encrypted tunnel where every message is signed and encrypted using keys derived from the participants' DIDs, ensuring confidentiality and authenticity.
06

Developer SDKs & Libraries

Multiple libraries exist to generate and resolve Key Method DIDs, making them accessible for developers.

  • did:key Libraries: did-key-creator (JavaScript), did-key.rs (Rust), ssi (Rust).
  • did:peer Libraries: Implemented within the Aries Framework in various languages (JavaScript, .NET, Python).
  • Functionality: These SDKs handle the deterministic generation of the DID document from a key pair, signature creation, and resolution, abstracting the underlying cryptography.
METHOD COMPARISON

DID Key vs. Blockchain-Based DID Methods

A technical comparison of the DID Key method against typical blockchain-based DID methods, focusing on architectural and operational characteristics.

FeatureDID Key (did:key)Blockchain-Based DID (e.g., did:ethr, did:sol)

Underlying Infrastructure

Cryptographic key pair only

Public blockchain or ledger

Decentralization

Self-sovereign, no external consensus

Relies on the consensus mechanism of the underlying network

Verifiable Data Registry (VDR)

None required

The blockchain itself serves as the VDR

Write/Update Operations

Not applicable; key material is static

Requires a blockchain transaction (gas fee)

Resolvable without Network

Yes, via embedded public key

No, requires querying the blockchain

Initial Issuance Cost

$0

Transaction/gas fee (e.g., $0.50 - $10+)

Key Rotation / Revocation

Not supported; requires new DID

Supported via on-chain updates

Typical Use Case

Static, short-lived, or peer-to-peer contexts

Long-lived identities requiring public verification and updates

security-considerations
DID KEY METHOD

Security Considerations

A DID Key Method is a specific mechanism for creating Decentralized Identifiers (DIDs) and their associated cryptographic keys. Its security profile is defined by the underlying cryptographic primitives, key management practices, and the resilience of its resolution process.

01

Cryptographic Algorithm Choice

The security of a DID Key Method is fundamentally tied to its supported cryptographic suites. Common choices include:

  • Ed25519: For fast, high-security signatures.
  • secp256k1: Widely used in blockchain contexts (e.g., Ethereum).
  • RSA: For compatibility with traditional PKI systems. The method must specify algorithms to prevent algorithm substitution attacks and ensure long-term quantum resistance considerations.
02

Key Generation & Storage

The private key is the core secret. Security depends on:

  • Secure Enclaves: Using hardware (HSM, TPM) or trusted execution environments for generation and storage.
  • Key Derivation: Employing strong, standardized functions (e.g., BIP-39, BIP-32) from high-entropy seeds.
  • Custody Models: Evaluating trade-offs between user-held keys (self-custody) and delegated custody solutions. Loss of the private key equates to permanent loss of the DID.
03

DID Document Integrity & Resolution

The DID Document contains public keys and service endpoints. Its integrity must be verifiable. Methods vary:

  • On-Chain: Integrity is enforced by the blockchain's consensus (e.g., did:ethr).
  • Off-Chain: May rely on content-addressed storage (e.g., IPFS in did:key) or signed data structures. The resolution process must be resistant to DNS spoofing, man-in-the-middle attacks, and ensure the retrieved document is authentic and current.
04

Key Rotation & Revocation

A critical security control is the ability to respond to key compromise. A robust DID Key Method must define:

  • Rotation Mechanism: A verifiable procedure to update the public key in the DID Document.
  • Revocation Signal: A way to explicitly invalidate a key, often through an updated document or a verifiable revocation list.
  • Recovery Options: Methods like delegated recovery or social recovery to prevent permanent lockout, which introduce their own trust trade-offs.
05

Method-Specific Attack Vectors

Each method implementation has unique risks:

  • did:key: Relies on the security of the multicodec encoding and the assumption the document is stored/retrieved securely. No built-in revocation.
  • did:ethr / did:ion: Subject to the security and finality of their underlying blockchain (Ethereum, Bitcoin). Smart contract bugs or chain reorganizations are risks.
  • did:web: Inherits all web security risks (TLS compromise, domain hijacking, server breaches).
06

Interoperability & Protocol Binding

Security in practice depends on how the DID and keys are used within protocols like Verifiable Credentials or DIDComm. Considerations include:

  • Proof Purpose: Ensuring keys are used only for their intended purpose (e.g., authentication, assertionMethod).
  • Audit Logging: Maintaining a verifiable data registry of key changes for non-repudiation.
  • Standard Compliance: Adherence to W3C DID Core specifications and related Cryptographic Suite profiles to avoid implementation flaws.
DID KEY METHOD

Technical Details

A DID Key Method is a specific implementation for creating and resolving Decentralized Identifiers (DIDs) using cryptographic key pairs as the foundation. This section details its core mechanics, standards, and practical applications.

A DID Key Method is a specific implementation of the Decentralized Identifier (DID) specification that uses a cryptographic key pair as the sole basis for the DID's creation, resolution, and verification, without relying on an external blockchain or ledger. Defined by a method name (e.g., key), it creates a self-certifying identifier where the DID itself is derived directly from the public key. The most common example is the did:key method, which provides a simple, portable format for embedding public key material directly into the DID document.

Key Characteristics:

  • Self-Sovereign: The identity is fully controlled by the key pair holder.
  • Decentralized: No central registry or consensus mechanism is required for creation.
  • Verifiable: Proofs are generated using the private key and verified against the public key in the DID document.
DID KEY METHOD

Frequently Asked Questions (FAQ)

A DID Key Method is a specific implementation for creating Decentralized Identifiers (DIDs) using cryptographic key pairs. These questions address its core mechanics, use cases, and differences from other DID methods.

A DID Key Method (often did:key) is a simple, self-contained method for creating a Decentralized Identifier (DID) directly from a cryptographic public key, without requiring a blockchain or external verifiable data registry. It works by encoding a public key—such as an Ed25519 or secp256k1 key—into the DID itself using a multibase and multicodec prefix. For example, a did:key might look like did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK. The corresponding private key is held by the controller and is used to create verifiable credentials and presentations, with all verification material embedded in the DID Document derived from the key.

ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected Directly to Engineering Team
DID Key Method: Definition & How It Works | ChainScore Glossary