nostr 2.0.0
nostr: ^2.0.0 copied to clipboard
Pure-Dart Nostr protocol library. Events, signing, NIP-44 encryption, gift wrap, and 35+ NIPs. Transport-agnostic, Flutter Web compatible.
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-11 Relay Information Document
- ✅ 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 — kind 24133 event envelope only. No
bunker:///nostrconnect://URI parsing, no JSON-RPC method encoders. Bring your own. - [~] NIP-47 Wallet Connect — kind 13194/2319x event envelopes only. No
nostr+walletconnect://URI parsing, no JSON-RPC method encoders. - ✅ NIP-50 Search Capability
- [~] NIP-51 Lists — create helpers for kinds 10000/10001/30000/30001 only. Other list kinds (10003-10102, 30002-30030, etc.) need to be built by hand using
Event.from. - ✅ 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.