nostr
March 16, 2026 ยท View on GitHub
nostr
A Flutter library for Nostr implemented in Dart.
Dispute is a basic nostr client written in flutter with this library that will show you an implementation.
Getting started
flutter pub add nostr
NIPS
- NIP-01 Basic protocol flow
- NIP-02 Follow List and Petnames
- NIP-05 DNS-based Internet Identifiers
- NIP-09 Event Deletion Request
- NIP-10 Text Note Threading
- NIP-13 Proof of Work
- NIP-17 Private Direct Messages
- NIP-18 Reposts
- NIP-19 Bech32-encoded Entities
- NIP-20 Command Results
- NIP-21 nostr: URI Scheme
- NIP-22 Comments
- NIP-23 Long-form Content
- NIP-25 Reactions
- NIP-27 Text Note References
- NIP-28 Public Chat
- NIP-29 Relay-based Groups
- NIP-32 Labeling
- NIP-38 User Statuses
- NIP-40 Expiration Timestamp
- NIP-42 Authentication
- NIP-44 Encrypted Payloads (Versioned)
- NIP-46 Nostr Connect
- NIP-47 Wallet Connect
- NIP-50 Search Capability
- NIP-51 Lists
- NIP-53 Live Activities
- NIP-57 Lightning Zaps
- NIP-58 Badges
- NIP-59 Gift Wrap
- NIP-65 Relay List Metadata
- NIP-72 Moderated Communities
- NIP-89 Application Handlers
- NIP-94 File Metadata
- NIP-98 HTTP Auth
Usage
import 'package:nostr/nostr.dart';
// Generate or import keys
final keys = Keys.generate();
print('Public key: ${keys.public}');
print('npub: ${keys.npub}');
// Create and sign an event
final event = Event.from(
kind: 1,
tags: [],
content: 'Hello Nostr!',
secretKey: keys.secret,
);
// Serialize for relay
print(event.serialize());
// Subscribe to events
final request = Request(
subscriptionId: generateRandomHex(),
filters: [const Filter(kinds: [1], limit: 10)],
);
print(request.serialize());
For more examples, see the example/ directory.