DotNetLightning


Transactions Module

This module contains a functions to work with LN-specific transactions.

Nested modules

Modules Description

Constants

Functions and values

Function or value Description

UINT32_MAX

Full Usage: UINT32_MAX

Returns: uint32
Returns: uint32

checkSigAndAdd tx signature pk

Full Usage: checkSigAndAdd tx signature pk

Parameters:
Returns: Result<ILightningTx, TransactionError>
tx : ILightningTx
signature : TransactionSignature
pk : PubKey
Returns: Result<ILightningTx, TransactionError>

checkTxFinalized psbt inputIndex additionalKnownSigs

Full Usage: checkTxFinalized psbt inputIndex additionalKnownSigs

Parameters:
Returns: Result<FinalizedTx, TransactionError>
psbt : PSBT
inputIndex : int
additionalKnownSigs : seq<PubKey * TransactionSignature>
Returns: Result<FinalizedTx, TransactionError>

getCommitTxNumber commitTx isFunder localPaymentBasepoint remotePaymentBasepoint

Full Usage: getCommitTxNumber commitTx isFunder localPaymentBasepoint remotePaymentBasepoint

Parameters:
Returns: Option<CommitmentNumber>
commitTx : Transaction
isFunder : bool
localPaymentBasepoint : PaymentBasepoint
remotePaymentBasepoint : PaymentBasepoint
Returns: Option<CommitmentNumber>

makeClaimHTLCSuccessTx commitTx localDustLimit localHTLCPubKey remoteHTLCPubKey remoteRevocationPubKey localFinalScriptPubKey htlc feeRatePerKw network

Full Usage: makeClaimHTLCSuccessTx commitTx localDustLimit localHTLCPubKey remoteHTLCPubKey remoteRevocationPubKey localFinalScriptPubKey htlc feeRatePerKw network

Parameters:
Returns: Result<ClaimHTLCSuccessTx, TransactionError>
commitTx : Transaction
localDustLimit : Money
localHTLCPubKey : HtlcPubKey
remoteHTLCPubKey : HtlcPubKey
remoteRevocationPubKey : RevocationPubKey
localFinalScriptPubKey : Script
htlc : UpdateAddHTLCMsg
feeRatePerKw : FeeRatePerKw
network : Network
Returns: Result<ClaimHTLCSuccessTx, TransactionError>

makeClaimHTLCTimeoutTx commitTx localDustLimit localHTLCPubKey remoteHTLCPubKey remoteRevocationPubKey localFinalScriptPubKey htlc feeRatePerKw network

Full Usage: makeClaimHTLCTimeoutTx commitTx localDustLimit localHTLCPubKey remoteHTLCPubKey remoteRevocationPubKey localFinalScriptPubKey htlc feeRatePerKw network

Parameters:
Returns: Result<ClaimHTLCTimeoutTx, TransactionError>
commitTx : Transaction
localDustLimit : Money
localHTLCPubKey : HtlcPubKey
remoteHTLCPubKey : HtlcPubKey
remoteRevocationPubKey : RevocationPubKey
localFinalScriptPubKey : Script
htlc : UpdateAddHTLCMsg
feeRatePerKw : FeeRatePerKw
network : Network
Returns: Result<ClaimHTLCTimeoutTx, TransactionError>

makeClosingTx commitTxInput localDestination remoteDestination localIsFunder dustLimit closingFee spec network

Full Usage: makeClosingTx commitTxInput localDestination remoteDestination localIsFunder dustLimit closingFee spec network

Parameters:
Returns: Result<ClosingTx, TransactionError>
commitTxInput : ScriptCoin
localDestination : ShutdownScriptPubKey
remoteDestination : ShutdownScriptPubKey
localIsFunder : bool
dustLimit : Money
closingFee : Money
spec : CommitmentSpec
network : Network
Returns: Result<ClosingTx, TransactionError>

makeCommitTx inputInfo commitmentNumber localPaymentBasepoint remotePaymentBasepoint localIsFunder localDustLimit localRevocationPubKey toLocalDelay localDelayedPaymentPubKey remotePaymentPubkey localHTLCPubKey remoteHTLCPubkey spec network

Full Usage: makeCommitTx inputInfo commitmentNumber localPaymentBasepoint remotePaymentBasepoint localIsFunder localDustLimit localRevocationPubKey toLocalDelay localDelayedPaymentPubKey remotePaymentPubkey localHTLCPubKey remoteHTLCPubkey spec network

Parameters:
Returns: CommitTx
inputInfo : ScriptCoin
commitmentNumber : CommitmentNumber
localPaymentBasepoint : PaymentBasepoint
remotePaymentBasepoint : PaymentBasepoint
localIsFunder : bool
localDustLimit : Money
localRevocationPubKey : RevocationPubKey
toLocalDelay : BlockHeightOffset16
localDelayedPaymentPubKey : DelayedPaymentPubKey
remotePaymentPubkey : PaymentPubKey
localHTLCPubKey : HtlcPubKey
remoteHTLCPubkey : HtlcPubKey
spec : CommitmentSpec
network : Network
Returns: CommitTx

makeHTLCPenaltyTx _commitTx _localDustLimit

Full Usage: makeHTLCPenaltyTx _commitTx _localDustLimit

Parameters:
Returns: HTLCPenaltyTx
_commitTx : Transaction
_localDustLimit : Money
Returns: HTLCPenaltyTx

makeHTLCSuccessTx commitTx localDustLimit localRevocationPubKey toLocalDelay localDelayedPaymentPubKey localHTLCPubKey remoteHTLCPubKey feeratePerKw htlc network

Full Usage: makeHTLCSuccessTx commitTx localDustLimit localRevocationPubKey toLocalDelay localDelayedPaymentPubKey localHTLCPubKey remoteHTLCPubKey feeratePerKw htlc network

Parameters:
Returns: Result<HTLCSuccessTx, TransactionError>
commitTx : Transaction
localDustLimit : Money
localRevocationPubKey : RevocationPubKey
toLocalDelay : BlockHeightOffset16
localDelayedPaymentPubKey : DelayedPaymentPubKey
localHTLCPubKey : HtlcPubKey
remoteHTLCPubKey : HtlcPubKey
feeratePerKw : FeeRatePerKw
htlc : UpdateAddHTLCMsg
network : Network
Returns: Result<HTLCSuccessTx, TransactionError>

makeHTLCTimeoutTx commitTx localDustLimit localRevocationPubKey toLocalDelay localDelayedPaymentPubKey localHTLCPubKey remoteHTLCPubKey feeratePerKw htlc network

Full Usage: makeHTLCTimeoutTx commitTx localDustLimit localRevocationPubKey toLocalDelay localDelayedPaymentPubKey localHTLCPubKey remoteHTLCPubKey feeratePerKw htlc network

Parameters:
Returns: Result<HTLCTimeoutTx, TransactionError>
commitTx : Transaction
localDustLimit : Money
localRevocationPubKey : RevocationPubKey
toLocalDelay : BlockHeightOffset16
localDelayedPaymentPubKey : DelayedPaymentPubKey
localHTLCPubKey : HtlcPubKey
remoteHTLCPubKey : HtlcPubKey
feeratePerKw : FeeRatePerKw
htlc : UpdateAddHTLCMsg
network : Network
Returns: Result<HTLCTimeoutTx, TransactionError>

makeHTLCTxs commitTx localDustLimit localRevocationPubKey toLocalDelay toLocalDelayedPaymentPubKey localHTLCPubKey remoteHTLCPubKey spec network

Full Usage: makeHTLCTxs commitTx localDustLimit localRevocationPubKey toLocalDelay toLocalDelayedPaymentPubKey localHTLCPubKey remoteHTLCPubKey spec network

Parameters:
Returns: Result<(HTLCTimeoutTx list * HTLCSuccessTx list), TransactionError list>
commitTx : Transaction
localDustLimit : Money
localRevocationPubKey : RevocationPubKey
toLocalDelay : BlockHeightOffset16
toLocalDelayedPaymentPubKey : DelayedPaymentPubKey
localHTLCPubKey : HtlcPubKey
remoteHTLCPubKey : HtlcPubKey
spec : CommitmentSpec
network : Network
Returns: Result<(HTLCTimeoutTx list * HTLCSuccessTx list), TransactionError list>

makeMainPenaltyTx commitTx localDustLimit remoteRevocationKey localFinalDestination toRemoteDelay remoteDelayedPaymentPubKey feeRatePerKw network

Full Usage: makeMainPenaltyTx commitTx localDustLimit remoteRevocationKey localFinalDestination toRemoteDelay remoteDelayedPaymentPubKey feeRatePerKw network

Parameters:
Returns: Result<MainPenaltyTx, TransactionError>
commitTx : Transaction
localDustLimit : Money
remoteRevocationKey : RevocationPubKey
localFinalDestination : IDestination
toRemoteDelay : BlockHeightOffset16
remoteDelayedPaymentPubKey : DelayedPaymentPubKey
feeRatePerKw : FeeRatePerKw
network : Network
Returns: Result<MainPenaltyTx, TransactionError>

sign (tx, key)

Full Usage: sign (tx, key)

Parameters:
Returns: TransactionSignature * ILightningTx
tx : ILightningTx
key : Key
Returns: TransactionSignature * ILightningTx

signCore (tx, key, enforceLowR)

Full Usage: signCore (tx, key, enforceLowR)

Parameters:
Returns: TransactionSignature * ILightningTx

Sign psbt inside ILightningTx and returns 1. Newly created signature 2. ILightningTx updated Technically speaking, we could just return one of them. Returning both is just for ergonomic reason. (pretending to be referential transparent)

tx : ILightningTx
key : Key
enforceLowR : bool
Returns: TransactionSignature * ILightningTx

sortTxOut txOutsWithMeta

Full Usage: sortTxOut txOutsWithMeta

Parameters:
Returns: TxOut list

Sort by BOLT 3: Compliant way (i.e. BIP69 + CLTV order)

txOutsWithMeta : (TxOut * Option<UpdateAddHTLCMsg>) list
Returns: TxOut list