Weave documentation
L1fe DID

Usage

Parse supported DID forms and inspect their typed components.

Parse a supported identifier

Did::parse parses the supported did:zer0, did:l1fe and did:aut0 forms. It performs local parsing; this crate does not export a network DidResolver.

use l1fe_did::{Did, DidKind};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let original = Did::new_agent_instance();
    let encoded = original.to_string();
    let parsed = Did::parse(&encoded)?;
    assert_eq!(parsed.kind, DidKind::AgentInstance);
    assert_eq!(parsed.to_string(), encoded);
    Ok(())
}

Use the public kind, name, version and uuid fields for typed inspection. to_bytes() hashes the displayed identifier with SHA-256; those bytes are an identifier digest, not an extracted signing key. A parsed DID does not prove control of a private key.

Source reference

Exact declarations and source provenance · Package features and manifest.

On this page