Interface IFeeWallet
- Namespace
- NArk.Abstractions.Blockchain
- Assembly
- NArk.Abstractions.dll
Provides confirmed on-chain UTXOs and signing capability for fee funding. Used by CPFP child transactions during unilateral exit broadcasting.
Host applications implement this to connect to their on-chain wallet:
- BTCPay Server: uses the store's on-chain wallet (signs internally)
- HSM / hardware-wallet integrations: never expose raw keys
- Standalone apps with an in-memory key: see TestFeeWallet for the pattern
The contract is sighash-callback shaped (mirroring
Sign(OutputDescriptor, uint256, CancellationToken)) — the SDK never sees the
underlying signing material. Implementations can sign with a raw Key,
proxy to a hardware wallet, call out to a remote signer, or delegate to
BTCPay's own wallet manager; the choice is opaque to the SDK.
public interface IFeeWallet
Methods
GetChangeScriptAsync(CancellationToken)
Gets a script for receiving change from CPFP child transactions.
Task<Script> GetChangeScriptAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
- Task<Script>
SelectFeeUtxoAsync(Money, CancellationToken)
Selects a confirmed on-chain UTXO with at least minAmount value
to fund CPFP child transaction fees. Returns NBitcoin's standard NBitcoin.ICoin
shape (outpoint + previous output) — no signing material is exposed; signing is
requested separately via SignFeeUtxoAsync(OutPoint, uint256, TaprootSigHash, CancellationToken).
Task<ICoin?> SelectFeeUtxoAsync(Money minAmount, CancellationToken cancellationToken = default)
Parameters
minAmountMoneycancellationTokenCancellationToken
Returns
- Task<ICoin>
A coin suitable for funding fees, or null if no UTXO meets the threshold. Implementations may return any NBitcoin.ICoin subtype (a plain NBitcoin.Coin, a NBitcoin.ScriptCoin for future script-path fee inputs, etc.).
SignFeeUtxoAsync(OutPoint, uint256, TaprootSigHash, CancellationToken)
Signs a P2TR keypath spend of a previously-selected fee UTXO. The SDK computes the sighash (using the standard taproot algorithm with all prevouts) and asks the wallet to return a Schnorr signature over it — without ever requiring the wallet to surface its private key.
Task<SecpSchnorrSignature> SignFeeUtxoAsync(OutPoint feeOutpoint, uint256 sighash, TaprootSigHash sighashType, CancellationToken cancellationToken = default)
Parameters
feeOutpointOutPointThe fee UTXO being spent. Used by wallets that hold multiple keys to disambiguate which signing material to use.
sighashuint256Precomputed taproot sighash.
sighashTypeTaprootSigHashSighash type (typically NBitcoin.TaprootSigHash.Default).
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<SecpSchnorrSignature>