SchnorrSignature class

Pure Dart implementation of Schnorr signatures (BIP-340).

Schnorr signatures are used by Bitcoin Taproot (P2TR) outputs and provide several advantages over ECDSA:

  • Smaller signature size (64 bytes vs 71-72 bytes)
  • Provable security under the random oracle model
  • Native support for signature aggregation (MuSig)

This implementation follows BIP-340 specification exactly.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

generateKeyPair() SchnorrKeyPair
Generates a new Schnorr key pair.
getPublicKey(Uint8List privateKey) Uint8List
Derives the x-only public key from a private key.
sign(Uint8List messageHash, Uint8List privateKey) Uint8List
Signs a 32-byte message hash with BIP-340 Schnorr signature.
tweakPublicKey(Uint8List publicKey, Uint8List tweak) Map<String, dynamic>?
Tweaks a public key according to BIP-341 (Taproot).
verify(Uint8List signature, Uint8List messageHash, Uint8List publicKey) bool
Verifies a BIP-340 Schnorr signature.