Pkarr uses Cargo feature flags to customize functionality for different use cases.
With a basic dependency declaration, you get the full-client feature:
[dependencies]
pkarr = "5"
This includes both DHT and relay support, suitable for most server applications.
keysEd25519 key utilities for identity management.
pkarr = { version = "5", default-features = false, features = ["keys"] }
Provides:
Keypair - Generate and manage Ed25519 keypairsPublicKey - Handle public keys and derive z-base32 identifierssigned_packetDNS packet signing and verification. Automatically enables keys.
pkarr = { version = "5", default-features = false, features = ["signed_packet"] }
Provides:
SignedPacket - Create and verify signed DNS resource recordsdhtDirect Mainline DHT access for publishing and resolving records.
pkarr = { version = "5", default-features = false, features = ["dht"] }
Not available in WASM environments.
relaysHTTP relay support for environments without direct DHT access.
pkarr = { version = "5", default-features = false, features = ["relays"] }
Required for WASM/browser applications.
full-client (default)Both DHT and relay support combined.
pkarr = "5" # Equivalent to features = ["full-client"]
endpointsRFC 9460 HTTPS/SVCB service discovery for resolving service endpoints.
This feature enables URLs like https://<pkarr-key> by implementing the full
endpoints resolution algorithm. It recursively
interprets and resolves SVCB records - when a target points to another Pkarr
key, it fetches that packet and continues resolution. Records are sorted by
priority for failover and shuffled within priority levels for load balancing.
Returns an async Stream of endpoints. Downstream applications need futures-lite
(or equivalent) to consume the stream with .next() and StreamExt.
pkarr = { version = "5", features = ["endpoints"] }
lmdb-cachePersistent LMDB cache backend for the client.
pkarr = { version = "5", features = ["lmdb-cache"] }
tlsTLS certificate support for secure connections. Enables endpoints.
pkarr = { version = "5", features = ["tls"] }
reqwest-resolveImplement reqwest::dns::Resolve trait for the Client. Enables endpoints.
pkarr = { version = "5", features = ["reqwest-resolve"] }
reqwest-builderCreate a reqwest::ClientBuilder from the Pkarr Client. Enables tls and reqwest-resolve.
pkarr = { version = "5", features = ["reqwest-builder"] }
extraAll extra features: endpoints, lmdb-cache, reqwest-resolve, tls, reqwest-builder.
pkarr = { version = "5", features = ["extra"] }
fullEverything: full-client + extra.
pkarr = { version = "5", features = ["full"] }
| Use Case | Recommended Features |
|---|---|
| Server application | full-client (default) |
| Browser/WASM | relays only |
| Key handling only | keys |
| Packet signing only | signed_packet |
| With persistent cache | lmdb-cache |
| Service discovery | endpoints |
| HTTP client integration | reqwest-builder |
| Everything | full |
| Feature | Native | WASM |
|---|---|---|
keys |
Yes | Yes |
signed_packet |
Yes | Yes |
dht |
Yes | No |
relays |
Yes | Yes |
lmdb-cache |
Yes | No |
endpoints |
Yes | Yes |
tls |
Yes | No |
Smallest footprint (keys only):
pkarr = { version = "5", default-features = false, features = ["keys"] }
WASM browser client:
pkarr = { version = "5", default-features = false, features = ["relays"] }
Server with persistence:
pkarr = { version = "5", features = ["lmdb-cache"] }