Table of Contents

Class P2ACpfpBuilder

Namespace
NArk.Core.Exit
Assembly
NArk.Core.dll

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

parent Transaction

The parent transaction containing a P2A anchor output.

targetFeeRate FeeRate

Target fee rate for the package (parent + child combined).

feeCoin ICoin

A confirmed wallet UTXO to fund the fees, as returned by SelectFeeUtxoAsync(Money, CancellationToken). Carries the outpoint + previous output via NBitcoin's standard NBitcoin.ICoin.

changeScript Script

Script for change output.

feeWallet IFeeWallet

Fee wallet that produced feeCoin and signs for it.

cancellationToken CancellationToken

Cancellation 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

tx Transaction

Returns

(OutPoint Outpoint, TxOut TxOut)?