Table of Contents

Interface IDescriptorSigningSource

Namespace
NArk.Abstractions.Wallets
Assembly
NArk.Abstractions.dll

A descriptor-scoped source of signing operations. The source owns signing material (locally or by reference) and exposes operations rooted in it — it never returns the raw key, which is what lets a remote-signing implementation honour the same contract.

A wallet's signer is a composition of one or more signing sources (see IArkadeWalletSigner implementations that compose sources). Each source answers CanProvideAsync(OutputDescriptor, CancellationToken) for the descriptors it covers; the composing signer dispatches each call to the first source that claims the descriptor.

The MuSig2 nonce lifecycle from IArkadeWalletSigner applies per-source: GenerateNoncesAsync(OutputDescriptor, MusigContext, string, CancellationToken) retains the secret half indexed by sessionId, and SignMusigAsync(OutputDescriptor, MusigContext, string, CancellationToken) consumes it on use. Different sources maintain independent nonce stores — there is no cross-source sharing.

public interface IDescriptorSigningSource

Methods

CanProvideAsync(OutputDescriptor, CancellationToken)

Returns true iff this source can sign for descriptor. Implementations should make this cheap (fingerprint / x-only match) — it is called on every dispatch and may run against the BIP-32 / BIP-39 derivation path of long descriptors.

Task<bool> CanProvideAsync(OutputDescriptor descriptor, CancellationToken cancellationToken = default)

Parameters

descriptor OutputDescriptor
cancellationToken CancellationToken

Returns

Task<bool>

GenerateNoncesAsync(OutputDescriptor, MusigContext, string, CancellationToken)

Generates a fresh MuSig2 nonce pair for context, retains the secret half indexed by sessionId, and returns the public half. See GenerateNonces(OutputDescriptor, MusigContext, string, CancellationToken) for the lifecycle contract.

Task<MusigPubNonce> GenerateNoncesAsync(OutputDescriptor descriptor, MusigContext context, string sessionId, CancellationToken cancellationToken = default)

Parameters

descriptor OutputDescriptor
context MusigContext
sessionId string
cancellationToken CancellationToken

Returns

Task<MusigPubNonce>

GetPubKeyAsync(OutputDescriptor, CancellationToken)

Gets the compressed public key for descriptor, preserving parity.

Task<ECPubKey> GetPubKeyAsync(OutputDescriptor descriptor, CancellationToken cancellationToken = default)

Parameters

descriptor OutputDescriptor
cancellationToken CancellationToken

Returns

Task<ECPubKey>

SignAsync(OutputDescriptor, uint256, CancellationToken)

Produces a BIP-340 Schnorr signature over hash using the descriptor's private key, returning the x-only pubkey alongside the signature.

Task<(ECXOnlyPubKey, SecpSchnorrSignature)> SignAsync(OutputDescriptor descriptor, uint256 hash, CancellationToken cancellationToken = default)

Parameters

descriptor OutputDescriptor
hash uint256
cancellationToken CancellationToken

Returns

Task<(ECXOnlyPubKey, SecpSchnorrSignature)>

SignMusigAsync(OutputDescriptor, MusigContext, string, CancellationToken)

Produces a MuSig2 partial signature using the secret nonce generated for the same sessionId. The secret nonce is consumed on this call. See SignMusig(OutputDescriptor, MusigContext, string, CancellationToken) for the lifecycle contract.

Task<MusigPartialSignature> SignMusigAsync(OutputDescriptor descriptor, MusigContext context, string sessionId, CancellationToken cancellationToken = default)

Parameters

descriptor OutputDescriptor
context MusigContext
sessionId string
cancellationToken CancellationToken

Returns

Task<MusigPartialSignature>