Module pkarr

Module pkarr 

Source
Expand description

An address lookup service which publishes and resolves endpoint information using a pkarr relay.

Public-Key Addressable Resource Records, pkarr, is a system which allows publishing DNS Resource Records owned by a particular SecretKey under a name derived from its corresponding PublicKey, also known as the EndpointId. Additionally this pkarr Resource Record is signed using the same SecretKey, ensuring authenticity of the record.

Pkarr normally stores these records on the Mainline DHT, but also provides two bridges that do not require clients to directly interact with the DHT:

  • Resolvers are servers which expose the pkarr Resource Record under a domain name, e.g. o3dks..6uyy.dns.iroh.link. This allows looking up the pkarr Resource Records using normal DNS clients. These resolvers would normally perform lookups on the Mainline DHT augmented with a local cache to improve performance.

  • Relays are servers which allow both publishing and looking up of the pkarr Resource Records using HTTP PUT and GET requests. They will usually perform the publishing to the Mainline DHT on behalf on the client as well as cache lookups performed on the DHT to improve performance.

PkarrPublisher filters published addresses: only relay addresses are published by default. To change this behavior, use PkarrPublisherBuilder::addr_filter and set it to e.g. AddrFilter::unfiltered. This can be useful to enable publishing IP addresses if the iroh endpoint is reachable via public IP addresses.

For address lookup in iroh the pkarr Resource Records contain the addressing information, providing endpoints which retrieve the pkarr Resource Record with enough detail to contact the iroh endpoint.

There are several Address Lookup’s built on top of pkarr, which can be composed to the application’s needs:

Mainline-DHT-based pkarr publishing/lookup lives in the iroh-mainline-address-lookup crate.

Structs§

PkarrPublisher
Publisher of address lookup information to a pkarr relay.
PkarrPublisherBuilder
Builder for PkarrPublisher.
PkarrRelayClient
A pkarr client to publish SignedPackets to a pkarr relay.
PkarrRelayClientBuilder
A builder for the PkarrRelayClient
PkarrResolver
Resolver of address lookup information from a pkarr relay.
PkarrResolverBuilder
Builder for PkarrResolver.

Enums§

PkarrError

Constants§

DEFAULT_PKARR_TTL
Default TTL for the records in the pkarr signed packet.
DEFAULT_REPUBLISH_INTERVAL
Interval in which to republish the endpoint info even if unchanged: 5 minutes.
N0_DNS_PKARR_RELAY_PROD
The production pkarr relay run by number 0.
N0_DNS_PKARR_RELAY_STAGING
The testing pkarr relay run by number 0.