nostr
2.0.0, released 6 months ago by ethicnology.com
Pure-Dart Nostr protocol library supporting events, signing, encryption, and 35+ NIPs.
WASM-ready
What it does
Provides protocol-level handling for Nostr events, key management, cryptographic operations, and 35+ NIP implementations in pure Dart. It is transport-agnostic and fully compatible with Flutter Web.
AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building Nostr clients or relays in Flutter or pure Dart
- Implementing specific Nostr Improvement Proposals (NIPs)
- Needing web-compatible Nostr event signing and encryption
Skip it when
- You need built-in WebSocket transport (the library is transport-agnostic)
- You only require legacy NIP-04 plaintext DMs which have been removed
Strengths
- Pure-Dart implementation supporting over 35 NIPs
- Transport-agnostic and Flutter Web compatible
- Implements modern standards like NIP-17 direct messages and NIP-59 gift wrap
Weaknesses
- Does not include built-in transport/WebSocket handling
- Requires manual implementation for partially supported NIPs like NIP-46 or NIP-47 URI parsing
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 6
Add the package to pubspec.yaml using pub add nostr.
import 'package:nostr/nostr.dart';
final keys = Keys.generate();
final event = Event.from(
kind: 1,
tags: [],
content: 'Hello Nostr!',
secretKey: keys.secret,
);
print(event.serialize());Alternatives
Packages that do the same job and could replace nostr.
Works with
Packages commonly used together with nostr: ones it builds on, ones built on it, and its own family.
- convertnostr depends on itEncoders and decoders for converting between different data representations.
- pointycastlenostr depends on itA Dart library providing a wide range of cryptographic algorithms and primitives.
- bech32nostr depends on itImplementation of Bitcoin's BIP173 Bech32 encoding specification.
- ellipticnostr depends on itPure Dart elliptic curve math for ECDSA, ECDH, key generation.