Dart Nostr Development Kit (NDK)
NDK (Nostr Development Kit) is a Dart library that enhances the Nostr development experience.
NDK supplies you with high-level usecases like lists or metadata while still allowing you to use low-level queries enhanced with inbox/outbox (gossip) by default.
Our Target is to make it easy to build constrained Nostr clients, particularly for mobile devices.
Want to see NDK in action?
The repository includes a sample app that demonstrates many implemented features, usecases, and Flutter widgets end to end.
- sample app live demo
- source:
packages/sample-app
Apps using NDK
- sample app, yana, camelus, zap.stream, zapstore, freeflow, hostr, bitblik, donow, submarine, nostr-mail-client
➡️ Getting Started 🔗
Changelog 🔗
Core Features
Network & Data Management
- Automatic relay discovery using inbox/outbox (gossip) model for optimal relay selection
- Flexible data fetching with query (one-time) and subscription (real-time) modes
- Smart caching to reduce network bandwidth and improve performance
- Concurrent event streaming from both cache and network
- Request coverage control to specify desired relay coverage per request
- Local-first delivery so events can become visible from cache before every relay confirms them
- Background retry and recovery for relay delivery across reconnects, periodic due-retry, and restart persistence when using a persistent cache
- Visibility-aware reads that apply replaceable winner selection, expiration filtering, and deletion suppression consistently
Account & Authentication
- Multiple signer support: Built-in (BIP-340), WebEventSigner (fast web crypto), NIP-55 external signers, NIP-07 (web), and NIP-46 (remote signing/bunkers)
- Account management with state tracking and multiple account support
- Relay authentication (NIP-42) for private relay access
- Delayed external signing support so local-first publish can survive signer approval delays or temporary signer unavailability
High-Level Use Cases
- Metadata management: Query and update user profiles with automatic caching
- Contact lists: Follow/unfollow users and manage contact lists
- NIP-51 lists: Public and private relay sets, mute lists, and custom lists
- DMs: Cached direct-message loading with decrypted payload reuse and live updates
- Gift wrap (NIP-59): Encrypted, metadata-obscured messaging
- Zaps (NIP-57): Lightning payments on Nostr
- Nostr Wallet Connect (NIP-47): Integrate Lightning wallets
- Domain verification (NIP-05): Verify and cache Nostr addresses
- File management: Upload, download, and delete files using Blossom servers
- Connectivity: Get notified about connection issues
- Proof of Work (NIP-13): Create and verify PoW events
Developer Experience
- Pluggable architecture: Bring your own cache, verifier, or signer, replace any component
- Multiple database options: In-memory, ObjectBox, Sembast
- Event verification: BIP-340, Rust-based (recommended for mobile/desktop), or
NdkEventVerifierfromndk_flutter(recommended for Flutter apps) - Comprehensive logging with configurable log levels and outputs
- Clean architecture for maintainability and extensibility
- Decrypted payload sidecar cache to avoid repeatedly asking slow or remote signers to decrypt the same encrypted events
not Included
- ready to use feeds, you have to build them on your own (🚫 not planned)
- create && manage keypairs. You have to provide them (🚫 not planned)
- threading, you can do this on your own if you move ndk or only the event_verifier into its own thread (🔜 planned)
- support for request overrides (you have to close and reopen requests) (🚫 not planned)