Skip to content
pubscout

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
$ flutter pub add nostr
Source repository

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.

  • web3dart

    If working with EVM-compatible blockchains instead of the Nostr protocol.

Works with

Packages commonly used together with nostr: ones it builds on, ones built on it, and its own family.