Skip to content

Pubky Architecture Overview

This page provides a comprehensive overview of the Pubky ecosystem architecture, showing how all components work together to enable decentralized, censorship-resistant applications.



The foundation of Pubky is cryptographic identity based on key pairs.

Components:

  • Pubky Ring: Mobile app for secure key management
  • Key Pairs: Ed25519 public/private key pairs
  • Recovery Files: Encrypted backups for key recovery

How It Works:

  1. User generates a key pair (public + private key)
  2. Public key becomes permanent identity (z-base-32 encoded)
  3. Private key stays secure on device, used for signing
  4. Recovery file enables backup and cross-device usage

Key Properties:

  • ✅ Self-sovereign (no registration with authorities)
  • ✅ Portable across devices
  • ✅ Permanent (never changes)
  • ✅ Cryptographically secure

The discovery layer enables finding Homeservers and resolving identities without central servers.

Components:

  • PKARR: Public Key Addressable Resource Records
  • Mainline DHT: Distributed Hash Table (10M+ nodes)
  • PKDNS: DNS servers for resolving public-key domains

How It Works:

Key Features:

  • Decentralized discovery (no central directory)
  • Censorship resistant (15+ years proven infrastructure)
  • Self-published (users control their records)
  • Updateable (switch Homeservers anytime)

Homeservers store user data in a key-value format over HTTP/HTTPS.

Architecture:

Key Properties:

  • User Choice: Pick any Homeserver or run your own
  • Data Ownership: You control your data
  • Portability: Switch Homeservers without losing data
  • Persistence Backends: Files for user data; PostgreSQL for the homeserver’s internal metadata (users, quotas, events — not exposed through the API)

API Operations:

  • PUT /pub/app/path - Store data
  • GET /pub/app/path - Retrieve data
  • DELETE /pub/app/path - Delete data
  • LIST /pub/app/ - List directory

Applications consume data from Homeservers, either directly or through aggregation services.

Architecture Patterns:

Use Case: Personal apps, simple tools, direct data access

Use Case: Social feeds, search, discovery (e.g., Pubky Nexus)

Use Case: Advanced features, recommendations, specialized processing



Pubky Core provides:

  • Protocol specification
  • Homeserver implementation
  • SDK for all platforms
  • Authentication system
  • API standards

Repository: github.com/pubky/pubky-core

Pubky Ring handles:

  • Key generation and storage
  • App authorization
  • Session management
  • Recovery file creation

Platforms: iOS, Android (React Native)

Pubky Nexus provides:

  • Real-time aggregation
  • Social graph indexing
  • Search and discovery
  • High-performance API

PKDNS enables:

  • Public-key domain resolution
  • DNS-over-HTTPS support
  • Traditional ICANN domain support
  • Self-hosted or public instances

Repository: github.com/pubky/pkdns

Homegate provides:

  • SMS verification
  • Lightning payment verification
  • Spam prevention
  • Privacy-preserving signup

Repository: github.com/pubky/homegate



See Authentication for the full authentication flow.

All data operations are signed:

  1. Client creates data
  2. Client signs hash with private key
  3. Homeserver verifies signature
  4. Data stored with signature
  5. Anyone can verify authenticity

What you trust:

  • ✅ Mathematics (cryptography)
  • ✅ Your own keys
  • ⚠️ Your Homeserver for availability (not integrity)

What you DON’T trust:

  • ❌ Central authorities
  • ❌ DNS registrars
  • ❌ Server operators to verify data (math does it)

ComponentScaling Method
HomeserversAdd more servers, users distribute naturally
PKDNSRun multiple instances, cache aggressively
NexusShard by user/data type, read replicas
Mainline DHTAlready 10M+ nodes, proven at scale

Typical Latencies:

  • PKARR lookup (cached): < 100ms
  • PKARR lookup (DHT): 500-2000ms
  • Homeserver GET: 50-200ms
  • Nexus API: 10-50ms (sub-millisecond for cached)

AspectTraditionalPubky
IdentityUsername@servicePublic key (permanent)
Data StorageCompany serversUser-chosen Homeservers
PortabilityLocked-inFull portability
CensorshipEasyVery difficult
AspectBlockchainPubky
FeesTransaction feesNone
SpeedSlow (blocks)Instant (HTTP)
StorageExpensiveCheap (standard hosting)
ScalabilityLimitedWeb-scale
AspectPure P2PPubky
AvailabilityMust be onlineHomeservers always on
Mobile-FriendlyDifficultNative support
PerformanceVariableConsistent
DiscoveryComplexDHT + PKDNS

User Device → Pubky Ring → Personal Homeserver

Best for: Personal data, backups, full control

Team Members → Shared Homeserver → Team Apps

Best for: Collaborative projects, startups

Users → Public Homeservers → Nexus Aggregator → Social App

Best for: Social media, discovery platforms

Users → Enterprise Homeserver + Custom Aggregator + Private Nexus → Internal Apps

Best for: Organizations with custom requirements