AT protocol / bluesky from scratch - Handle

Let's look at the AT protocol starting from scratch, with just an handle semarie.bsky.social.

Handle

The handle is just a name for humans. It is first resolved to a Decentralized Identifiers (DID).

It is just an resolvable hostname (resolvable to some extent as we will see).

$ dig +short semarie.bsky.social
44.216.73.82
34.197.208.36
52.22.43.240
$ 

In fact, there is two differents supported methods to resolv the handle to DID identifier.

DNS TXT record

The first one to test is to try resolv _atproto.semarie.bsky.social to get a TXT record.

$ dig +short _atproto.semarie.bsky.social TXT
$ 

Ah, there is no result. So we will test the second method. But let's see first the result for an handle using DNS TXT.

$ dig +short _atproto.semarie.kapouay.eu.org TXT
"did=did:plc:26sw3p6ebn4p6fn5otobufyn"
$ 

And we get the DID identifier (did:plc:26sw3p6ebn4p6fn5otobufyn).

HTTPS (+ DNS) well-known record

The second method uses HTTPS. So it needs a HTTP server (with proper certificate…), and so a valid IP address to contact it. As seen with semarie.bsky.social, the handle resolves to IPv4 addresses (but no IPv6 address at the time).

The DID is obtained from getting the document at https://HANDLE/.well-known/atproto-did.

$ curl -s https://semarie.bsky.social/.well-known/atproto-did
did:plc:26sw3p6ebn4p6fn5otobufyn
$ 

And we get the DID identifier (did:plc:26sw3p6ebn4p6fn5otobufyn).

Some remarks