Skip to main content

dostr_bip340 0.1.0 copy "dostr_bip340: ^0.1.0" to clipboard
dostr_bip340: ^0.1.0 copied to clipboard

Pure Dart BIP-340 Schnorr signing and verification for Nostr, with a signer and an event verifier.

example/dostr_bip340_example.dart

import 'package:dostr_bip340/dostr_bip340.dart';
import 'package:dostr_nip01/dostr_nip01.dart';

Future<void> main() async {
  final signer = Bip340SignerFactory().createWithNewKeyPair();

  final event = await signer.sign(
    Nip01Event(
      pubkey: signer.publicKey,
      kind: 1,
      tags: [],
      content: 'hello nostr',
    ),
  );

  final valid = await Bip340EventVerifier().verify(event);
  print('${event.id} signed, valid: $valid');

  await signer.dispose();
}
0
likes
160
points
--
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Pure Dart BIP-340 Schnorr signing and verification for Nostr, with a signer and an event verifier.

Repository (GitHub)
View/report issues

Topics

#nostr #dostr #schnorr

License

MIT (license)

Dependencies

dostr_nip01, dostr_nip44, dostr_secp256k1, dostr_signer

More

Packages that depend on dostr_bip340