Skip to main content
EID

Identity Protocol

Elastos implements W3C Decentralized Identifiers (DIDs) anchored on the EID chain (Chain ID 22). DIDs use the P-256 curve — the same as the main chain, not Ethereum's secp256k1. This page covers the DID method specification, document format, on-chain storage, and resolution.

DID Method

PropertyValue
Methoddid:elastos
Spec versionv0.2
Anchoring chainEID (Chain ID 22)
CurveP-256 (secp256r1)
Case sensitiveYes
Exampledid:elastos:icJ4z2DULrHEzYSvjKNJpKyhqFDxvYV7pN

Address Derivation

  1. Generate P-256 key pair from HD path m/44'/0'/0'/0/<index>
  2. Build redeem script: 0x21 || compressed_pubkey || 0xAC
  3. Hash: SHA-256 then RIPEMD-160 (20 bytes)
  4. Prepend version byte 0x67 (DID prefix)
  5. Append checksum (first 4 bytes of double-SHA-256)
  6. Base58 encode — address always starts with i
  7. DID = did:elastos:i<address>
warning

The DID address uses P-256, not secp256k1. Standard Ethereum/Bitcoin key derivation cannot produce valid Elastos DID keys.

DID Document

{
"@context": ["https://www.w3.org/ns/did/v1"],
"id": "did:elastos:icJ4z2DULrHEzYSvjKNJpKyhqFDxvYV7pN",
"publicKey": [{
"id": "did:elastos:icJ4z2DULrHEzYSvjKNJpKyhqFDxvYV7pN#primary",
"type": "ECDSAsecp256r1",
"controller": "did:elastos:icJ4z2DULrHEzYSvjKNJpKyhqFDxvYV7pN",
"publicKeyBase58": "<base58-P256-pubkey>"
}],
"authentication": ["did:elastos:icJ4z2DULrHEzYSvjKNJpKyhqFDxvYV7pN#primary"],
"verifiableCredential": [],
"service": [{
"id": "#hivevault",
"type": "HiveVault",
"serviceEndpoint": "https://your-hive-node.example.com"
}],
"expires": "2027-01-01T00:00:00Z"
}

On-Chain Format

DID operations are submitted as EVM transactions on EID targeting precompile 0x16. Each operation contains:

ComponentDescription
HeaderOperation type (create, update, deactivate), spec version, previous tx hash (for updates)
PayloadBase64-encoded DID document JSON
ProofP-256 signature over header + payload, with verification method reference

Resolution Algorithm

  1. Query EID node via did_resolveDID JSON-RPC
  2. Retrieve all transactions for the DID from the chain
  3. Validate each transaction's P-256 signature
  4. Replay operations chronologically:
    • create — initial document
    • update — apply changes (must be signed by controller)
    • deactivate — mark DID as deactivated
  5. Return final document + status (valid / deactivated / not-found)
  6. Cache result locally (configurable TTL)

Verifiable Credentials

Credentials follow the W3C Verifiable Credentials specification:

{
"@context": ["https://www.w3.org/2018/credentials/v1"],
"type": ["VerifiableCredential", "KYCCredential"],
"issuer": "did:elastos:issuerDID",
"credentialSubject": {
"id": "did:elastos:holderDID",
"name": "John Doe"
},
"proof": {
"type": "ECDSAsecp256r1",
"verificationMethod": "did:elastos:issuerDID#primary",
"signature": "<base64-signature>"
}
}

Credential types (from Elastos.DID.Contexts): ApplicationProfileCredential, InternetAccountCredential, SocialCredential, WalletCredential.

SDK Support

LanguageRepositoryKey Classes
TypeScriptElastos.DID.JS.SDKDIDStore, RootIdentity, DID, DIDDocument, VerifiableCredential
JavaElastos.DID.Java.SDKSame hierarchy, bitcoinj for HD derivation
CElastos.DID.Native.SDKCore implementation, libsodium
SwiftElastos.DID.Swift.SDKiOS/macOS bindings