chio-did
Self-certifying did:chio identifiers and DID Document resolution. The
method-specific identifier is the lowercase hex form of an Ed25519 public key
already used by Chio agents and operators, so basic resolution needs no
registry lookup. The resolving environment may attach optional receipt-log and
passport-status service endpoints.
Responsibilities
- Derive a canonical
did:chio:<64-hex>identifier from an Ed25519PublicKeyand parse it back (DidChio,FromStr,Display). - Resolve a
DidChiointo a W3C-shapedDidDocumentwith one Ed25519 verification method, with no network or registry lookups. - Validate and attach resolver-provided service endpoints (
DidService), rejecting anything that is not a well-formedhttpsURL. - Reject non-Ed25519 key material and malformed method-specific identifiers.
Public API
DidChio- parses, renders, and resolves adid:chioidentifier.from_public_key/try_from_public_key,as_str,verification_method_id,public_key_multibase,resolve,resolve_with_options; implementsDisplay,FromStr,TryFrom<PublicKey>.DidDocument,DidVerificationMethod,DidService- the resolved document and its parts (serde::Serialize/Deserialize, DID-spec field names).DidService::new/::receipt_log/::passport_status- validated service-endpoint constructors;RECEIPT_LOG_SERVICE_TYPEandPASSPORT_STATUS_SERVICE_TYPEname the two known service types.ResolveOptions- builder for the services attached during resolution.resolve_did_arc- parse-and-resolve convenience over a rawdid:chio:...string.DidError- the crate's fail-closed error enum.
Usage
use Keypair;
use ;
let keypair = from_seed;
let did = from_public_key?;
let options = default.with_service;
let document = did.resolve_with_options;
assert_eq!;
Feature flags
| Flag | Effect |
|---|---|
fuzz |
Enables chio_did::fuzz (fuzz_did_resolve), the libFuzzer entry point. Off by default; pulls in arbitrary and serde_json. Enabled only by the standalone fuzz workspace. |
Testing
cargo test -p chio-did
See also
chio-core- supplies thePublicKeyandSigningAlgorithmtypes everydid:chioidentifier wraps.chio-credentials- anchors credential subjects and issuers to resolveddid:chioidentities.chio-control-plane- resolvesdid:chioidentifiers for reputation and trust-control subjects.chio-cli- implements thedid resolvecommand overDidChio,DidService, andResolveOptions.