Package fr.acinq.lightning

Types

CltvExpiry
Link copied to clipboard
common
data class CltvExpiry(underlying: Long) : Comparable<CltvExpiry>

Bitcoin scripts (in particular HTLCs) need an absolute block expiry (greater than the current block count) to work with OP_CLTV.

CltvExpiryDelta
Link copied to clipboard
common
data class CltvExpiryDelta(underlying: Int) : Comparable<CltvExpiryDelta>

Channels advertise a cltv expiry delta that should be used when routing through them. This value needs to be converted to a [fr.acinq.lightning.CltvExpiry] to be used in OP_CLTV.

Feature
Link copied to clipboard
common
sealed class Feature
Features
Link copied to clipboard
common
data class Features(activated: Map<Feature, FeatureSupport>, unknown: Set<UnknownFeature>)
FeatureScope
Link copied to clipboard
common
enum FeatureScope : Enum<FeatureScope>

Feature scope as defined in Bolt 9.

FeatureSupport
Link copied to clipboard
common
enum FeatureSupport : Enum<FeatureSupport>
InvoiceDefaultRoutingFees
Link copied to clipboard
common
data class InvoiceDefaultRoutingFees(feeBase: MilliSatoshi, feeProportional: Long, cltvExpiryDelta: CltvExpiryDelta)

When we create an invoice, we need to add a routing hint since we only have private channels. This routing hint contains routing fees that should be paid by the sender, set by our peer. When we have a channel, we'll take them from our peer's channel update, but when we don't have any channel we'll use these default values.

Lightning
Link copied to clipboard
common
object Lightning
MilliSatoshi
Link copied to clipboard
common
data class MilliSatoshi(msat: Long) : Comparable<MilliSatoshi>

One MilliSatoshi is a thousand of a Satoshi, the smallest unit usable in bitcoin

NodeParams
Link copied to clipboard
common
data class NodeParams(keyManager: KeyManager, alias: String, features: Features, dustLimit: Satoshi, maxRemoteDustLimit: Satoshi, onChainFeeConf: OnChainFeeConf, maxHtlcValueInFlightMsat: Long, maxAcceptedHtlcs: Int, expiryDeltaBlocks: CltvExpiryDelta, fulfillSafetyBeforeTimeoutBlocks: CltvExpiryDelta, checkHtlcTimeoutAfterStartupDelaySeconds: Int, htlcMinimum: MilliSatoshi, toRemoteDelayBlocks: CltvExpiryDelta, maxToLocalDelayBlocks: CltvExpiryDelta, minDepthBlocks: Int, feeBase: MilliSatoshi, feeProportionalMillionth: Int, reserveToFundingRatio: Double, maxReserveToFundingRatio: Double, revocationTimeoutSeconds: Long, authTimeoutSeconds: Long, initTimeoutSeconds: Long, pingIntervalSeconds: Long, pingTimeoutSeconds: Long, pingDisconnect: Boolean, autoReconnect: Boolean, initialRandomReconnectDelaySeconds: Long, maxReconnectIntervalSeconds: Long, chainHash: ByteVector32, channelFlags: Byte, paymentRequestExpirySeconds: Long, multiPartPaymentExpirySeconds: Long, minFundingSatoshis: Satoshi, maxFundingSatoshis: Satoshi, maxPaymentAttempts: Int, enableTrampolinePayment: Boolean)
NodeUri
Link copied to clipboard
common
data class NodeUri(id: PublicKey, host: String, port: Int)
ShortChannelId
Link copied to clipboard
common
data class ShortChannelId(id: Long) : Comparable<ShortChannelId>
TrampolineFees
Link copied to clipboard
common
data class TrampolineFees(feeBase: Satoshi, feeProportional: Long, cltvExpiryDelta: CltvExpiryDelta)

When we send a trampoline payment, we start with a low fee. If that fails, we increase the fee(s) and retry (up to a point). This class encapsulates the fees and expiry to use at a particular attempt.

TxCoordinates
Link copied to clipboard
common
data class TxCoordinates(blockHeight: Int, txIndex: Int, outputIndex: Int)
UnknownFeature
Link copied to clipboard
common
data class UnknownFeature(bitIndex: Int)
WalletParams
Link copied to clipboard
common
data class WalletParams(trampolineNode: NodeUri, trampolineFees: List<TrampolineFees>, invoiceDefaultRoutingFees: InvoiceDefaultRoutingFees)