Set of tools to work with Distributed Identifiers (DIDs) in Bluesky / AT Protocol.
def deps do
[
{:did_tools, "~> 0.1.0"}
]
end
See DIDTools.Resolver
module for more details usage.
iex> DIDTools.Resolver.did_by_handle("arathunku.com")
{:ok,
%DIDTools.DID{
did: "did:plc:yww4iq4ogs7f4bmqbiwfzbck",
type: :plc,
resolver: :dns
}}
iex> DIDTools.Resolver.doc_by_did("did:plc:ragtjsm2j2vknwkz3zp4oxrd")
{:ok,
%DIDTools.Document{
did: %DIDTools.DID{
did: "did:plc:ragtjsm2j2vknwkz3zp4oxrd",
type: :plc,
resolver: nil
},
doc: %{
"@context" => ["https://www.w3.org/ns/did/v1",
"https://w3id.org/security/multikey/v1",
"https://w3id.org/security/suites/secp256k1-2019/v1"],
"alsoKnownAs" => ["at://pfrazee.com"],
"id" => "did:plc:ragtjsm2j2vknwkz3zp4oxrd",
"service" => [
%{
"id" => "#atproto_pds",
"serviceEndpoint" => "https://morel.us-east.host.bsky.network",
"type" => "AtprotoPersonalDataServer"
}
],
"verificationMethod" => [
%{
"controller" => "did:plc:ragtjsm2j2vknwkz3zp4oxrd",
"id" => "did:plc:ragtjsm2j2vknwkz3zp4oxrd#atproto",
"publicKeyMultibase" => "zQ3shbTzUCq5zuk7oSj5zaJndqWhjwGDaGuvBXpjg8C19qssW",
"type" => "Multikey"
}
]
}
}}