nostr 2.0.0 copy "nostr: ^2.0.0" to clipboard
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.

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.

14
likes
160
points
2.36k
downloads

Documentation

API reference

Publisher

verified publisherethicnology.com

Weekly Downloads

Pure-Dart Nostr protocol library. Events, signing, NIP-44 encryption, gift wrap, and 35+ NIPs. Transport-agnostic, Flutter Web compatible.

Repository (GitHub)
View/report issues

Topics

#nostr #protocol #bitcoin #lightning #cryptography

License

LGPL-3.0 (license)

Dependencies

bech32, bip340, convert, elliptic, http, pointycastle

More

Packages that depend on nostr