nostr

March 16, 2026 ยท View on GitHub

License: LGPL v3 nostr CI pub package codecov

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

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.