Skip to content

DIDs API

A Decentralized Identifier (DID) is a globally unique identifier that you control, backed by a cryptographic key pair. Unlike traditional identifiers (email, username), a DID doesn’t depend on a central authority — you prove ownership by signing with the private key.

In BaseID Cloud, DIDs serve as your issuer identity. When you issue a credential, the DID’s private key produces the signature that verifiers use to confirm authenticity.

Example DID:

did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK

The did:key method encodes the public key directly in the identifier — no external infrastructure needed to resolve it.


When creating a DID, you choose a cryptographic key type. This determines the signature algorithm used when issuing credentials.

Key typeAlgorithmSignatureKey sizeBest for
Ed25519EdDSA64 bytes32 bytesGeneral purpose. Fastest signatures, smallest keys. Recommended default.
P-256ES25664 bytes33 bytesWebAuthn/FIDO2 compatibility. Apple/Google attestation. NIST-approved.
P-384ES38496 bytes49 bytesHigher security margin. Government standards (HAIP profile). Some enterprise procurement requires ES384+.
  • Start with Ed25519 unless you have specific requirements. It’s the fastest and most compact, supported by all major verifiable credential libraries.
  • Use P-256 if integrating with WebAuthn, FIDO2, Apple Attestation, or systems that mandate NIST P-256 (ES256).
  • Use P-384 if targeting the HAIP profile, government procurement requiring ES384, or environments with elevated security requirements.

All three key types produce credentials that are interoperable with standard W3C VC and SD-JWT verifiers.


POST /v1/dids
Authorization: Bearer <token>

Permission required: dids:create

FieldTypeDefaultDescription
methodstringkeyDID method. Currently key (self-contained, no infrastructure).
key_typestringEd25519Cryptographic key type: Ed25519, P256, P384
Terminal window
curl -X POST https://api.baseid.cloud/v1/dids \
-H "Authorization: Bearer bsk_live_..." \
-H "Content-Type: application/json" \
-d '{"method": "key", "key_type": "Ed25519"}'
{
"did": "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK",
"method": "key",
"key_type": "Ed25519"
}
  1. A new key pair is generated server-side using a cryptographically secure random number generator
  2. The private key is stored encrypted in your tenant’s database
  3. The public key is encoded into the DID identifier
  4. The DID is immediately usable for issuing credentials
PlanMax DIDs
Developer (free)1
Startup ($49)5
Business ($199)25
EnterpriseUnlimited

GET /v1/dids
Authorization: Bearer <token>

Permission required: dids:list

Returns only active (non-deactivated) DIDs belonging to your tenant.

[
{
"did": "did:key:z6Mk...",
"method": "key",
"created_at": "2026-03-26T12:00:00Z",
"deactivated": false
}
]

Resolve any DID to its DID Document. This works for any did:key DID, not just your tenant’s — useful for inspecting an issuer’s public keys.

GET /v1/dids/:did
Authorization: Bearer <token>

Permission required: dids:list

The :did parameter must be URL-encoded:

/v1/dids/did%3Akey%3Az6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK
{
"id": "did:key:z6Mk...",
"verificationMethod": [
{
"id": "did:key:z6Mk...#z6Mk...",
"type": "Ed25519VerificationKey2020",
"controller": "did:key:z6Mk...",
"publicKeyMultibase": "z6Mk..."
},
{
"id": "did:key:z6Mk...#z6LSk...",
"type": "JsonWebKey2020",
"controller": "did:key:z6Mk...",
"publicKeyJwk": {
"kty": "OKP",
"crv": "Ed25519",
"x": "..."
}
}
],
"authentication": ["did:key:z6Mk...#z6Mk..."],
"assertionMethod": ["did:key:z6Mk...#z6Mk..."]
}
FieldDescription
idThe DID itself
verificationMethodArray of public keys associated with this DID
authenticationKey IDs authorized for authentication
assertionMethodKey IDs authorized for signing assertions (credentials)
publicKeyJwkThe public key in JSON Web Key format (used for verification)

Permanently deactivate a DID. Use this for key rotation or when retiring an identity.

DELETE /v1/dids/:did
Authorization: Bearer <token>

Permission required: dids:deactivate

AspectEffect
New issuanceBlocked — cannot issue credentials with this DID
Existing credentialsRemain valid — verifiers can still check signatures
Key materialPreserved but marked inactive — not deleted
ReversibilityPermanent — cannot be reactivated
DID resolutionStill resolvable — public key available for verification
{
"status": "deactivated",
"did": "did:key:z6Mk..."
}
  • Key rotation: Create a new DID with fresh keys, then deactivate the old one
  • Compromised key: If you suspect the private key was exposed
  • Organizational change: When an issuer identity is no longer needed

MethodStatusDescription
did:keyAvailableSelf-contained, no infrastructure. Public key in the identifier.
did:webPlannedDomain-based DID resolved via HTTPS. Ties identity to a domain name.
did:peerPlannedPeer-to-peer DIDs for DIDComm. No public resolution.
did:webvhPlannedVerifiable history — trust over time with signed updates.