Table of Contents

Class CommitmentTransactionModel

Namespace
NLightning.Domain.Bitcoin.Transactions.Models
Assembly
NLightning.Domain.dll

Represents a commitment transaction in the domain model. This class encapsulates the logical structure of a Lightning Network commitment transaction as defined by BOLT specifications, without dependencies on specific Bitcoin libraries.

public class CommitmentTransactionModel
Inheritance
CommitmentTransactionModel
Inherited Members

Constructors

CommitmentTransactionModel(CommitmentNumber, LightningMoney, FundingOutputInfo, AnchorOutputInfo?, AnchorOutputInfo?, ToLocalOutputInfo?, ToRemoteOutputInfo?, IEnumerable<OfferedHtlcOutputInfo>?, IEnumerable<ReceivedHtlcOutputInfo>?)

Creates a new instance of CommitmentTransactionModel.

public CommitmentTransactionModel(CommitmentNumber commitmentNumber, LightningMoney fee, FundingOutputInfo fundingOutput, AnchorOutputInfo? localAnchorOutput = null, AnchorOutputInfo? remoteAnchorOutput = null, ToLocalOutputInfo? toLocalOutput = null, ToRemoteOutputInfo? toRemoteOutput = null, IEnumerable<OfferedHtlcOutputInfo>? offeredHtlcOutputs = null, IEnumerable<ReceivedHtlcOutputInfo>? receivedHtlcOutputs = null)

Parameters

commitmentNumber CommitmentNumber
fee LightningMoney
fundingOutput FundingOutputInfo
localAnchorOutput AnchorOutputInfo
remoteAnchorOutput AnchorOutputInfo
toLocalOutput ToLocalOutputInfo
toRemoteOutput ToRemoteOutputInfo
offeredHtlcOutputs IEnumerable<OfferedHtlcOutputInfo>
receivedHtlcOutputs IEnumerable<ReceivedHtlcOutputInfo>

Properties

CommitmentNumber

Gets the commitment number for this transaction.

public CommitmentNumber CommitmentNumber { get; }

Property Value

CommitmentNumber

Fee

Gets the total fee for this transaction.

public LightningMoney Fee { get; }

Property Value

LightningMoney

FundingOutput

Gets the funding outpoint that this commitment transaction spends.

public FundingOutputInfo FundingOutput { get; }

Property Value

FundingOutputInfo

LocalAnchorOutput

Gets the local anchor output, if present.

public AnchorOutputInfo? LocalAnchorOutput { get; }

Property Value

AnchorOutputInfo

OfferedHtlcOutputs

Gets the list of offered HTLC outputs.

public IReadOnlyList<OfferedHtlcOutputInfo> OfferedHtlcOutputs { get; }

Property Value

IReadOnlyList<OfferedHtlcOutputInfo>

ReceivedHtlcOutputs

Gets the list of received HTLC outputs.

public IReadOnlyList<ReceivedHtlcOutputInfo> ReceivedHtlcOutputs { get; }

Property Value

IReadOnlyList<ReceivedHtlcOutputInfo>

RemoteAnchorOutput

Gets the remote anchor output, if present.

public AnchorOutputInfo? RemoteAnchorOutput { get; }

Property Value

AnchorOutputInfo

ToLocalOutput

Gets the to_local output, if present.

public ToLocalOutputInfo? ToLocalOutput { get; }

Property Value

ToLocalOutputInfo

ToRemoteOutput

Gets the to_remote output, if present.

public ToRemoteOutputInfo? ToRemoteOutput { get; }

Property Value

ToRemoteOutputInfo

TransactionId

Gets or sets the transaction ID after the transaction is constructed.

public TxId? TransactionId { get; set; }

Property Value

TxId?

Methods

GetAllOutputs()

Gets all outputs of this commitment transaction.

public IEnumerable<IOutputInfo> GetAllOutputs()

Returns

IEnumerable<IOutputInfo>

GetLockTime()

Gets the Bitcoin locktime for this commitment transaction, derived from the commitment number.

public BitcoinLockTime GetLockTime()

Returns

BitcoinLockTime

GetSequence()

Gets the Bitcoin sequence for this commitment transaction, derived from the commitment number.

public BitcoinSequence GetSequence()

Returns

BitcoinSequence