NativeMuSig2Api class
MuSig2Api backed by a native (FFI/platform) implementation.
- Implemented types
Constructors
- NativeMuSig2Api(BuMusig2Api api)
-
const
Properties
- api → BuMusig2Api
-
final
- 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< keys) → Secp256k1Pointint> > -
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.override -
deterministicSign(
{required List< int> sk, required List<int> aggotherNonce, required List<List< publicKeys, List<int> >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-byteaggotherNonceandmsg, aggregates it withpublicKeys/tweaksinto a session and partial-signs it. Optionalrandoverrides the nonce randomness. Returns the partial signature with its 66-byte pubnonce. Throws on invalid input.override -
keyAggAndTweak(
{required List< List< publicKeys, required List<int> >MuSig2Tweak> tweaks}) → Secp256k1Point -
Aggregates non-empty
publicKeysand appliestweaks; returns the tweaked aggregate point. Throws on empty or malformed input.override -
nonceAgg(
List< List< pubnonces) → BuBytesint> > -
Aggregates non-empty
pubnonces(each 66 bytes) into a 66-byte aggregate nonce. Throws on empty or malformed input.override -
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
publicKeyis 33 bytes (compressed); optional 32-byterand(random if null) and 32-bytesk(binds nonce to key);aggPubKey,msgandextrabind the nonce hash. Returns the 97-byte secret nonce with its 66-byte public nonce. Throws on invalid lengths.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
partialSigAgg(
{required List< List< signatures, required MuSig2Session session}) → BuBytesint> > -
Aggregates MuSig2 partial signatures
Sums non-empty 32-byte partial
signaturesforsessionand adds the tweak accumulator; returns 64-byteR_x || s. Throws on empty or out-of-range signatures.override -
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
signaturefrom signerpkwith 66-bytepubnonceagainstsession. Returns false if the equation fails; throws on malformed lengths or keys.override -
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
skand 97-bytesecnonceforsession;secnoncemust embed the signer's public key. Throws on invalid nonce/key or failed self-verification.override -
sortPublicKeys(
List< List< keys) → List<int> >BuBytes> -
sort public keys
Sorts
keys(each 33-byte compressed) in ascending lexicographic byte order. Throws on malformed keys.override -
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
signatureovermessageagainst 32-byteaggXOnly. Returns false if invalid; throws on malformed lengths.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited