scoin.ln

package scoin.ln

Type members

Classlikes

case class AcceptChannel(temporaryChannelId: ByteVector32, dustLimitSatoshis: Satoshi, maxHtlcValueInFlightMsat: UInt64, channelReserveSatoshis: Satoshi, htlcMinimumMsat: MilliSatoshi, minimumDepth: Long, toSelfDelay: CltvExpiryDelta, maxAcceptedHtlcs: Int, fundingPubkey: PublicKey, revocationBasepoint: PublicKey, paymentBasepoint: PublicKey, delayedPaymentBasepoint: PublicKey, htlcBasepoint: PublicKey, firstPerCommitmentPoint: PublicKey, tlvStream: TlvStream[AcceptChannelTlv]) extends ChannelMessage with HasTemporaryChannelId
sealed trait AcceptChannelTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
case class AmountBelowMinimum(amount: MilliSatoshi, update: ChannelUpdate) extends Update
case class AnnouncementSignatures(channelId: ByteVector32, shortChannelId: ShortChannelId, nodeSignature: ByteVector64, bitcoinSignature: ByteVector64, tlvStream: TlvStream[AnnouncementSignaturesTlv]) extends RoutingMessage with HasChannelId
sealed trait AnnouncementSignaturesTlv extends Tlv
Companion:
object
Source:
Tlv.scala
sealed trait BadOnion extends FailureMessage
case class Bolt11Invoice(prefix: String, amount_opt: Option[MilliSatoshi], createdAt: TimestampSecond, nodeId: PublicKey, tags: List[TaggedField], signature: ByteVector)

Lightning Bolt 11 invoice see https://github.com/lightning/bolts/blob/master/11-payment-encoding.md

Value parameters:
amount_opt

amount to pay (empty string means no amount is specified)

createdAt

invoice timestamp (UNIX format)

nodeId

id of the node emitting the invoice

prefix

currency prefix; lnbc for bitcoin, lntb for bitcoin testnet

signature

invoice signature that will be checked against node id

tags

payment tags; must include a single PaymentHash tag and a single PaymentSecret tag.

Companion:
object
Source:
Bolt11Invoice.scala
case class ChannelAnnouncement(nodeSignature1: ByteVector64, nodeSignature2: ByteVector64, bitcoinSignature1: ByteVector64, bitcoinSignature2: ByteVector64, features: Features[Feature], chainHash: ByteVector32, shortChannelId: ShortChannelId, nodeId1: PublicKey, nodeId2: PublicKey, bitcoinKey1: PublicKey, bitcoinKey2: PublicKey, tlvStream: TlvStream[ChannelAnnouncementTlv]) extends RoutingMessage with AnnouncementMessage with HasChainHash
sealed trait ChannelAnnouncementTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
case class ChannelDisabled(messageFlags: Byte, channelFlags: ChannelFlags, update: ChannelUpdate) extends Update

Subset of Bolt 9 features used to configure a channel and applicable over the lifetime of that channel. Even if one of these features is later disabled at the connection level, it will still apply to the channel until the channel is upgraded or closed.

Subset of Bolt 9 features used to configure a channel and applicable over the lifetime of that channel. Even if one of these features is later disabled at the connection level, it will still apply to the channel until the channel is upgraded or closed.

Companion:
object
Source:
ChannelFeatures.scala
case class ChannelReestablish(channelId: ByteVector32, nextLocalCommitmentNumber: Long, nextRemoteRevocationNumber: Long, yourLastPerCommitmentSecret: PrivateKey, myCurrentPerCommitmentPoint: PublicKey, tlvStream: TlvStream[ChannelReestablishTlv]) extends ChannelMessage with HasChannelId
sealed trait ChannelReestablishTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
object ChannelTlv
Source:
Tlv.scala
sealed trait ChannelType

A channel type is a specific set of even feature bits that represent persistent channel features as defined in Bolt 2.

A channel type is a specific set of even feature bits that represent persistent channel features as defined in Bolt 2.

Source:
ChannelFeatures.scala

Permanent channel feature negotiated in the channel type. Those features take precedence over permanent channel features negotiated in init messages. For example, if the channel type is option_static_remotekey, then even if the option_anchor_outputs feature is supported by both peers, it won't apply to the channel.

Permanent channel feature negotiated in the channel type. Those features take precedence over permanent channel features negotiated in init messages. For example, if the channel type is option_static_remotekey, then even if the option_anchor_outputs feature is supported by both peers, it won't apply to the channel.

Source:
Features.scala
case class ChannelUpdate(signature: ByteVector64, chainHash: ByteVector32, shortChannelId: ShortChannelId, timestamp: TimestampSecond, channelFlags: ChannelFlags, cltvExpiryDelta: CltvExpiryDelta, htlcMinimumMsat: MilliSatoshi, feeBaseMsat: MilliSatoshi, feeProportionalMillionths: Long, htlcMaximumMsat: Option[MilliSatoshi], tlvStream: TlvStream[ChannelUpdateTlv]) extends RoutingMessage with AnnouncementMessage with HasTimestamp with HasChainHash
sealed trait ChannelUpdateTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
case class ClosingSigned(channelId: ByteVector32, feeSatoshis: Satoshi, signature: ByteVector64, tlvStream: TlvStream[ClosingSignedTlv]) extends ChannelMessage with HasChannelId
sealed trait ClosingSignedTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
case class Color(r: Byte, g: Byte, b: Byte)
case class CommitSig(channelId: ByteVector32, signature: ByteVector64, htlcSignatures: List[ByteVector64], tlvStream: TlvStream[CommitSigTlv]) extends HtlcMessage with HasChannelId
sealed trait CommitSigTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
sealed trait EncodingType
case class Error(channelId: ByteVector32, data: ByteVector, tlvStream: TlvStream[ErrorTlv]) extends SetupMessage with HasChannelId
sealed trait ErrorTlv extends Tlv
Companion:
object
Source:
Tlv.scala
object ErrorTlv
Companion:
class
Source:
Tlv.scala
case class ExpiryTooSoon(update: ChannelUpdate) extends Update
trait Feature

Not a sealed trait, so it can be extended by plugins.

Not a sealed trait, so it can be extended by plugins.

Source:
Features.scala
sealed trait FeatureSupport
Companion:
object
Source:
Features.scala
Companion:
class
Source:
Features.scala
case class Features[T <: Feature](activated: Map[T, FeatureSupport], unknown: Set[UnknownFeature])
Companion:
object
Source:
Features.scala
object Features
Companion:
class
Source:
Features.scala
case class FeeInsufficient(amount: MilliSatoshi, update: ChannelUpdate) extends Update
case class FundingCreated(temporaryChannelId: ByteVector32, fundingTxid: ByteVector32, fundingOutputIndex: Int, signature: ByteVector64, tlvStream: TlvStream[FundingCreatedTlv]) extends ChannelMessage with HasTemporaryChannelId
sealed trait FundingCreatedTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
case class FundingLocked(channelId: ByteVector32, nextPerCommitmentPoint: PublicKey, tlvStream: TlvStream[FundingLockedTlv]) extends ChannelMessage with HasChannelId
sealed trait FundingLockedTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
sealed trait FundingSignedTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
case class GenericTlv(tag: UInt64, value: ByteVector) extends Tlv

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

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

Value parameters:
tag

tlv tag.

value

tlv value (length is implicit, and encoded as a varint).

Source:
Tlv.scala
case class GossipTimestampFilter(chainHash: ByteVector32, firstTimestamp: TimestampSecond, timestampRange: Long, tlvStream: TlvStream[GossipTimestampFilterTlv]) extends RoutingMessage with HasChainHash
sealed trait GossipTimestampFilterTlv extends Tlv
Companion:
object
Source:
Tlv.scala
sealed trait IPAddress extends NodeAddress
case class IPv4(ipv4: Inet4Address, port: Int) extends IPAddress
case class IPv6(ipv6: Inet6Address, port: Int) extends IPAddress
case class IncorrectCltvExpiry(expiry: CltvExpiry, update: ChannelUpdate) extends Update
case class Init(features: Features[InitFeature], tlvStream: TlvStream[InitTlv]) extends SetupMessage
trait InitFeature extends Feature

Feature that should be advertised in init messages.

Feature that should be advertised in init messages.

Source:
Features.scala
sealed trait InitTlv extends Tlv

Tlv types used inside Init messages.

Tlv types used inside Init messages.

Companion:
object
Source:
Tlv.scala
object InitTlv
Companion:
class
Source:
Tlv.scala
case class InvalidOnionHmac(onionHash: ByteVector32) extends BadOnion with Perm
case class InvalidOnionKey(onionHash: ByteVector32) extends BadOnion with Perm
case class InvalidOnionPayload(tag: UInt64, offset: Int) extends Perm
case class InvalidOnionVersion(onionHash: ByteVector32) extends BadOnion with Perm
case object InvalidRealm extends Perm
trait InvoiceFeature extends Feature

Feature that should be advertised in invoices.

Feature that should be advertised in invoices.

Source:
Features.scala
sealed trait Node extends FailureMessage
sealed trait NodeAddress
case class NodeAnnouncement(signature: ByteVector64, features: Features[Feature], timestamp: TimestampSecond, nodeId: PublicKey, rgbColor: Color, alias: String, addresses: List[NodeAddress], tlvStream: TlvStream[NodeAnnouncementTlv]) extends RoutingMessage with AnnouncementMessage with HasTimestamp
sealed trait NodeAnnouncementTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
trait NodeFeature extends Feature

Feature that should be advertised in node announcements.

Feature that should be advertised in node announcements.

Source:
Features.scala
case class OnionRoutingPacket(version: Int, publicKey: ByteVector, payload: ByteVector, hmac: ByteVector32)
case class OpenChannel(chainHash: ByteVector32, temporaryChannelId: ByteVector32, fundingSatoshis: Satoshi, pushMsat: MilliSatoshi, dustLimitSatoshis: Satoshi, maxHtlcValueInFlightMsat: UInt64, channelReserveSatoshis: Satoshi, htlcMinimumMsat: MilliSatoshi, feeratePerKw: FeeratePerKw, toSelfDelay: CltvExpiryDelta, maxAcceptedHtlcs: Int, fundingPubkey: PublicKey, revocationBasepoint: PublicKey, paymentBasepoint: PublicKey, delayedPaymentBasepoint: PublicKey, htlcBasepoint: PublicKey, firstPerCommitmentPoint: PublicKey, channelFlags: ChannelFlags, tlvStream: TlvStream[OpenChannelTlv]) extends ChannelMessage with HasTemporaryChannelId with HasChainHash
sealed trait OpenChannelTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
sealed trait Perm extends FailureMessage

Feature negotiated when opening a channel that will apply for all of the channel's lifetime. This doesn't include features that can be safely activated/deactivated without impacting the channel's operation such as option_dataloss_protect or option_shutdown_anysegwit.

Feature negotiated when opening a channel that will apply for all of the channel's lifetime. This doesn't include features that can be safely activated/deactivated without impacting the channel's operation such as option_dataloss_protect or option_shutdown_anysegwit.

Source:
Features.scala
case object PermanentNodeFailure extends Perm with Node
case class Ping(pongLength: Int, data: ByteVector, tlvStream: TlvStream[PingTlv]) extends SetupMessage
sealed trait PingTlv extends Tlv
Companion:
object
Source:
Tlv.scala
object PingTlv
Companion:
class
Source:
Tlv.scala
case class Pong(data: ByteVector, tlvStream: TlvStream[PongTlv]) extends SetupMessage
sealed trait PongTlv extends Tlv
Companion:
object
Source:
Tlv.scala
object PongTlv
Companion:
class
Source:
Tlv.scala
case class QueryChannelRange(chainHash: ByteVector32, firstBlock: BlockHeight, numberOfBlocks: Long, tlvStream: TlvStream[QueryChannelRangeTlv]) extends RoutingMessage
sealed trait QueryChannelRangeTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
sealed trait QueryShortChannelIdsTlv extends Tlv
Companion:
object
Source:
Tlv.scala
case class ReplyChannelRange(chainHash: ByteVector32, firstBlock: BlockHeight, numberOfBlocks: Long, syncComplete: Byte, shortChannelIds: EncodedShortChannelIds, tlvStream: TlvStream[ReplyChannelRangeTlv]) extends RoutingMessage
sealed trait ReplyChannelRangeTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
sealed trait ReplyShortChannelIdsEndTlv extends Tlv
Companion:
object
Source:
Tlv.scala
case class RevokeAndAck(channelId: ByteVector32, perCommitmentSecret: PrivateKey, nextPerCommitmentPoint: PublicKey, tlvStream: TlvStream[RevokeAndAckTlv]) extends HtlcMessage with HasChannelId
sealed trait RevokeAndAckTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
case class Shutdown(channelId: ByteVector32, scriptPubKey: ByteVector, tlvStream: TlvStream[ShutdownTlv]) extends ChannelMessage with HasChannelId
sealed trait ShutdownTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
trait Tlv
Source:
Tlv.scala
object TlvCodecs
Source:
Tlv.scala
case class TlvStream[T <: Tlv](records: Iterable[T], unknown: Iterable[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.

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.

Type parameters:
T

the stream namespace is a trait extending the top-level tlv trait.

Value parameters:
records

known tlv records.

unknown

unknown tlv records.

Companion:
object
Source:
Tlv.scala
object TlvStream
Companion:
class
Source:
Tlv.scala
case class Tor2(tor2: String, port: Int) extends OnionAddress
case class Tor3(tor3: String, port: Int) extends OnionAddress

We allow remote nodes to send us unknown failure codes (e.g. deprecated failure codes). By reading the PERM and NODE bits 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).

We allow remote nodes to send us unknown failure codes (e.g. deprecated failure codes). By reading the PERM and NODE bits 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).

Source:
FailureMessage.scala
case class UnknownFeature(bitIndex: Int)
case object UnknownNextPeer extends Perm
sealed trait Update extends FailureMessage
case class UpdateAddHtlc(channelId: ByteVector32, id: Long, amountMsat: MilliSatoshi, paymentHash: ByteVector32, cltvExpiry: CltvExpiry, onionRoutingPacket: OnionRoutingPacket, tlvStream: TlvStream[UpdateAddHtlcTlv]) extends HtlcMessage with UpdateMessage with HasChannelId
sealed trait UpdateAddHtlcTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
sealed trait UpdateFailHtlcTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
sealed trait UpdateFailMalformedHtlcTlv extends Tlv
Companion:
object
Source:
Tlv.scala
case class UpdateFee(channelId: ByteVector32, feeratePerKw: FeeratePerKw, tlvStream: TlvStream[UpdateFeeTlv]) extends ChannelMessage with UpdateMessage with HasChannelId
sealed trait UpdateFeeTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
sealed trait UpdateFulfillHtlcTlv extends Tlv
Companion:
object
Source:
Tlv.scala
Companion:
class
Source:
Tlv.scala
case class Warning(channelId: ByteVector32, data: ByteVector, tlvStream: TlvStream[WarningTlv]) extends SetupMessage with HasChannelId
sealed trait WarningTlv extends Tlv
Companion:
object
Source:
Tlv.scala
object WarningTlv
Companion:
class
Source:
Tlv.scala