package
0.18.4-beta.rc2
Repository: https://github.com/lightningnetwork/lnd.git
Documentation: pkg.go.dev

# README

lnwire

Build Status MIT licensed GoDoc

The lnwire package implements the Lightning Network wire protocol.

This package has intentionally been designed so it can be used as a standalone package for any projects needing to interface with lightning peers at the wire protocol level.

Installation and Updating

$  go get -u github.com/lightningnetwork/lnd/lnwire

# Functions

AssertUniqueTypes asserts that the given records have unique types.
DecodeFailure decodes, validates, and parses the lnwire onion failure, for the provided protocol version.
DecodeFailureMessage decodes just the failure message, ignoring any padding that may be present at the end.
DecodeRecords decodes the given byte slice into the given records and returns the rest as a TLV type map.
DecodeRecordsP2P decodes the given byte slice into the given records and returns the rest as a TLV type map.
DShortChannelID is a decoder for ShortChannelID.
EmptyFeatureVector returns a feature vector with no bits set.
EncodeFailure encodes, including the necessary onion failure header information.
EncodeFailureMessage encodes just the failure message without adding a length and padding the message for the onion protocol.
EncodeMessageExtraData encodes the given recordProducers into the given extraData.
EncodeRecords encodes the given records into a byte slice.
EncodeRecordsTo encodes the given records into the given writer.
ErrorEncodeMessage is used when failed to encode the message payload.
ErrorPayloadTooLarge is used when the payload size exceeds the MaxMsgBody.
ErrorWriteMessageType is used when failed to write the message type.
ErrOutpointIndexTooBig is used when the outpoint index exceeds the max value of uint16.
ErrUnknownShortChanIDEncoding is a parametrized error that indicates that we came across an unknown short channel ID encoding, and therefore were unable to continue parsing.
EShortChannelID is an encoder for ShortChannelID.
IsCustomOverride returns a bool indicating whether the message type is one of the protocol messages that we override for custom use.
MaybePartialSigWithNonce is a helper function that returns an optional PartialSigWithNonceTLV.
MergeAndEncode merges the known records with the extra data and custom records, then encodes the merged records into raw bytes.
NewAmountBelowMinimum creates new instance of the FailAmountBelowMinimum.
NewChanIDFromOutPoint converts a target OutPoint into a ChannelID that is usable within the network.
NewChannelDisabled creates new instance of the FailChannelDisabled.
NewChannelReady creates a new ChannelReady message, populating it with the necessary IDs and revocation secret.
NewClosingSigned creates a new empty ClosingSigned message.
NewCommitSig creates a new empty CommitSig message.
NewCustom instantiates a new custom message.
NewCustomRecords creates a new CustomRecords instance from a tlv.TypeMap.
NewError creates a new Error message.
NewExpiryTooSoon creates new instance of the FailExpiryTooSoon.
NewExtraOpaqueData creates a new ExtraOpaqueData instance from a tlv.TypeMap.
NewFailIncorrectDetails makes a new instance of the FailIncorrectDetails error bound to the specified HTLC amount and acceptance height.
NewFeatureVector constructs a new FeatureVector from a raw feature vector and mapping of feature definitions.
NewFeeInsufficient creates new instance of the FailFeeInsufficient.
NewFinalExpiryTooSoon creates new instance of the FailFinalExpiryTooSoon.
NewFinalIncorrectCltvExpiry creates new instance of the FailFinalIncorrectCltvExpiry.
NewFinalIncorrectHtlcAmount creates new instance of the FailFinalIncorrectHtlcAmount.
NewGossipTimestampRange creates a new empty GossipTimestampRange message.
NewIncorrectCltvExpiry creates new instance of the FailIncorrectCltvExpiry.
NewInitMessage creates new instance of init message object.
NewInvalidBlinding creates new instance of FailInvalidBlinding.
NewInvalidOnionHmac creates new instance of the FailInvalidOnionHmac.
NewInvalidOnionKey creates new instance of the FailInvalidOnionKey.
NewInvalidOnionPayload initializes a new InvalidOnionPayload failure.
NewInvalidOnionVersion creates new instance of the FailInvalidOnionVersion.
NewMSatFromSatoshis creates a new MilliSatoshi instance from a target amount of satoshis.
NewNodeAlias creates a new instance of a NodeAlias.
NewPartialSig creates a new partial sig.
NewPartialSigWithNonce creates a new partial sig with nonce.
NewPing returns a new Ping message.
NewPong returns a new Pong message.
NewQueryChannelRange creates a new empty QueryChannelRange message.
NewQueryShortChanIDs creates a new QueryShortChanIDs message.
NewRawFeatureVector creates a feature vector with all of the feature bits given as arguments enabled.
NewReplyChannelRange creates a new empty ReplyChannelRange message.
NewReplyShortChanIDsEnd creates a new empty ReplyShortChanIDsEnd message.
NewRevokeAndAck creates a new RevokeAndAck message.
NewShortChanIDFromInt returns a new ShortChannelID which is the decoded version of the compact channel ID encoded within the uint64.
NewShutdown creates a new Shutdown message.
NewSigFromECDSARawSignature returns a Sig from a Bitcoin raw signature encoded in the canonical DER encoding.
NewSigFromSchnorrRawSignature converts a raw schnorr signature into an lnwire.Sig.
NewSigFromSignature creates a new signature as used on the wire, from an existing ecdsa.Signature or schnorr.Signature.
NewSigFromWireECDSA returns a Sig instance based on an ECDSA signature that's already in the 64-byte format we expect.
NewTemporaryChannelFailure creates new instance of the FailTemporaryChannelFailure.
NewTimestampQueryOption is a helper constructor used to construct a QueryOption with the timestamp bit set.
NewUpdateAddHTLC returns a new empty UpdateAddHTLC message.
NewUpdateFee creates a new UpdateFee message.
NewUpdateFulfillHTLC returns a new empty UpdateFulfillHTLC.
NewWarning creates a new Warning message.
ParseAndExtractCustomRecords parses the given extra data into the passed-in records, then returns any remaining records split into custom records and extra data.
ParseCustomRecords creates a new CustomRecords instance from a tlv.Blob.
ParseCustomRecordsFrom creates a new CustomRecords instance from a reader.
ProduceRecordsSorted converts a slice of record producers into a slice of records and then sorts it by type.
ReadElement is a one-stop utility function to deserialize any datastructure encoded using the serialization format of lnwire.
ReadElements deserializes a variable number of elements into the passed io.Reader, with each element being deserialized according to the ReadElement function.
ReadMessage reads, validates, and parses the next Lightning message from r for the provided protocol version.
RecordsAsProducers converts a slice of records into a slice of record producers.
SetCustomOverrides validates that the set of override types are outside of the custom message range (there's no reason to override messages that are already within the range), and updates the customTypeOverride global to hold this set of message types.
SomeMusig2Nonce is a helper function that creates a musig2 nonce TLV.
SomePartialSig is a helper function that returns an otional PartialSig.
SomeShutdownNonce returns a ShutdownNonceTLV with the given nonce.
SortProducers sorts the given record producers by their type.
TlvMapToRecords converts a TLV map into a slice of records.
WriteBool appends the boolean to the provided buffer.
WriteBytes appends the given bytes to the provided buffer.
WriteChannelID appends the ChannelID to the provided buffer.
WriteChanUpdateChanFlags appends the update flag to the provided buffer.
WriteChanUpdateMsgFlags appends the update flag to the provided buffer.
WriteColorRGBA appends the RGBA color using three bytes.
WriteDeliveryAddress appends the address to the provided buffer.
WriteElement is a one-stop shop to write the big endian representation of any element which is to be serialized for the wire protocol.
WriteElements is writes each element in the elements slice to the passed buffer using WriteElement.
WriteErrorData appends the data to the provided buffer.
WriteFailCode appends the FailCode to the provided buffer.
WriteFundingFlag appends the FundingFlag to the provided buffer.
WriteMessage writes a lightning Message to a buffer including the necessary header information and returns the number of bytes written.
WriteMilliSatoshi appends the MilliSatoshi value to the provided buffer.
WriteNetAddrs appends a slice of addresses to the provided buffer with the length info.
WriteNodeAlias appends the alias to the provided buffer.
WriteOnionAddr appends the onion address to the provided buffer.
WriteOpaqueAddrs appends the payload of the given OpaqueAddrs to buffer.
WriteOpaqueReason appends the reason to the provided buffer.
WriteOutPoint appends the outpoint to the provided buffer.
WritePingPayload appends the payload to the provided buffer.
WritePkScript appends the script to the provided buffer.
WritePongPayload appends the payload to the provided buffer.
WritePublicKey appends the compressed public key to the provided buffer.
WriteQueryEncoding appends the QueryEncoding to the provided buffer.
WriteRawFeatureVector encodes the feature using the feature's Encode method and appends the data to the provided buffer.
WriteSatoshi appends the Satoshi value to the provided buffer.
WriteShortChannelID appends the ShortChannelID to the provided buffer.
WriteSig appends the signature to the provided buffer.
WriteSigs appends the slice of signatures to the provided buffer with its length.
WriteTCPAddr appends the TCP address to the provided buffer, either a IPv4 or a IPv6.
WriteUint16 appends the uint16 to the provided buffer.
WriteUint32 appends the uint32 to the provided buffer.
WriteUint64 appends the uint64 to the provided buffer.
WriteUint8 appends the uint8 to the provided buffer.
WriteWarningData appends the data to the provided buffer.

# Constants

AliasScidRecordType is the type of the experimental record to denote the alias being used in an option_scid_alias channel.
AMPOptional is an optional feature bit that signals that the receiver of a payment supports accepts spontaneous payments, i.e.
AMPRequired is a required feature bit that signals that the receiver of a payment supports accepts spontaneous payments, i.e.
AnchorsOptional is an optional feature bit that signals that the node supports channels to be made using commitments having anchor outputs.
AnchorsRequired is a required feature bit that signals that the node requires channels to be made using commitments having anchor outputs.
AnchorsZeroFeeHtlcTxOptional is an optional feature bit that signals that the node supports channels having zero-fee second-level HTLC transactions, which also imply anchor commitments.
AnchorsZeroFeeHtlcTxRequired is a required feature bit that signals that the node requires channels having zero-fee second-level HTLC transactions, which also imply anchor commitments.
Bolt11BlindedPathsOptional is an optional feature bit that indicates that the node is able to understand the blinded path tagged field in a BOLT 11 invoice.
Bolt11BlindedPathsRequired is a required feature bit that indicates that the node is able to understand the blinded path tagged field in a BOLT 11 invoice.
ChannelTypeRecordType is the type of the experimental record used to denote which channel type is being negotiated.
ChanUpdateDirection indicates the direction of a channel update.
ChanUpdateDisabled is a bit that indicates if the channel edge selected by the ChanUpdateDirection bit is to be treated as being disabled.
ChanUpdateRequiredMaxHtlc is a bit that indicates whether the required htlc_maximum_msat field is present in this ChannelUpdate.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
nolint:lll.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
The currently defined onion failure types within this current version of the Lightning protocol.
No description provided by the author
CustomTypeStart is the start of the custom type range for peer messages as defined in BOLT 01.
DALocalMusig2Pubnonce is the TLV type number that identifies the musig2 public nonce that we need to verify the commitment transaction signature.
DataLossProtectOptional is an optional feature bit that indicates that the sending peer knows of this new feature and can activate it it.
DataLossProtectRequired is a feature bit that indicates that a peer *requires* the other party know about the data-loss-protect optional feature.
DeliveryAddrType is the TLV record type for delivery addreses within the name space of the OpenChannel and AcceptChannel messages.
DPChannelReserveSatoshis is the TLV type number that identifies the for DynPropose.ChannelReserve.
DPChannelType is the TLV type number that identifies the record for DynPropose.ChannelType.
DPDustLimitSatoshis is the TLV type number that identifies the record for DynPropose.DustLimit.
DPFundingPubkey is the TLV type number that identifies the record for DynPropose.FundingKey.
DPKickoffFeerate is the TLV type number that identifies the record for DynPropose.KickoffFeerate.
DPMaxAcceptedHtlcs is the TLV type number that identifies the record for DynPropose.MaxAcceptedHTLCs.
DPMaxHtlcValueInFlightMsat is the TLV type number that identifies the record for DynPropose.MaxValueInFlight.
DPToSelfDelay is the TLV type number that identifies the record for DynPropose.CsvDelay.
EncodingSortedPlain signals that the set of data is encoded using the regular encoding, in a sorted order.
EncodingSortedZlib signals that the set of data is encoded by first sorting the set of channel ID's, as then compressing them using zlib.
ErrChanTooLarge is returned by a remote peer that receives a FundingOpen request for a channel that is above their current soft-limit.
ErrMaxPendingChannels is returned by remote peer when the number of active pending channels exceeds their maximum policy limit.
ExplicitChannelTypeOptional is an optional bit that denotes that a connection established with this node is to use explicit channel commitment types for negotiation instead of the existing implicit negotiation methods.
ExplicitChannelTypeRequired is a required bit that denotes that a connection established with this node is to use explicit channel commitment types for negotiation instead of the existing implicit negotiation methods.
FailureMessageLength is the size of the failure message plus the size of padding.
No description provided by the author
FFAnnounceChannel is a FundingFlag that when set, indicates the initiator of a funding flow wishes to announce the channel to the greater network.
FlagBadOnion error flag describes an unparsable, encrypted by previous node.
FlagNode error flag indicates a node failure.
FlagPerm error flag indicates a permanent failure.
FlagUpdate error flag indicates a new channel update is enclosed within the error.
GossipQueriesOptional is an optional feature bit that signals that the setting peer knows of the set of features that allows more efficient network view reconciliation.
GossipQueriesRequired is a feature bit that indicates that the receiving peer MUST know of the set of features that allows nodes to more efficiently query the network view of peers on the network for reconciliation purposes.
InitialRoutingSync is a local feature bit meaning that the receiving node should send a complete dump of routing information when a new connection is established.
KeysendOptional is an optional bit that indicates that the node is able and willing to accept keysend payments.
KeysendRequired is a required bit that indicates that the node is able and willing to accept keysend payments.
LeaseExpiryType is the type of the experimental record used to communicate the expiration of a channel lease throughout the channel funding process.
MaxBolt11Feature is the maximum feature bit value allowed in bolt 11 invoices.
MaxFundingTxOutputs is the maximum number of allowed outputs on a funding transaction within the protocol.
MaxMilliSatoshi is the maximum number of msats that can be expressed in this data type.
MaxMsgBody is the largest payload any message is allowed to provide.
MaxPongBytes is the maximum number of extra bytes a pong can be requested to send.
MaxSliceLength is the maximum allowed length for any opaque byte slices in the wire protocol.
MinCustomRecordsTlvType is the minimum custom records TLV type as defined in BOLT 01.
MPPOptional is an optional feature bit that signals that the receiver of a payment supports settlement of an invoice with more than one HTLC.
MPPRequired is a required feature bit that signals that the receiver of a payment requires settlement of an invoice with more than one HTLC.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
The currently defined message types within this current version of the Lightning protocol.
OnionPacketSize is the size of the serialized Sphinx onion packet included in each UpdateAddHTLC message.
PartialSigLen is the length of a musig2 partial signature.
PartialSigWithNonceLen is the length of a serialized PartialSigWithNonce.
PaymentAddrOptional is an optional feature bit that signals that a node supports payment addresses, which are used to mitigate probing attacks on the receiver of a payment.
PaymentAddrRequired is a required feature bit that signals that a node requires payment addresses, which are used to mitigate probing attacks on the receiver of a payment.
PaymentMetadataOptional is an optional bit that denotes that if an invoice contains metadata, it may be passed along with the payment htlc(s).
PaymentMetadataRequired is a required bit that denotes that if an invoice contains metadata, it must be passed along with the payment htlc(s).
QueryOptionsRecordType is the TLV number of the query_options TLV record in the query_channel_range message.
QueryOptionTimestampBit is the bit position in the query_option feature bit vector which is used to indicate that timestamps are desired in the reply_channel_range response.
RouteBlindingOptional is an optional feature bit that signals that the node supports blinded payments.
RouteBlindingRequired is a required feature bit that signals that the node supports blinded payments.
ScidAliasOptional is an optional feature bit that signals that the node understands ShortChannelID aliases in the TLV segment of the channel_ready message.
ScidAliasRequired is a required feature bit that signals that the node requires understanding of ShortChannelID aliases in the TLV segment of the channel_ready message.
ScriptEnforcedLeaseOptional is an optional feature bit that signals that the node requires channels having zero-fee second-level HTLC transactions, which also imply anchor commitments, along with an additional CLTV constraint of a channel lease's expiration height applied to all outputs that pay directly to the channel initiator.
ScriptEnforcedLeaseRequired is a required feature bit that signals that the node requires channels having zero-fee second-level HTLC transactions, which also imply anchor commitments, along with an additional CLTV constraint of a channel lease's expiration height applied to all outputs that pay directly to the channel initiator.
ShutdownAnySegwitOptional is an optional feature bit that signals that the sender is able to properly handle/parse segwit witness programs up to version 16.
ShutdownAnySegwitRequired is an required feature bit that signals that the sender is able to properly handle/parse segwit witness programs up to version 16.
SimpleTaprootChannelsOptionalFinal is an optional bit that indicates the node is able to create taproot-native channels.
SimpleTaprootChannelsOptionalStaging is an optional bit that indicates the node is able to create taproot-native channels.
SimpleTaprootChannelsRequiredFinal is a required bit that indicates the node is able to create taproot-native channels.
SimpleTaprootChannelsRequiredStaging is a required bit that indicates the node is able to create taproot-native channels.
SimpleTaprootOverlayChansRequired is a required bit that indicates support for the special custom taproot overlay channel.
SimpleTaprootOverlayChansRequired is a required bit that indicates support for the special custom taproot overlay channel.
StaticRemoteKeyOptional is an optional feature bit that signals that within one's commitment transaction, the key used for the remote party's non-delay output should not be tweaked.
StaticRemoteKeyRequired is a required feature bit that signals that within one's commitment transaction, the key used for the remote party's non-delay output should not be tweaked.
TimestampsRecordType is the TLV number of the timestamps TLV record in the reply_channel_range message.
TLVOnionPayloadOptional is an optional feature bit that indicates a node is able to decode the new TLV information included in the onion packet.
TLVOnionPayloadRequired is a feature bit that indicates a node is able to decode the new TLV information included in the onion packet.
UpfrontShutdownScriptOptional is an optional feature bit which indicates that the peer will accept an upfront shutdown script to which payout is enforced on cooperative closes.
UpfrontShutdownScriptRequired is a feature bit which indicates that a peer *requires* that the remote peer accept an upfront shutdown script to which payout is enforced on cooperative closes.
WumboChannelsOptional is an optional feature bit that signals that a node is willing to accept channels larger than 2^24 satoshis.
WumboChannelsRequired is a required feature bit that signals that a node is willing to accept channels larger than 2^24 satoshis.
ZeroConfOptional is an optional feature bit that signals that the node understands the zero-conf channel type.
ZeroConfRequired is a required feature bit that signals that the node requires understanding of the zero-conf channel_type.

# Variables

ConnectionWideID is an all-zero ChannelID, which is used to represent a message intended for all channels to specific peer.
ErrFeatureBitMaximum is returned when a feature bit exceeds the maximum allowable value.
ErrFeaturePairExists signals an error in feature vector construction where the opposing bit in a feature pair has already been set.
ErrFeatureStandard is returned when attempts to modify LND's known set of features are made.
ErrMaxPongBytesExceeded indicates that the NumPongBytes field from the ping message has exceeded MaxPongBytes.
ErrNilFeatureVector is returned when the supplied feature is nil.
ErrNilNetAddress is returned when a nil value is used in []net.Addr.
ErrNilOnionAddress is returned when the supplied address is nil.
ErrNilOpaqueAddrs is returned when the supplied address is nil.
ErrNilPublicKey is returned when a nil pubkey is used.
ErrNilTCPAddress is returned when the supplied address is nil.
ErrPkScriptTooLong is returned when the length of the provided script exceeds 34.
ErrUnknownServiceLength is returned when the onion service length is unknown.
Features is a mapping of known feature bits to a descriptive name.

# Structs

AcceptChannel is the message Bob sends to Alice after she initiates the single funder channel workflow via an AcceptChannel message.
AnnounceSignatures is a direct message between two endpoints of a channel and serves as an opt-in mechanism to allow the announcement of the channel to the rest of the network.
ChannelAnnouncement message is used to announce the existence of a channel between two peers in the overlay, which is propagated by the discovery service over broadcast handler.
ChannelReady is the message that both parties to a new channel creation send once they have observed the funding transaction being confirmed on the blockchain.
ChannelReestablish is a message sent between peers that have an existing open channel upon connection reestablishment.
ChannelUpdate message is used after channel has been initially announced.
ChanUpdateTimestamps holds the timestamp info of the latest known channel updates corresponding to the two sides of a channel.
ClosingComplete is sent by either side to kick off the process of obtaining a valid signature on a c o-operative channel closure of their choice.
ClosingSig is sent in response to a ClosingComplete message.
ClosingSigned is sent by both parties to a channel once the channel is clear of HTLCs, and is primarily concerned with negotiating fees for the close transaction.
ClosingSigs houses the 3 possible signatures that can be sent when attempting to complete a cooperative channel closure.
CommitSig is sent by either side to stage any pending HTLC's in the receiver's pending set into a new commitment state.
Custom represents an application-defined wire message.
DynAck is the message used to accept the parameters of a dynamic commitment negotiation.
DynPropose is a message that is sent during a dynamic commitments negotiation process.
DynReject is a message that is sent during a dynamic commitments negotiation process.
ErrInvalidNodeAlias is an error returned if a node alias we parse on the wire is invalid, as in it has non UTF-8 characters.
Error represents a generic error bound to an exact channel.
ErrUnknownAddrType is an error returned if we encounter an unknown address type when parsing addresses.
ErrUnsortedSIDs is returned when decoding a QueryShortChannelID request whose items were not sorted.
FailAmountBelowMinimum is returned if the HTLC does not reach the current minimum amount, we tell them the amount of the incoming HTLC and the current channel setting for the outgoing channel.
FailChannelDisabled is returned if the channel is disabled, we tell them the current channel setting for the outgoing channel.
FailExpiryTooFar is returned if the CLTV expiry in the HTLC is too far in the future.
FailExpiryTooSoon is returned if the ctlv-expiry is too near, we tell them the current channel setting for the outgoing channel.
FailFeeInsufficient is returned if the HTLC does not pay sufficient fee, we tell them the amount of the incoming HTLC and the current channel setting for the outgoing channel.
FailFinalExpiryTooSoon is returned if the cltv_expiry is too low, the final node MUST fail the HTLC.
FailFinalIncorrectCltvExpiry is returned if the outgoing_cltv_value does not match the ctlv_expiry of the HTLC at the final hop.
FailFinalIncorrectHtlcAmount is returned if the amt_to_forward is higher than incoming_htlc_amt of the HTLC at the final hop.
FailIncorrectCltvExpiry is returned if outgoing cltv value does not match the update add htlc's cltv expiry minus cltv expiry delta for the outgoing channel, we tell them the cltv expiry and the current channel setting for the outgoing channel.
FailIncorrectDetails is returned for two reasons: 1) if the payment hash has already been paid, the final node MAY treat the payment hash as unknown, or may succeed in accepting the HTLC.
FailIncorrectPaymentAmount is returned if the amount paid is less than the amount expected, the final node MUST fail the HTLC.
FailInvalidBlinding is returned if there has been a route blinding related error.
FailInvalidOnionHmac is return if the onion HMAC is incorrect.
FailInvalidOnionKey is return if the ephemeral key in the onion is unparsable.
FailInvalidOnionVersion is returned if the onion version byte is unknown.
FailInvalidRealm is returned if the realm byte is unknown.
FailMPPTimeout is returned if the complete amount for a multi part payment was not received within a reasonable time.
FailPermanentChannelFailure is return if an otherwise unspecified permanent error occurs for the outgoing channel (eg.
FailPermanentNodeFailure is returned if an otherwise unspecified permanent error occurs for the entire node.
FailRequiredChannelFeatureMissing is returned if the outgoing channel has a requirement advertised in its channel announcement features which were not present in the onion.
FailRequiredNodeFeatureMissing is returned if a node has requirement advertised in its node_announcement features which were not present in the onion.
FailTemporaryChannelFailure is if an otherwise unspecified transient error occurs for the outgoing channel (eg.
FailTemporaryNodeFailure is returned if an otherwise unspecified transient error occurs for the entire node.
FailUnknownNextPeer is returned if the next peer specified by the onion is not known.
FeatureVector represents a set of enabled features.
Fee represents a fee schedule.
FundingCreated is sent from Alice (the initiator) to Bob (the responder), once Alice receives Bob's contributions as well as his channel constraints.
FundingSigned is sent from Bob (the responder) to Alice (the initiator) after receiving the funding outpoint and her signature for Bob's version of the commitment transaction.
GossipTimestampRange is a message that allows the sender to restrict the set of future gossip announcements sent by the receiver.
Init is the first message reveals the features supported or required by this node.
InvalidOnionPayload is returned if the hop could not process the TLV payload enclosed in the onion.
KickoffSig is the message used to transmit the signature for a kickoff transaction during the execution phase of a dynamic commitment negotiation that requires a reanchoring step.
NetAddress represents information pertaining to the identity and network reachability of a peer.
NodeAnnouncement message is used to announce the presence of a Lightning node and also to signal that the node is accepting incoming connections.
OpaqueAddrs is used to store the address bytes for address types that are unknown to us.
OpenChannel is the message Alice sends to Bob if we should like to create a channel with Bob where she's the sole provider of funds to the channel.
PartialSig is the base partial sig type.
PartialSigWithNonce is a partial signature with the nonce that was used to generate the signature.
Ping defines a message which is sent by peers periodically to determine if the connection is still valid.
Pong defines a message which is the direct response to a received Ping message.
QueryChannelRange is a message sent by a node in order to query the receiving node of the set of open channel they know of with short channel ID's after the specified block height, capped at the number of blocks beyond that block height.
QueryShortChanIDs is a message that allows the sender to query a set of channel announcement and channel update messages that correspond to the set of encoded short channel ID's.
RawFeatureVector represents a set of feature bits as defined in BOLT-09.
ReplyChannelRange is the response to the QueryChannelRange message.
ReplyShortChanIDsEnd is a message that marks the end of a streaming message response to an initial QueryShortChanIDs message.
RevokeAndAck is sent by either side once a CommitSig message has been received, and validated.
ShortChannelID represents the set of data which is needed to retrieve all necessary data to validate the channel existence.
Shutdown is sent by either side in order to initiate the cooperative closure of a channel.
Sig is a fixed-sized ECDSA signature or 64-byte schnorr signature.
Stfu is a message that is sent to lock the channel state prior to some other interactive protocol where channel updates need to be paused.
UnknownMessage is an implementation of the error interface that allows the creation of an error in response to an unknown message.
UpdateAddHTLC is the message sent by Alice to Bob when she wishes to add an HTLC to his remote commitment transaction.
UpdateFailHTLC is sent by Alice to Bob in order to remove a previously added HTLC.
UpdateFailMalformedHTLC is sent by either the payment forwarder or by payment receiver to the payment sender in order to notify it that the onion blob can't be parsed.
UpdateFee is the message the channel initiator sends to the other peer if the channel commitment fee needs to be updated.
UpdateFulfillHTLC is sent by Alice to Bob when she wishes to settle a particular HTLC referenced by its HTLCKey within a specific active channel referenced by ChannelPoint.
Warning is used to express non-critical errors in the protocol, providing a "soft" way for nodes to communicate failures.

# Interfaces

FailureMessage represents the onion failure object identified by its unique failure code.
LinkUpdater is an interface implemented by most messages in BOLT 2 that are allowed to update the channel state.
Message is an interface that defines a lightning wire protocol message.
Serializable is an interface which defines a lightning wire serializable object.

# Type aliases

No description provided by the author
ChannelID is a series of 32-bytes that uniquely identifies all channels within the network.
ChannelType represents a specific channel type as a set of feature bits that comprise it.
ChanUpdateChanFlags is a bitfield that signals various options concerning a particular channel edge.
ChanUpdateMsgFlags is a bitfield that signals whether optional fields are present in the ChannelUpdate.
CustomRecords stores a set of custom key/value pairs.
DeliveryAddress is used to communicate the address to which funds from a closed channel should be sent.
DynHeight is a newtype wrapper to get the proper RecordProducer instance to smoothly integrate with the ChannelReestablish Message instance.
ErrorData is a set of bytes associated with a particular sent error.
ExtraOpaqueData is the set of data that was appended to this message, some of which we may not actually know how to iterate or parse.
FailCode specifies the precise reason that an upstream HTLC was canceled.
FeatureBit represents a feature that can be enabled in either a local or global feature vector at a specific bit position.
FundingError represents a set of errors that can be encountered and sent during the funding workflow.
FundingFlag represents the possible bit mask values for the ChannelFlags field within the OpenChannel struct.
LeaseExpiry represents the absolute expiration height of a channel lease.
MessageType is the unique 2 byte big-endian integer that indicates the type of message on the wire.
MilliSatoshi are the native unit of the Lightning Network.
No description provided by the author
NodeAlias is a hex encoded UTF-8 string that may be displayed as an alternative to the node's ID.
NonceRecordTypeT is the TLV type used to encode a local musig2 nonce.
OpaqueReason is an opaque encrypted byte slice that encodes the exact failure reason and additional some supplemental data.
No description provided by the author
No description provided by the author
PingPayload is a set of opaque bytes used to pad out a ping message.
PkScript is simple type definition which represents a raw serialized public key script.
PongPayload is a set of opaque bytes sent in response to a ping message.
QueryEncoding is an enum-like type that represents exactly how a set data is encoded on the wire.
QueryOptions is the type used to represent the query_options feature bit vector in the query_channel_range message.
No description provided by the author
Timestamps is a type representing the timestamps TLV field used in the reply_channel_range message to communicate the timestamps info of the updates of the SCID list being communicated.
WarningData is a set of bytes associated with a particular sent warning.