Skip to content

Handle and resolve Distributed Identifiers (DIDs) in Bluesky / AT Protocol.

License

Notifications You must be signed in to change notification settings

arathunku/did_tools

Repository files navigation

DIDTools

Actions Status Hex.pm Documentation License

Set of tools to work with Distributed Identifiers (DIDs) in Bluesky / AT Protocol.

Installation

def deps do
  [
    {:did_tools, "~> 0.1.0"}
  ]
end

Usage

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"
       }
     ]
   }
 }}

About

Handle and resolve Distributed Identifiers (DIDs) in Bluesky / AT Protocol.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages