Class P2ACpfpBuilder
Builds v3 CPFP child transactions that spend P2A anchor outputs, enabling 1p1c package relay for Ark virtual tree transactions.
public static class P2ACpfpBuilder
- Inheritance
-
P2ACpfpBuilder
- Inherited Members
Methods
BuildCpfpChildAsync(Transaction, FeeRate, ICoin, Script, IFeeWallet, CancellationToken)
Build a v3 CPFP child transaction that spends the P2A anchor output and provides fees for the entire 1p1c package.
public static Task<Transaction> BuildCpfpChildAsync(Transaction parent, FeeRate targetFeeRate, ICoin feeCoin, Script changeScript, IFeeWallet feeWallet, CancellationToken cancellationToken = default)
Parameters
parentTransactionThe parent transaction containing a P2A anchor output.
targetFeeRateFeeRateTarget fee rate for the package (parent + child combined).
feeCoinICoinA confirmed wallet UTXO to fund the fees, as returned by SelectFeeUtxoAsync(Money, CancellationToken). Carries the outpoint + previous output via NBitcoin's standard NBitcoin.ICoin.
changeScriptScriptScript for change output.
feeWalletIFeeWalletFee wallet that produced
feeCoinand signs for it.cancellationTokenCancellationTokenCancellation token forwarded to the wallet's signing call.
Returns
- Task<Transaction>
The signed CPFP child transaction.
Remarks
Signing the fee input is delegated to feeWallet via
SignFeeUtxoAsync(OutPoint, uint256, TaprootSigHash, CancellationToken) — the builder never sees the
underlying signing material. Hardware wallets, HSMs, remote signers,
and BTCPay-style internal signing all work without modification.
FindP2AAnchor(Transaction)
Find the P2A anchor output in a transaction. Checks for both BIP 431 standard P2A and Ark protocol marker.
public static (OutPoint Outpoint, TxOut TxOut)? FindP2AAnchor(Transaction tx)
Parameters
txTransaction