MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / did_for_public_key

Function did_for_public_key

atomic-canonical/src/did.rs:29–36  ·  view source on GitHub ↗

Build the `did:atomic:...` identifier for a public key.

(public_key: &PublicKey)

Source from the content-addressed store, hash-verified

27
28/// Build the `did:atomic:...` identifier for a public key.
29pub fn did_for_public_key(public_key: &PublicKey) -> String {
30 let fingerprint = blake3::hash(public_key.as_bytes());
31 format!(
32 "{}{}",
33 DID_ATOMIC_PREFIX,
34 data_encoding::BASE32_NOPAD.encode(fingerprint.as_bytes())
35 )
36}
37
38/// Build the standard `did:key` identifier for an Ed25519 public key
39/// (multicodec `ed25519-pub` + key bytes, base58btc multibase). Always

Callers 11

resolve_verifierFunction · 0.85
row_forFunction · 0.85
runMethod · 0.85
resolve_verifierFunction · 0.85
row_forFunction · 0.85
did_matches_public_keyFunction · 0.85
attest_valueFunction · 0.85

Calls 2

hashFunction · 0.85
as_bytesMethod · 0.45