Skip to main content

Module identity

Module identity 

Source
Expand description

W3C Decentralized Identifier (DID) Implementation

Implements W3C DID Core 1.0 specification with support for:

  • did:lux - Lux blockchain-anchored DIDs
  • did:key - Self-certifying DIDs from cryptographic keys
  • did:web - DNS-based DIDs

§Example

use zap::identity::{Did, DidMethod, NodeIdentity};

// Parse existing DID
let did = Did::parse("did:lux:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK")?;

// Create from ML-DSA public key
let did = Did::from_mldsa_key(&public_key_bytes)?;

// Generate DID Document
let doc = did.document()?;

// Create node identity
let identity = NodeIdentity::generate()?;

Structs§

Did
W3C Decentralized Identifier (DID)
DidDocument
W3C DID Document
InMemoryStakeRegistry
In-memory stake registry for testing
NodeIdentity
Node identity combining DID with cryptographic keypair
Service
Service endpoint in DID Document
VerificationMethod
Verification method (public key) in DID Document

Enums§

DidMethod
DID method identifier
ServiceEndpoint
Service endpoint
ServiceType
Service type
VerificationMethodType
Verification method type

Traits§

StakeRegistry
Trait for stake registry implementations