Package fr.acinq.lightning.wire

Types

AcceptChannel
Link copied to clipboard
common
data class AcceptChannel(temporaryChannelId: ByteVector32, dustLimitSatoshis: Satoshi, maxHtlcValueInFlightMsat: Long, channelReserveSatoshis: Satoshi, htlcMinimumMsat: MilliSatoshi, minimumDepth: Long, toSelfDelay: CltvExpiryDelta, maxAcceptedHtlcs: Int, fundingPubkey: PublicKey, revocationBasepoint: PublicKey, paymentBasepoint: PublicKey, delayedPaymentBasepoint: PublicKey, htlcBasepoint: PublicKey, firstPerCommitmentPoint: PublicKey, tlvStream: TlvStream<ChannelTlv>) : ChannelMessage, HasTemporaryChannelId
AmountBelowMinimum
Link copied to clipboard
common
data class AmountBelowMinimum(amount: MilliSatoshi, update: ChannelUpdate) : FailureMessage, Update
AnnouncementMessage
Link copied to clipboard
common
interface AnnouncementMessage : RoutingMessage
AnnouncementSignatures
Link copied to clipboard
common
data class AnnouncementSignatures(channelId: ByteVector32, shortChannelId: ShortChannelId, nodeSignature: ByteVector64, bitcoinSignature: ByteVector64) : RoutingMessage, HasChannelId
BadOnion
Link copied to clipboard
common
interface BadOnion
ChannelAnnouncement
Link copied to clipboard
common
data class ChannelAnnouncement(nodeSignature1: ByteVector64, nodeSignature2: ByteVector64, bitcoinSignature1: ByteVector64, bitcoinSignature2: ByteVector64, features: Features, chainHash: ByteVector32, shortChannelId: ShortChannelId, nodeId1: PublicKey, nodeId2: PublicKey, bitcoinKey1: PublicKey, bitcoinKey2: PublicKey, unknownFields: ByteVector) : AnnouncementMessage, HasChainHash
ChannelDisabled
Link copied to clipboard
common
data class ChannelDisabled(messageFlags: Byte, channelFlags: Byte, update: ChannelUpdate) : FailureMessage, Update
ChannelMessage
Link copied to clipboard
common
interface ChannelMessage
ChannelReestablish
Link copied to clipboard
common
data class ChannelReestablish(channelId: ByteVector32, nextLocalCommitmentNumber: Long, nextRemoteRevocationNumber: Long, yourLastCommitmentSecret: PrivateKey, myCurrentPerCommitmentPoint: PublicKey, tlvStream: TlvStream<ChannelReestablishTlv>) : HasChannelId, HasEncryptedChannelData
ChannelReestablishTlv
Link copied to clipboard
common
sealed class ChannelReestablishTlv : Tlv
ChannelTlv
Link copied to clipboard
common
sealed class ChannelTlv : Tlv
ChannelUpdate
Link copied to clipboard
common
data class ChannelUpdate(signature: ByteVector64, chainHash: ByteVector32, shortChannelId: ShortChannelId, timestampSeconds: Long, messageFlags: Byte, channelFlags: Byte, cltvExpiryDelta: CltvExpiryDelta, htlcMinimumMsat: MilliSatoshi, feeBaseMsat: MilliSatoshi, feeProportionalMillionths: Long, htlcMaximumMsat: MilliSatoshi?, unknownFields: ByteVector) : AnnouncementMessage, HasTimestamp, HasChainHash
ClosingSigned
Link copied to clipboard
common
data class ClosingSigned(channelId: ByteVector32, feeSatoshis: Satoshi, signature: ByteVector64, tlvStream: TlvStream<ClosingSignedTlv>) : ChannelMessage, HasChannelId, HasEncryptedChannelData
ClosingSignedTlv
Link copied to clipboard
common
sealed class ClosingSignedTlv : Tlv
CommitSig
Link copied to clipboard
common
data class CommitSig(channelId: ByteVector32, signature: ByteVector64, htlcSignatures: List<ByteVector64>, tlvStream: TlvStream<CommitSigTlv>) : HtlcMessage, HasChannelId, HasEncryptedChannelData
CommitSigTlv
Link copied to clipboard
common
sealed class CommitSigTlv : Tlv
EncryptedChannelData
Link copied to clipboard
common
data class EncryptedChannelData(data: ByteVector)
Error
Link copied to clipboard
common
data class Error(channelId: ByteVector32, data: ByteVector) : SetupMessage, HasChannelId
ExpiryTooFar
Link copied to clipboard
common
object ExpiryTooFar : FailureMessage
ExpiryTooSoon
Link copied to clipboard
common
data class ExpiryTooSoon(update: ChannelUpdate) : FailureMessage, Update
FailureMessage
Link copied to clipboard
common
sealed class FailureMessage
FCMToken
Link copied to clipboard
common
data class FCMToken(token: ByteVector) : LightningMessage
FeeInsufficient
Link copied to clipboard
common
data class FeeInsufficient(amount: MilliSatoshi, update: ChannelUpdate) : FailureMessage, Update
FinalIncorrectCltvExpiry
Link copied to clipboard
common
data class FinalIncorrectCltvExpiry(expiry: CltvExpiry) : FailureMessage
FinalIncorrectHtlcAmount
Link copied to clipboard
common
data class FinalIncorrectHtlcAmount(amount: MilliSatoshi) : FailureMessage
FundingCreated
Link copied to clipboard
common
data class FundingCreated(temporaryChannelId: ByteVector32, fundingTxid: ByteVector32, fundingOutputIndex: Int, signature: ByteVector64) : ChannelMessage, HasTemporaryChannelId
FundingLocked
Link copied to clipboard
common
data class FundingLocked(channelId: ByteVector32, nextPerCommitmentPoint: PublicKey) : ChannelMessage, HasChannelId
FundingSigned
Link copied to clipboard
common
data class FundingSigned(channelId: ByteVector32, signature: ByteVector64, tlvStream: TlvStream<FundingSignedTlv>) : ChannelMessage, HasChannelId, HasEncryptedChannelData
FundingSignedTlv
Link copied to clipboard
common
sealed class FundingSignedTlv : Tlv
GenericTlv
Link copied to clipboard
common
data class GenericTlv(tag: Long, value: ByteVector) : Tlv

Generic tlv type we fallback to if we don't understand the incoming tlv.

HasChainHash
Link copied to clipboard
common
interface HasChainHash : LightningMessage
HasChannelId
Link copied to clipboard
common
interface HasChannelId : LightningMessage
HasEncryptedChannelData
Link copied to clipboard
common
interface HasEncryptedChannelData : LightningMessage
HasTemporaryChannelId
Link copied to clipboard
common
interface HasTemporaryChannelId : LightningMessage
HasTimestamp
Link copied to clipboard
common
interface HasTimestamp : LightningMessage
HtlcMessage
Link copied to clipboard
common
interface HtlcMessage : LightningMessage
HtlcSettlementMessage
Link copied to clipboard
common
interface HtlcSettlementMessage : UpdateMessage
IncorrectCltvExpiry
Link copied to clipboard
common
data class IncorrectCltvExpiry(expiry: CltvExpiry, update: ChannelUpdate) : FailureMessage, Update
IncorrectOrUnknownPaymentDetails
Link copied to clipboard
common
data class IncorrectOrUnknownPaymentDetails(amount: MilliSatoshi, height: Long) : FailureMessage, Perm
Init
Link copied to clipboard
common
data class Init(features: ByteVector, tlvs: TlvStream<InitTlv>) : SetupMessage
InitTlv
Link copied to clipboard
common
sealed class InitTlv : Tlv

Tlv types used inside Init messages.

InvalidOnionHmac
Link copied to clipboard
common
data class InvalidOnionHmac(onionHash: ByteVector32) : FailureMessage, BadOnion, Perm
InvalidOnionKey
Link copied to clipboard
common
data class InvalidOnionKey(onionHash: ByteVector32) : FailureMessage, BadOnion, Perm
InvalidOnionPayload
Link copied to clipboard
common
data class InvalidOnionPayload(tag: ULong, offset: Int) : FailureMessage, Perm
InvalidOnionVersion
Link copied to clipboard
common
data class InvalidOnionVersion(onionHash: ByteVector32) : FailureMessage, BadOnion, Perm
InvalidRealm
Link copied to clipboard
common
object InvalidRealm : FailureMessage, Perm
LightningCodecs
Link copied to clipboard
common
object LightningCodecs
LightningMessage
Link copied to clipboard
common
interface LightningMessage
LightningMessageReader
Link copied to clipboard
common
interface LightningMessageReader<T : LightningMessage>
Node
Link copied to clipboard
common
interface Node
OnionPaymentPayloadTlv
Link copied to clipboard
common
sealed class OnionPaymentPayloadTlv : Tlv
OnionRoutingPacket
Link copied to clipboard
common
data class OnionRoutingPacket(version: Int, publicKey: ByteVector, payload: ByteVector, hmac: ByteVector32)
OnionRoutingPacketSerializer
Link copied to clipboard
common
class OnionRoutingPacketSerializer(payloadLength: Int)
OpenChannel
Link copied to clipboard
common
data class OpenChannel(chainHash: ByteVector32, temporaryChannelId: ByteVector32, fundingSatoshis: Satoshi, pushMsat: MilliSatoshi, dustLimitSatoshis: Satoshi, maxHtlcValueInFlightMsat: Long, channelReserveSatoshis: Satoshi, htlcMinimumMsat: MilliSatoshi, feeratePerKw: FeeratePerKw, toSelfDelay: CltvExpiryDelta, maxAcceptedHtlcs: Int, fundingPubkey: PublicKey, revocationBasepoint: PublicKey, paymentBasepoint: PublicKey, delayedPaymentBasepoint: PublicKey, htlcBasepoint: PublicKey, firstPerCommitmentPoint: PublicKey, channelFlags: Byte, tlvStream: TlvStream<ChannelTlv>) : ChannelMessage, HasTemporaryChannelId, HasChainHash
PaymentOnion
Link copied to clipboard
common
object PaymentOnion
PaymentTimeout
Link copied to clipboard
common
object PaymentTimeout : FailureMessage
PayToOpenRequest
Link copied to clipboard
common
data class PayToOpenRequest(chainHash: ByteVector32, fundingSatoshis: Satoshi, amountMsat: MilliSatoshi, payToOpenMinAmountMsat: MilliSatoshi, payToOpenFeeSatoshis: Satoshi, paymentHash: ByteVector32, expireAt: Long, finalPacket: OnionRoutingPacket) : LightningMessage, HasChainHash

When we don't have enough incoming liquidity to receive a payment, our peer may open a channel to us on-the-fly to carry that payment. This message contains details that allow us to recalculate the fee that our peer will take in exchange for the new channel. This allows us to combine multiple requests for the same payment and figure out the final fee that will be applied.

PayToOpenResponse
Link copied to clipboard
common
data class PayToOpenResponse(chainHash: ByteVector32, paymentHash: ByteVector32, result: PayToOpenResponse.Result) : LightningMessage, HasChainHash
Perm
Link copied to clipboard
common
interface Perm
PermanentChannelFailure
Link copied to clipboard
common
object PermanentChannelFailure : FailureMessage, Perm
PermanentNodeFailure
Link copied to clipboard
common
object PermanentNodeFailure : FailureMessage, Perm, Node
PhoenixAndroidLegacyInfo
Link copied to clipboard
common
data class PhoenixAndroidLegacyInfo(hasChannels: Boolean) : LightningMessage
PhoenixAndroidLegacyMigrate
Link copied to clipboard
common
data class PhoenixAndroidLegacyMigrate(newNodeId: PublicKey) : LightningMessage
Ping
Link copied to clipboard
common
data class Ping(pongLength: Int, data: ByteVector) : SetupMessage
Pong
Link copied to clipboard
common
data class Pong(data: ByteVector) : SetupMessage
RequiredChannelFeatureMissing
Link copied to clipboard
common
object RequiredChannelFeatureMissing : FailureMessage, Perm
RequiredNodeFeatureMissing
Link copied to clipboard
common
object RequiredNodeFeatureMissing : FailureMessage, Perm, Node
RevokeAndAck
Link copied to clipboard
common
data class RevokeAndAck(channelId: ByteVector32, perCommitmentSecret: PrivateKey, nextPerCommitmentPoint: PublicKey, tlvStream: TlvStream<RevokeAndAckTlv>) : HtlcMessage, HasChannelId, HasEncryptedChannelData
RevokeAndAckTlv
Link copied to clipboard
common
sealed class RevokeAndAckTlv : Tlv
RoutingMessage
Link copied to clipboard
common
interface RoutingMessage : LightningMessage
SetupMessage
Link copied to clipboard
common
interface SetupMessage : LightningMessage
Shutdown
Link copied to clipboard
common
data class Shutdown(channelId: ByteVector32, scriptPubKey: ByteVector, tlvStream: TlvStream<ShutdownTlv>) : ChannelMessage, HasChannelId, HasEncryptedChannelData
ShutdownTlv
Link copied to clipboard
common
sealed class ShutdownTlv : Tlv
SwapInConfirmed
Link copied to clipboard
common
data class SwapInConfirmed(bitcoinAddress: String, amount: MilliSatoshi) : LightningMessage
SwapInPending
Link copied to clipboard
common
data class SwapInPending(bitcoinAddress: String, amount: Satoshi) : LightningMessage
SwapInRequest
Link copied to clipboard
common
data class SwapInRequest(chainHash: ByteVector32) : LightningMessage, HasChainHash
SwapInResponse
Link copied to clipboard
common
data class SwapInResponse(chainHash: ByteVector32, bitcoinAddress: String) : LightningMessage, HasChainHash
TemporaryChannelFailure
Link copied to clipboard
common
data class TemporaryChannelFailure(update: ChannelUpdate) : FailureMessage, Update
TemporaryNodeFailure
Link copied to clipboard
common
object TemporaryNodeFailure : FailureMessage, Node
Tlv
Link copied to clipboard
common
interface Tlv
TlvStream
Link copied to clipboard
common
data class TlvStream<T : Tlv>(records: List<T>, unknown: List<GenericTlv>)

A tlv stream is a collection of tlv records. A tlv stream is constrained to a specific tlv namespace that dictates how to parse the tlv records. That namespace is provided by a trait extending the top-level tlv trait.

TlvStreamSerializer
Link copied to clipboard
common
class TlvStreamSerializer<T : Tlv>(lengthPrefixed: Boolean, readers: Map<Long, TlvValueReader<T>>)
TlvValueReader
Link copied to clipboard
common
interface TlvValueReader<T : Tlv>
TrampolineExpiryTooSoon
Link copied to clipboard
common
object TrampolineExpiryTooSoon : FailureMessage, Node
TrampolineFeeInsufficient
Link copied to clipboard
common
object TrampolineFeeInsufficient : FailureMessage, Node
UnknownFailureMessage
Link copied to clipboard
common
data class UnknownFailureMessage(code: Int) : FailureMessage

We allow remote nodes to send us unknown failure codes (e.g. deprecated failure codes). By reading the PERM and NODE bits of the failure code we can still extract useful information for payment retry even without knowing how to decode the failure payload (but we can't extract a channel update or onion hash).

UnknownNextPeer
Link copied to clipboard
common
object UnknownNextPeer : FailureMessage, Perm
UnsetFCMToken
Link copied to clipboard
common
object UnsetFCMToken : LightningMessage
Update
Link copied to clipboard
common
interface Update
UpdateAddHtlc
Link copied to clipboard
common
data class UpdateAddHtlc(channelId: ByteVector32, id: Long, amountMsat: MilliSatoshi, paymentHash: ByteVector32, cltvExpiry: CltvExpiry, onionRoutingPacket: OnionRoutingPacket) : HtlcMessage, UpdateMessage, HasChannelId
UpdateFailHtlc
Link copied to clipboard
common
data class UpdateFailHtlc(channelId: ByteVector32, id: Long, reason: ByteVector) : HtlcMessage, HtlcSettlementMessage, HasChannelId
UpdateFailMalformedHtlc
Link copied to clipboard
common
data class UpdateFailMalformedHtlc(channelId: ByteVector32, id: Long, onionHash: ByteVector32, failureCode: Int) : HtlcMessage, HtlcSettlementMessage, HasChannelId
UpdateFee
Link copied to clipboard
common
data class UpdateFee(channelId: ByteVector32, feeratePerKw: FeeratePerKw) : ChannelMessage, UpdateMessage, HasChannelId
UpdateFulfillHtlc
Link copied to clipboard
common
data class UpdateFulfillHtlc(channelId: ByteVector32, id: Long, paymentPreimage: ByteVector32) : HtlcMessage, HtlcSettlementMessage, HasChannelId
UpdateMessage
Link copied to clipboard
common
interface UpdateMessage : LightningMessage
Warning
Link copied to clipboard
common
data class Warning(channelId: ByteVector32, data: ByteVector) : SetupMessage, HasChannelId