MuSig2Api class abstract interface

BIP-327 MuSig2 — public factory returns BuResult only.

Implementers

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

aggPublicKeys(List<List<int>> keys) → Secp256k1Point
Aggregates public keys for MuSig2 Aggregates non-empty keys (each 33-byte compressed secp256k1) with key-agg coefficients into the aggregate point. Throws on empty or malformed input.
deterministicSign({required List<int> sk, required List<int> aggotherNonce, required List<List<int>> publicKeys, List<MuSig2Tweak> tweaks = const [], required List<int> msg, List<int>? rand}) → MuSig2DeterministicSignature
Generates a deterministic MuSig2 signature Derives a nonce deterministically from 32-byte sk, 66-byte aggotherNonce and msg, aggregates it with publicKeys/tweaks into a session and partial-signs it. Optional rand overrides the nonce randomness. Returns the partial signature with its 66-byte pubnonce. Throws on invalid input.
keyAggAndTweak({required List<List<int>> publicKeys, required List<MuSig2Tweak> tweaks}) → Secp256k1Point
Aggregates non-empty publicKeys and applies tweaks; returns the tweaked aggregate point. Throws on empty or malformed input.
nonceAgg(List<List<int>> pubnonces) → BuBytes
Aggregates non-empty pubnonces (each 66 bytes) into a 66-byte aggregate nonce. Throws on empty or malformed input.
nonceGenerate({required List<int> publicKey, List<int>? rand, List<int>? sk, List<int>? aggPubKey, List<int>? msg, List<int>? extra}) → MuSig2Nonce
Generates a MuSig2 nonce for signing publicKey is 33 bytes (compressed); optional 32-byte rand (random if null) and 32-byte sk (binds nonce to key); aggPubKey, msg and extra bind the nonce hash. Returns the 97-byte secret nonce with its 66-byte public nonce. Throws on invalid lengths.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
partialSigAgg({required List<List<int>> signatures, required MuSig2Session session}) → BuBytes
Aggregates MuSig2 partial signatures Sums non-empty 32-byte partial signatures for session and adds the tweak accumulator; returns 64-byte R_x || s. Throws on empty or out-of-range signatures.
partialSigVerify({required List<int> signature, required List<int> pubnonce, required List<int> pk, required MuSig2Session session}) → bool
Verifies a MuSig2 partial signature Verifies 32-byte partial signature from signer pk with 66-byte pubnonce against session. Returns false if the equation fails; throws on malformed lengths or keys.
sign({required List<int> secnonce, required List<int> sk, required MuSig2Session session}) → BuBytes
Generates a MuSig2 partial signature Creates a 32-byte partial signature with 32-byte sk and 97-byte secnonce for session; secnonce must embed the signer's public key. Throws on invalid nonce/key or failed self-verification.
sortPublicKeys(List<List<int>> keys) → List<BuBytes>
sort public keys Sorts keys (each 33-byte compressed) in ascending lexicographic byte order. Throws on malformed keys.
toString() → String
A string representation of this object.
inherited
verifyAggregate({required List<int> message, required List<int> signature, required List<int> aggXOnly}) → bool
Verifies 64-byte Schnorr signature over message against 32-byte aggXOnly. Returns false if invalid; throws on malformed lengths.

Operators

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