ppad-bolt7-0.1.1: Routing gossip per BOLT #7
Copyright(c) 2025 Jared Tobin
LicenseMIT
MaintainerJared Tobin <jared@ppad.tech>
Safe HaskellNone
LanguageHaskell2010

Lightning.Protocol.BOLT7

Description

Routing gossip for the Lightning Network, per BOLT #7: the gossip messages and queries, their signature digests and checksums, signature verification, and stateless validation.

Fundamental types (chain hashes, points, signatures, short channel ids, amounts, TLV streams) come from ppad-bolt1, and feature vectors from ppad-bolt9.

Decoders take a message payload, without its 2-byte type, and consume all of it. Every byte is kept, including unassigned flag bits, unknown address descriptors and unknown odd TLV records, so encoding a decoded message reproduces its payload exactly and its signatures still verify.

Synopsis

Messages

data Message Source #

A BOLT #7 message.

Instances

Instances details
NFData Message Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Methods

rnf :: Message -> () #

Generic Message Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Associated Types

type Rep Message 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep Message = D1 ('MetaData "Message" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (((C1 ('MetaCons "MsgChannelAnnouncement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChannelAnnouncement)) :+: C1 ('MetaCons "MsgNodeAnnouncement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NodeAnnouncement))) :+: (C1 ('MetaCons "MsgChannelUpdate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChannelUpdate)) :+: C1 ('MetaCons "MsgAnnouncementSignatures" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AnnouncementSignatures)))) :+: ((C1 ('MetaCons "MsgQueryShortChannelIds" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 QueryShortChannelIds)) :+: C1 ('MetaCons "MsgReplyShortChannelIdsEnd" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ReplyShortChannelIdsEnd))) :+: (C1 ('MetaCons "MsgQueryChannelRange" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 QueryChannelRange)) :+: (C1 ('MetaCons "MsgReplyChannelRange" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ReplyChannelRange)) :+: C1 ('MetaCons "MsgGossipTimestampFilter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GossipTimestampFilter))))))

Methods

from :: Message -> Rep Message x #

to :: Rep Message x -> Message #

Show Message Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Eq Message Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Methods

(==) :: Message -> Message -> Bool #

(/=) :: Message -> Message -> Bool #

type Rep Message Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep Message = D1 ('MetaData "Message" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (((C1 ('MetaCons "MsgChannelAnnouncement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChannelAnnouncement)) :+: C1 ('MetaCons "MsgNodeAnnouncement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NodeAnnouncement))) :+: (C1 ('MetaCons "MsgChannelUpdate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChannelUpdate)) :+: C1 ('MetaCons "MsgAnnouncementSignatures" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 AnnouncementSignatures)))) :+: ((C1 ('MetaCons "MsgQueryShortChannelIds" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 QueryShortChannelIds)) :+: C1 ('MetaCons "MsgReplyShortChannelIdsEnd" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ReplyShortChannelIdsEnd))) :+: (C1 ('MetaCons "MsgQueryChannelRange" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 QueryChannelRange)) :+: (C1 ('MetaCons "MsgReplyChannelRange" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ReplyChannelRange)) :+: C1 ('MetaCons "MsgGossipTimestampFilter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GossipTimestampFilter))))))

message_type :: Message -> Word16 Source #

The message type of a Message.

data ChannelAnnouncement Source #

The channel_announcement message (type 256).

Instances

Instances details
NFData ChannelAnnouncement Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Methods

rnf :: ChannelAnnouncement -> () #

Generic ChannelAnnouncement Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Associated Types

type Rep ChannelAnnouncement 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep ChannelAnnouncement = D1 ('MetaData "ChannelAnnouncement" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "ChannelAnnouncement" 'PrefixI 'True) (((S1 ('MetaSel ('Just "ca_node_signature_1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: (S1 ('MetaSel ('Just "ca_node_signature_2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: S1 ('MetaSel ('Just "ca_bitcoin_signature_1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature))) :*: (S1 ('MetaSel ('Just "ca_bitcoin_signature_2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: (S1 ('MetaSel ('Just "ca_features") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FeatureVector) :*: S1 ('MetaSel ('Just "ca_chain_hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainHash)))) :*: ((S1 ('MetaSel ('Just "ca_short_channel_id") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 ShortChannelId) :*: (S1 ('MetaSel ('Just "ca_node_id_1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point) :*: S1 ('MetaSel ('Just "ca_node_id_2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point))) :*: (S1 ('MetaSel ('Just "ca_bitcoin_key_1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point) :*: (S1 ('MetaSel ('Just "ca_bitcoin_key_2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point) :*: S1 ('MetaSel ('Just "ca_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream))))))
Show ChannelAnnouncement Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Eq ChannelAnnouncement Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep ChannelAnnouncement Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep ChannelAnnouncement = D1 ('MetaData "ChannelAnnouncement" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "ChannelAnnouncement" 'PrefixI 'True) (((S1 ('MetaSel ('Just "ca_node_signature_1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: (S1 ('MetaSel ('Just "ca_node_signature_2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: S1 ('MetaSel ('Just "ca_bitcoin_signature_1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature))) :*: (S1 ('MetaSel ('Just "ca_bitcoin_signature_2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: (S1 ('MetaSel ('Just "ca_features") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FeatureVector) :*: S1 ('MetaSel ('Just "ca_chain_hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainHash)))) :*: ((S1 ('MetaSel ('Just "ca_short_channel_id") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 ShortChannelId) :*: (S1 ('MetaSel ('Just "ca_node_id_1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point) :*: S1 ('MetaSel ('Just "ca_node_id_2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point))) :*: (S1 ('MetaSel ('Just "ca_bitcoin_key_1") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point) :*: (S1 ('MetaSel ('Just "ca_bitcoin_key_2") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point) :*: S1 ('MetaSel ('Just "ca_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream))))))

data NodeAnnouncement Source #

The node_announcement message (type 257).

Constructors

NodeAnnouncement 

Fields

Instances

Instances details
NFData NodeAnnouncement Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Methods

rnf :: NodeAnnouncement -> () #

Generic NodeAnnouncement Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Associated Types

type Rep NodeAnnouncement 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep NodeAnnouncement = D1 ('MetaData "NodeAnnouncement" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "NodeAnnouncement" 'PrefixI 'True) (((S1 ('MetaSel ('Just "na_signature") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: S1 ('MetaSel ('Just "na_features") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FeatureVector)) :*: (S1 ('MetaSel ('Just "na_timestamp") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "na_node_id") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point))) :*: ((S1 ('MetaSel ('Just "na_rgb_color") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RgbColor) :*: S1 ('MetaSel ('Just "na_alias") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Alias)) :*: (S1 ('MetaSel ('Just "na_addresses") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Address]) :*: (S1 ('MetaSel ('Just "na_unknown_addresses") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteString) :*: S1 ('MetaSel ('Just "na_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream))))))
Show NodeAnnouncement Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Eq NodeAnnouncement Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep NodeAnnouncement Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep NodeAnnouncement = D1 ('MetaData "NodeAnnouncement" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "NodeAnnouncement" 'PrefixI 'True) (((S1 ('MetaSel ('Just "na_signature") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: S1 ('MetaSel ('Just "na_features") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FeatureVector)) :*: (S1 ('MetaSel ('Just "na_timestamp") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "na_node_id") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Point))) :*: ((S1 ('MetaSel ('Just "na_rgb_color") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 RgbColor) :*: S1 ('MetaSel ('Just "na_alias") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Alias)) :*: (S1 ('MetaSel ('Just "na_addresses") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Address]) :*: (S1 ('MetaSel ('Just "na_unknown_addresses") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteString) :*: S1 ('MetaSel ('Just "na_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream))))))

data ChannelUpdate Source #

The channel_update message (type 258).

Instances

Instances details
NFData ChannelUpdate Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Methods

rnf :: ChannelUpdate -> () #

Generic ChannelUpdate Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Associated Types

type Rep ChannelUpdate 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep ChannelUpdate = D1 ('MetaData "ChannelUpdate" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "ChannelUpdate" 'PrefixI 'True) (((S1 ('MetaSel ('Just "cu_signature") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: (S1 ('MetaSel ('Just "cu_chain_hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainHash) :*: S1 ('MetaSel ('Just "cu_short_channel_id") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 ShortChannelId))) :*: (S1 ('MetaSel ('Just "cu_timestamp") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: (S1 ('MetaSel ('Just "cu_message_flags") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 MessageFlags) :*: S1 ('MetaSel ('Just "cu_channel_flags") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 ChannelFlags)))) :*: ((S1 ('MetaSel ('Just "cu_cltv_expiry_delta") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word16) :*: (S1 ('MetaSel ('Just "cu_htlc_minimum_msat") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 MilliSatoshi) :*: S1 ('MetaSel ('Just "cu_fee_base_msat") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32))) :*: (S1 ('MetaSel ('Just "cu_fee_proportional_millionths") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: (S1 ('MetaSel ('Just "cu_htlc_maximum_msat") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 MilliSatoshi) :*: S1 ('MetaSel ('Just "cu_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream))))))
Show ChannelUpdate Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Eq ChannelUpdate Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep ChannelUpdate Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep ChannelUpdate = D1 ('MetaData "ChannelUpdate" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "ChannelUpdate" 'PrefixI 'True) (((S1 ('MetaSel ('Just "cu_signature") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: (S1 ('MetaSel ('Just "cu_chain_hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainHash) :*: S1 ('MetaSel ('Just "cu_short_channel_id") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 ShortChannelId))) :*: (S1 ('MetaSel ('Just "cu_timestamp") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: (S1 ('MetaSel ('Just "cu_message_flags") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 MessageFlags) :*: S1 ('MetaSel ('Just "cu_channel_flags") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 ChannelFlags)))) :*: ((S1 ('MetaSel ('Just "cu_cltv_expiry_delta") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word16) :*: (S1 ('MetaSel ('Just "cu_htlc_minimum_msat") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 MilliSatoshi) :*: S1 ('MetaSel ('Just "cu_fee_base_msat") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32))) :*: (S1 ('MetaSel ('Just "cu_fee_proportional_millionths") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: (S1 ('MetaSel ('Just "cu_htlc_maximum_msat") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 MilliSatoshi) :*: S1 ('MetaSel ('Just "cu_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream))))))

data AnnouncementSignatures Source #

The announcement_signatures message (type 259).

Instances

Instances details
NFData AnnouncementSignatures Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Methods

rnf :: AnnouncementSignatures -> () #

Generic AnnouncementSignatures Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Associated Types

type Rep AnnouncementSignatures 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep AnnouncementSignatures = D1 ('MetaData "AnnouncementSignatures" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "AnnouncementSignatures" 'PrefixI 'True) ((S1 ('MetaSel ('Just "as_channel_id") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChannelId) :*: S1 ('MetaSel ('Just "as_short_channel_id") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 ShortChannelId)) :*: (S1 ('MetaSel ('Just "as_node_signature") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: (S1 ('MetaSel ('Just "as_bitcoin_signature") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: S1 ('MetaSel ('Just "as_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream)))))
Show AnnouncementSignatures Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Eq AnnouncementSignatures Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep AnnouncementSignatures Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep AnnouncementSignatures = D1 ('MetaData "AnnouncementSignatures" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "AnnouncementSignatures" 'PrefixI 'True) ((S1 ('MetaSel ('Just "as_channel_id") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChannelId) :*: S1 ('MetaSel ('Just "as_short_channel_id") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 ShortChannelId)) :*: (S1 ('MetaSel ('Just "as_node_signature") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: (S1 ('MetaSel ('Just "as_bitcoin_signature") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Signature) :*: S1 ('MetaSel ('Just "as_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream)))))

data QueryShortChannelIds Source #

The query_short_channel_ids message (type 261).

Constructors

QueryShortChannelIds 

Fields

Instances

Instances details
NFData QueryShortChannelIds Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Methods

rnf :: QueryShortChannelIds -> () #

Generic QueryShortChannelIds Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Associated Types

type Rep QueryShortChannelIds 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep QueryShortChannelIds = D1 ('MetaData "QueryShortChannelIds" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "QueryShortChannelIds" 'PrefixI 'True) ((S1 ('MetaSel ('Just "qsci_chain_hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainHash) :*: S1 ('MetaSel ('Just "qsci_short_channel_ids") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [ShortChannelId])) :*: (S1 ('MetaSel ('Just "qsci_query_flags") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe [QueryFlags])) :*: S1 ('MetaSel ('Just "qsci_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream))))
Show QueryShortChannelIds Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Eq QueryShortChannelIds Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep QueryShortChannelIds Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep QueryShortChannelIds = D1 ('MetaData "QueryShortChannelIds" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "QueryShortChannelIds" 'PrefixI 'True) ((S1 ('MetaSel ('Just "qsci_chain_hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainHash) :*: S1 ('MetaSel ('Just "qsci_short_channel_ids") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [ShortChannelId])) :*: (S1 ('MetaSel ('Just "qsci_query_flags") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe [QueryFlags])) :*: S1 ('MetaSel ('Just "qsci_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream))))

data ReplyShortChannelIdsEnd Source #

The reply_short_channel_ids_end message (type 262).

Constructors

ReplyShortChannelIdsEnd 

Fields

Instances

Instances details
NFData ReplyShortChannelIdsEnd Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Methods

rnf :: ReplyShortChannelIdsEnd -> () #

Generic ReplyShortChannelIdsEnd Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Associated Types

type Rep ReplyShortChannelIdsEnd 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep ReplyShortChannelIdsEnd = D1 ('MetaData "ReplyShortChannelIdsEnd" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "ReplyShortChannelIdsEnd" 'PrefixI 'True) (S1 ('MetaSel ('Just "rsce_chain_hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainHash) :*: (S1 ('MetaSel ('Just "rsce_full_information") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "rsce_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream))))
Show ReplyShortChannelIdsEnd Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Eq ReplyShortChannelIdsEnd Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep ReplyShortChannelIdsEnd Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep ReplyShortChannelIdsEnd = D1 ('MetaData "ReplyShortChannelIdsEnd" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "ReplyShortChannelIdsEnd" 'PrefixI 'True) (S1 ('MetaSel ('Just "rsce_chain_hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainHash) :*: (S1 ('MetaSel ('Just "rsce_full_information") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "rsce_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream))))

data QueryChannelRange Source #

The query_channel_range message (type 263).

Constructors

QueryChannelRange 

Fields

Instances

Instances details
NFData QueryChannelRange Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Methods

rnf :: QueryChannelRange -> () #

Generic QueryChannelRange Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Associated Types

type Rep QueryChannelRange 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep QueryChannelRange = D1 ('MetaData "QueryChannelRange" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "QueryChannelRange" 'PrefixI 'True) ((S1 ('MetaSel ('Just "qcr_chain_hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainHash) :*: S1 ('MetaSel ('Just "qcr_first_blocknum") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32)) :*: (S1 ('MetaSel ('Just "qcr_number_of_blocks") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: (S1 ('MetaSel ('Just "qcr_query_option") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe QueryOption)) :*: S1 ('MetaSel ('Just "qcr_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream)))))
Show QueryChannelRange Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Eq QueryChannelRange Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep QueryChannelRange Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep QueryChannelRange = D1 ('MetaData "QueryChannelRange" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "QueryChannelRange" 'PrefixI 'True) ((S1 ('MetaSel ('Just "qcr_chain_hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainHash) :*: S1 ('MetaSel ('Just "qcr_first_blocknum") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32)) :*: (S1 ('MetaSel ('Just "qcr_number_of_blocks") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: (S1 ('MetaSel ('Just "qcr_query_option") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe QueryOption)) :*: S1 ('MetaSel ('Just "qcr_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream)))))

data ReplyChannelRange Source #

The reply_channel_range message (type 264).

Constructors

ReplyChannelRange 

Fields

Instances

Instances details
NFData ReplyChannelRange Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Methods

rnf :: ReplyChannelRange -> () #

Generic ReplyChannelRange Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Associated Types

type Rep ReplyChannelRange 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep ReplyChannelRange = D1 ('MetaData "ReplyChannelRange" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "ReplyChannelRange" 'PrefixI 'True) (((S1 ('MetaSel ('Just "rcr_chain_hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainHash) :*: S1 ('MetaSel ('Just "rcr_first_blocknum") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32)) :*: (S1 ('MetaSel ('Just "rcr_number_of_blocks") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "rcr_sync_complete") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool))) :*: ((S1 ('MetaSel ('Just "rcr_short_channel_ids") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [ShortChannelId]) :*: S1 ('MetaSel ('Just "rcr_timestamps") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe [ChannelUpdateTimestamps]))) :*: (S1 ('MetaSel ('Just "rcr_checksums") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe [ChannelUpdateChecksums])) :*: S1 ('MetaSel ('Just "rcr_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream)))))
Show ReplyChannelRange Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Eq ReplyChannelRange Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep ReplyChannelRange Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep ReplyChannelRange = D1 ('MetaData "ReplyChannelRange" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "ReplyChannelRange" 'PrefixI 'True) (((S1 ('MetaSel ('Just "rcr_chain_hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainHash) :*: S1 ('MetaSel ('Just "rcr_first_blocknum") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32)) :*: (S1 ('MetaSel ('Just "rcr_number_of_blocks") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "rcr_sync_complete") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool))) :*: ((S1 ('MetaSel ('Just "rcr_short_channel_ids") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [ShortChannelId]) :*: S1 ('MetaSel ('Just "rcr_timestamps") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe [ChannelUpdateTimestamps]))) :*: (S1 ('MetaSel ('Just "rcr_checksums") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe [ChannelUpdateChecksums])) :*: S1 ('MetaSel ('Just "rcr_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream)))))

data GossipTimestampFilter Source #

The gossip_timestamp_filter message (type 265).

Constructors

GossipTimestampFilter 

Fields

Instances

Instances details
NFData GossipTimestampFilter Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Methods

rnf :: GossipTimestampFilter -> () #

Generic GossipTimestampFilter Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Associated Types

type Rep GossipTimestampFilter 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep GossipTimestampFilter = D1 ('MetaData "GossipTimestampFilter" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "GossipTimestampFilter" 'PrefixI 'True) ((S1 ('MetaSel ('Just "gtf_chain_hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainHash) :*: S1 ('MetaSel ('Just "gtf_first_timestamp") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32)) :*: (S1 ('MetaSel ('Just "gtf_timestamp_range") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "gtf_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream))))
Show GossipTimestampFilter Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

Eq GossipTimestampFilter Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep GossipTimestampFilter Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Messages

type Rep GossipTimestampFilter = D1 ('MetaData "GossipTimestampFilter" "Lightning.Protocol.BOLT7.Messages" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "GossipTimestampFilter" 'PrefixI 'True) ((S1 ('MetaSel ('Just "gtf_chain_hash") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainHash) :*: S1 ('MetaSel ('Just "gtf_first_timestamp") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32)) :*: (S1 ('MetaSel ('Just "gtf_timestamp_range") 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Just "gtf_tlvs") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvStream))))

Encoding and decoding

encode_message :: Message -> Either EncodeError ByteString Source #

Encode a Message payload (excluding the 2-byte message type; see message_type). Frame the result with encode_envelope, which enforces the 65535-byte message limit.

decode_message :: Word16 -> ByteString -> Either DecodeError Message Source #

Decode a message payload, given its message type (as split off by decode_envelope).

>>> decode_message 260 "\NUL"
Left (DecodeUnknownType 260)

data EncodeError Source #

Why a message failed to encode.

Constructors

EncodeLengthOverflow

a length-prefixed field exceeds 65535 bytes

EncodeInvalidTlvs

a _tlvs field holds a record of a type the message defines

EncodeCountMismatch

query flags, timestamps or checksums don't number one per short channel id

EncodeInvalidAddresses

na_unknown_addresses begins with a descriptor of a known type

Instances

Instances details
NFData EncodeError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Codec

Methods

rnf :: EncodeError -> () #

Generic EncodeError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Codec

Associated Types

type Rep EncodeError 
Instance details

Defined in Lightning.Protocol.BOLT7.Codec

type Rep EncodeError = D1 ('MetaData "EncodeError" "Lightning.Protocol.BOLT7.Codec" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) ((C1 ('MetaCons "EncodeLengthOverflow" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EncodeInvalidTlvs" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "EncodeCountMismatch" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EncodeInvalidAddresses" 'PrefixI 'False) (U1 :: Type -> Type)))
Show EncodeError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Codec

Eq EncodeError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Codec

type Rep EncodeError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Codec

type Rep EncodeError = D1 ('MetaData "EncodeError" "Lightning.Protocol.BOLT7.Codec" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) ((C1 ('MetaCons "EncodeLengthOverflow" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EncodeInvalidTlvs" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "EncodeCountMismatch" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EncodeInvalidAddresses" 'PrefixI 'False) (U1 :: Type -> Type)))

data DecodeError Source #

Why a message failed to decode.

Constructors

DecodeInsufficientBytes

the input ended before a field did

DecodeInvalidPoint

a point lacks a compressed-encoding prefix (0x02 or 0x03)

DecodeInvalidAmount

an amount exceeds 21 million BTC

DecodeInvalidBool

a boolean byte is neither 0 nor 1

DecodeInvalidShortChannelIds

encoded_short_ids lacks an encoding type, or isn't a whole number of short channel ids

DecodeUnknownEncoding !Word8

an encoded array uses an unknown encoding type (type 1, zlib, is no longer allowed)

DecodeCountMismatch

query flags, timestamps or checksums don't number one per short channel id

DecodeTlvError !TlvError

the message's TLV stream is malformed

DecodeInvalidTlvValue !Word64

a known TLV record (of the given type) has a malformed value

DecodeUnknownType !Word16

the message type is not one of BOLT #7's

Instances

Instances details
NFData DecodeError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Codec

Methods

rnf :: DecodeError -> () #

Generic DecodeError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Codec

Associated Types

type Rep DecodeError 
Instance details

Defined in Lightning.Protocol.BOLT7.Codec

type Rep DecodeError = D1 ('MetaData "DecodeError" "Lightning.Protocol.BOLT7.Codec" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (((C1 ('MetaCons "DecodeInsufficientBytes" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DecodeInvalidPoint" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "DecodeInvalidAmount" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DecodeInvalidBool" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DecodeInvalidShortChannelIds" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "DecodeUnknownEncoding" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word8)) :+: C1 ('MetaCons "DecodeCountMismatch" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "DecodeTlvError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvError)) :+: (C1 ('MetaCons "DecodeInvalidTlvValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)) :+: C1 ('MetaCons "DecodeUnknownType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word16))))))
Show DecodeError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Codec

Eq DecodeError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Codec

type Rep DecodeError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Codec

type Rep DecodeError = D1 ('MetaData "DecodeError" "Lightning.Protocol.BOLT7.Codec" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (((C1 ('MetaCons "DecodeInsufficientBytes" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DecodeInvalidPoint" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "DecodeInvalidAmount" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "DecodeInvalidBool" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DecodeInvalidShortChannelIds" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "DecodeUnknownEncoding" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word8)) :+: C1 ('MetaCons "DecodeCountMismatch" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "DecodeTlvError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 TlvError)) :+: (C1 ('MetaCons "DecodeInvalidTlvValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word64)) :+: C1 ('MetaCons "DecodeUnknownType" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Word16))))))

Payloads

encode_channel_announcement :: ChannelAnnouncement -> Either EncodeError ByteString Source #

Encode a ChannelAnnouncement payload. Fails if the features exceed 65535 bytes.

encode_node_announcement :: NodeAnnouncement -> Either EncodeError ByteString Source #

Encode a NodeAnnouncement payload. Fails if the features or the addresses exceed 65535 bytes, or if na_unknown_addresses begins with a descriptor of a known type.

decode_node_announcement :: ByteString -> Either DecodeError NodeAnnouncement Source #

Decode a NodeAnnouncement payload.

Address descriptors are parsed up to the first one of an unknown type; it and the bytes after it are kept in na_unknown_addresses. A truncated descriptor of a known type is an error.

decode_channel_update :: ByteString -> Either DecodeError ChannelUpdate Source #

Decode a ChannelUpdate payload.

htlc_maximum_msat is always present; the must_be_one bit of message_flags is kept but not interpreted.

encode_query_short_channel_ids :: QueryShortChannelIds -> Either EncodeError ByteString Source #

Encode a QueryShortChannelIds payload. Fails if the short channel ids exceed the u16 length limit (8191 of them), if the query flags don't number one per short channel id, or if qsci_tlvs holds a record of type 1.

decode_query_short_channel_ids :: ByteString -> Either DecodeError QueryShortChannelIds Source #

Decode a QueryShortChannelIds payload.

Fails on an unknown encoding type (including the deprecated zlib encoding), on encoded_short_ids that isn't a whole number of short channel ids, and on query flags that don't number one per short channel id.

>>> let zlib = BS.replicate 32 0 <> "\NUL\STX\SOHx"
>>> decode_query_short_channel_ids zlib
Left (DecodeUnknownEncoding 1)

decode_reply_short_channel_ids_end :: ByteString -> Either DecodeError ReplyShortChannelIdsEnd Source #

Decode a ReplyShortChannelIdsEnd payload.

>>> decode_reply_short_channel_ids_end (BS.replicate 32 0 <> "\STX")
Left DecodeInvalidBool

encode_reply_channel_range :: ReplyChannelRange -> Either EncodeError ByteString Source #

Encode a ReplyChannelRange payload. Fails if the short channel ids exceed the u16 length limit (8191 of them), if the timestamps or checksums don't number one per short channel id, or if rcr_tlvs holds a record of type 1 or 3.

decode_reply_channel_range :: ByteString -> Either DecodeError ReplyChannelRange Source #

Decode a ReplyChannelRange payload.

Fails on an unknown encoding type (including the deprecated zlib encoding), on encoded_short_ids that isn't a whole number of short channel ids, and on timestamps or checksums that don't number one per short channel id.

Signatures and checksums

channel_announcement_hash :: ChannelAnnouncement -> Either EncodeError ByteString Source #

The digest the four signatures of a ChannelAnnouncement sign: the double SHA-256 of its encoding from offset 256 (after the signatures) to the end. Fails as encode_channel_announcement does.

node_announcement_hash :: NodeAnnouncement -> Either EncodeError ByteString Source #

The digest the signature of a NodeAnnouncement signs: the double SHA-256 of its encoding after the signature. Fails as encode_node_announcement does.

channel_update_hash :: ChannelUpdate -> ByteString Source #

The digest the signature of a ChannelUpdate signs: the double SHA-256 of its encoding after the signature.

verify_channel_announcement :: ChannelAnnouncement -> Bool Source #

Verify the four signatures of a ChannelAnnouncement: both node signatures and both bitcoin signatures, each over channel_announcement_hash under the corresponding key.

As with libsecp256k1, signatures must be in low-s form. A key that isn't a point on the curve fails verification.

verify_node_announcement :: NodeAnnouncement -> Bool Source #

Verify the signature of a NodeAnnouncement under its node id.

As with libsecp256k1, the signature must be in low-s form.

verify_channel_update :: Point -> ChannelUpdate -> Bool Source #

Verify the signature of a ChannelUpdate under the given node id.

The key is that of the channel's ChannelAnnouncement selected by the update's direction: ca_node_id_1 for NodeOne, ca_node_id_2 for NodeTwo. As with libsecp256k1, the signature must be in low-s form.

channel_update_checksum :: ChannelUpdate -> Word32 Source #

The checksum of a ChannelUpdate, as used in the checksums_tlv of reply_channel_range: the CRC-32C (RFC 3720) of the update without its signature and timestamp. Extension records are included.

Validation

data ValidationError Source #

A rule a message breaks.

Constructors

ValidateNodeIdOrdering

node_id_1 is not lexicographically less than node_id_2

ValidateMultipleDns

more than one DNS hostname descriptor

ValidateHtlcAmounts

htlc_minimum_msat exceeds htlc_maximum_msat

ValidateZeroBlocks

number_of_blocks is 0

ValidateBlockOverflow

the block range extends past block 2^32 - 1

ValidateScidNotAscending

short channel ids are not in strictly ascending order

Instances

Instances details
NFData ValidationError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Validate

Methods

rnf :: ValidationError -> () #

Generic ValidationError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Validate

Associated Types

type Rep ValidationError 
Instance details

Defined in Lightning.Protocol.BOLT7.Validate

type Rep ValidationError = D1 ('MetaData "ValidationError" "Lightning.Protocol.BOLT7.Validate" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) ((C1 ('MetaCons "ValidateNodeIdOrdering" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ValidateMultipleDns" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ValidateHtlcAmounts" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ValidateZeroBlocks" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ValidateBlockOverflow" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ValidateScidNotAscending" 'PrefixI 'False) (U1 :: Type -> Type))))
Show ValidationError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Validate

Eq ValidationError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Validate

type Rep ValidationError Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Validate

type Rep ValidationError = D1 ('MetaData "ValidationError" "Lightning.Protocol.BOLT7.Validate" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) ((C1 ('MetaCons "ValidateNodeIdOrdering" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ValidateMultipleDns" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ValidateHtlcAmounts" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ValidateZeroBlocks" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ValidateBlockOverflow" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ValidateScidNotAscending" 'PrefixI 'False) (U1 :: Type -> Type))))

validate_channel_announcement :: ChannelAnnouncement -> Either ValidationError () Source #

Check that node_id_1 is lexicographically less than node_id_2; a receiver must ignore the message otherwise.

Signatures and feature bits are not checked here; see verify_channel_announcement and ppad-bolt9's validate_remote.

validate_node_announcement :: NodeAnnouncement -> Either ValidationError () Source #

Check that at most one DNS hostname is announced; a receiver must not forward the message otherwise.

Descriptors a receiver should merely ignore (Tor v2, port 0, a hostname that isn't ASCII) are left to usable_addresses.

validate_channel_update :: ChannelUpdate -> Either ValidationError () Source #

Check that htlc_minimum_msat does not exceed htlc_maximum_msat; a receiver should not route through the channel otherwise.

validate_query_short_channel_ids :: QueryShortChannelIds -> Either ValidationError () Source #

Check that the short channel ids are in strictly ascending order, as their encoding requires.

validate_query_channel_range :: QueryChannelRange -> Either ValidationError () Source #

Check that number_of_blocks is at least 1, as the sender must ensure, and that the range ends at or before block 2^32 - 1 (a library rule: such a range can't be represented).

validate_reply_channel_range :: ReplyChannelRange -> Either ValidationError () Source #

Check that the short channel ids are in strictly ascending order, as their encoding requires.

channel_update flags

newtype MessageFlags Source #

The message_flags byte of a channel_update: bit 0 is must_be_one, bit 1 is dont_forward, and the other bits are unassigned. Every byte is a valid value; unassigned bits are kept so that re-encoding reproduces the signed bytes.

Constructors

MessageFlags Word8 

Instances

Instances details
NFData MessageFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: MessageFlags -> () #

Generic MessageFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep MessageFlags 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep MessageFlags = D1 ('MetaData "MessageFlags" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "MessageFlags" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word8)))
Show MessageFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq MessageFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep MessageFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep MessageFlags = D1 ('MetaData "MessageFlags" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "MessageFlags" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word8)))

data Forwarding Source #

Whether a channel_update may be relayed to other peers (the dont_forward bit).

Constructors

Forward

dont_forward is 0

DontForward

dont_forward is 1, as for unannounced channels

Instances

Instances details
NFData Forwarding Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: Forwarding -> () #

Generic Forwarding Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep Forwarding 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep Forwarding = D1 ('MetaData "Forwarding" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "Forward" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DontForward" 'PrefixI 'False) (U1 :: Type -> Type))
Show Forwarding Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq Forwarding Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Ord Forwarding Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep Forwarding Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep Forwarding = D1 ('MetaData "Forwarding" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "Forward" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DontForward" 'PrefixI 'False) (U1 :: Type -> Type))

message_flags :: Forwarding -> MessageFlags Source #

The MessageFlags an origin node sets: must_be_one set, the given dont_forward bit, and no unassigned bits.

>>> message_flags DontForward
MessageFlags 3

message_flags_forwarding :: MessageFlags -> Forwarding Source #

The dont_forward bit of MessageFlags.

>>> message_flags_forwarding (MessageFlags 0x01)
Forward

has_must_be_one :: MessageFlags -> Bool Source #

Whether the must_be_one bit is set. Senders must set it; receivers ignore it.

>>> has_must_be_one (MessageFlags 0x00)
False

newtype ChannelFlags Source #

The channel_flags byte of a channel_update: bit 0 is direction, bit 1 is disable, and the other bits are unassigned. Every byte is a valid value; unassigned bits are kept so that re-encoding reproduces the signed bytes.

Constructors

ChannelFlags Word8 

Instances

Instances details
NFData ChannelFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: ChannelFlags -> () #

Generic ChannelFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep ChannelFlags 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep ChannelFlags = D1 ('MetaData "ChannelFlags" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "ChannelFlags" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word8)))
Show ChannelFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq ChannelFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep ChannelFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep ChannelFlags = D1 ('MetaData "ChannelFlags" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "ChannelFlags" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word8)))

data Direction Source #

The node a channel_update originates from.

Constructors

NodeOne

node_id_1 (direction is 0)

NodeTwo

node_id_2 (direction is 1)

Instances

Instances details
NFData Direction Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: Direction -> () #

Generic Direction Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep Direction 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep Direction = D1 ('MetaData "Direction" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "NodeOne" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NodeTwo" 'PrefixI 'False) (U1 :: Type -> Type))
Show Direction Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq Direction Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Ord Direction Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep Direction Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep Direction = D1 ('MetaData "Direction" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "NodeOne" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "NodeTwo" 'PrefixI 'False) (U1 :: Type -> Type))

data ChannelStatus Source #

Whether a channel direction is usable.

Constructors

Enabled

disable is 0

Disabled

disable is 1

Instances

Instances details
NFData ChannelStatus Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: ChannelStatus -> () #

Generic ChannelStatus Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep ChannelStatus 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep ChannelStatus = D1 ('MetaData "ChannelStatus" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "Enabled" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Disabled" 'PrefixI 'False) (U1 :: Type -> Type))
Show ChannelStatus Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq ChannelStatus Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Ord ChannelStatus Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep ChannelStatus Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep ChannelStatus = D1 ('MetaData "ChannelStatus" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "Enabled" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Disabled" 'PrefixI 'False) (U1 :: Type -> Type))

channel_flags :: Direction -> ChannelStatus -> ChannelFlags Source #

The ChannelFlags for the given direction and status, with no unassigned bits set.

>>> channel_flags NodeTwo Disabled
ChannelFlags 3

channel_flags_direction :: ChannelFlags -> Direction Source #

The direction bit of ChannelFlags.

>>> channel_flags_direction (ChannelFlags 0x05)
NodeTwo

channel_flags_status :: ChannelFlags -> ChannelStatus Source #

The disable bit of ChannelFlags.

>>> channel_flags_status (ChannelFlags 0x02)
Disabled

node_announcement fields

data RgbColor Source #

A node's colour: red, green and blue.

Constructors

RgbColor !Word8 !Word8 !Word8 

Instances

Instances details
NFData RgbColor Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: RgbColor -> () #

Generic RgbColor Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep RgbColor 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep RgbColor = D1 ('MetaData "RgbColor" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "RgbColor" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word8) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word8) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word8))))

Methods

from :: RgbColor -> Rep RgbColor x #

to :: Rep RgbColor x -> RgbColor #

Show RgbColor Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq RgbColor Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep RgbColor Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep RgbColor = D1 ('MetaData "RgbColor" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "RgbColor" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word8) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word8) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word8))))

data Alias Source #

A 32-byte node alias. Origin nodes should use UTF-8 padded with zero bytes, but receivers must accept any bytes.

Instances

Instances details
NFData Alias Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: Alias -> () #

Generic Alias Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep Alias 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep Alias = D1 ('MetaData "Alias" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "Alias" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

Methods

from :: Alias -> Rep Alias x #

to :: Rep Alias x -> Alias #

Show Alias Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

showsPrec :: Int -> Alias -> ShowS #

show :: Alias -> String #

showList :: [Alias] -> ShowS #

Eq Alias Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

(==) :: Alias -> Alias -> Bool #

(/=) :: Alias -> Alias -> Bool #

type Rep Alias Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep Alias = D1 ('MetaData "Alias" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "Alias" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

alias :: ByteString -> Maybe Alias Source #

Construct an Alias from exactly 32 bytes.

>>> alias "too short"
Nothing

un_alias :: Alias -> ByteString Source #

The bytes of an Alias.

Addresses

data Address Source #

An address descriptor of a known type, with its port where it has one.

Constructors

AddrIPv4 !IPv4Addr !Word16

type 1

AddrIPv6 !IPv6Addr !Word16

type 2

AddrTorV2 !TorV2Addr

type 3 (deprecated)

AddrTorV3 !TorV3Addr !Word16

type 4

AddrDNS !Hostname !Word16

type 5

Instances

Instances details
NFData Address Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: Address -> () #

Generic Address Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

from :: Address -> Rep Address x #

to :: Rep Address x -> Address #

Show Address Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq Address Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

(==) :: Address -> Address -> Bool #

(/=) :: Address -> Address -> Bool #

type Rep Address Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

usable_addresses :: [Address] -> [Address] Source #

The addresses a receiver should connect to, per the BOLT #7 receiver rules: drops Tor v2 descriptors, descriptors with port 0, DNS hostnames that are empty or not ASCII, and every DNS descriptor after the first.

data IPv4Addr Source #

A 4-byte IPv4 address.

Instances

Instances details
NFData IPv4Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: IPv4Addr -> () #

Generic IPv4Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep IPv4Addr 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep IPv4Addr = D1 ('MetaData "IPv4Addr" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "IPv4Addr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

Methods

from :: IPv4Addr -> Rep IPv4Addr x #

to :: Rep IPv4Addr x -> IPv4Addr #

Show IPv4Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq IPv4Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep IPv4Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep IPv4Addr = D1 ('MetaData "IPv4Addr" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "IPv4Addr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

ipv4_addr :: ByteString -> Maybe IPv4Addr Source #

Construct an IPv4Addr from exactly 4 bytes.

>>> ipv4_addr "\127\NUL\NUL\SOH"
Just (IPv4Addr "\DEL\NUL\NUL\SOH")

data IPv6Addr Source #

A 16-byte IPv6 address.

Instances

Instances details
NFData IPv6Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: IPv6Addr -> () #

Generic IPv6Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep IPv6Addr 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep IPv6Addr = D1 ('MetaData "IPv6Addr" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "IPv6Addr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

Methods

from :: IPv6Addr -> Rep IPv6Addr x #

to :: Rep IPv6Addr x -> IPv6Addr #

Show IPv6Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq IPv6Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep IPv6Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep IPv6Addr = D1 ('MetaData "IPv6Addr" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "IPv6Addr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

ipv6_addr :: ByteString -> Maybe IPv6Addr Source #

Construct an IPv6Addr from exactly 16 bytes.

data TorV2Addr Source #

The 12 data bytes of a deprecated Tor v2 address descriptor (type 3). They are kept, uninterpreted, so that re-encoding reproduces the signed bytes.

Instances

Instances details
NFData TorV2Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: TorV2Addr -> () #

Generic TorV2Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep TorV2Addr 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep TorV2Addr = D1 ('MetaData "TorV2Addr" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "TorV2Addr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))
Show TorV2Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq TorV2Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep TorV2Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep TorV2Addr = D1 ('MetaData "TorV2Addr" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "TorV2Addr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

tor_v2_addr :: ByteString -> Maybe TorV2Addr Source #

Construct a TorV2Addr from exactly 12 bytes.

data TorV3Addr Source #

A 35-byte Tor v3 onion service address: a 32-byte ed25519 public key, a 2-byte checksum and a 1-byte version.

Instances

Instances details
NFData TorV3Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: TorV3Addr -> () #

Generic TorV3Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep TorV3Addr 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep TorV3Addr = D1 ('MetaData "TorV3Addr" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "TorV3Addr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))
Show TorV3Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq TorV3Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep TorV3Addr Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep TorV3Addr = D1 ('MetaData "TorV3Addr" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "TorV3Addr" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

tor_v3_addr :: ByteString -> Maybe TorV3Addr Source #

Construct a TorV3Addr from exactly 35 bytes.

data Hostname Source #

A DNS hostname of at most 255 bytes (the limit of its length byte).

BOLT #7 requires hostnames to be ASCII, with other characters Punycode-encoded, but receivers keep whatever bytes they are given; see is_ascii_hostname.

Instances

Instances details
NFData Hostname Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: Hostname -> () #

Generic Hostname Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep Hostname 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep Hostname = D1 ('MetaData "Hostname" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "Hostname" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

Methods

from :: Hostname -> Rep Hostname x #

to :: Rep Hostname x -> Hostname #

Show Hostname Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq Hostname Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep Hostname Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep Hostname = D1 ('MetaData "Hostname" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "Hostname" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString)))

hostname :: ByteString -> Maybe Hostname Source #

Construct a Hostname from at most 255 bytes.

>>> hostname "ln.example.com"
Just (Hostname "ln.example.com")
>>> hostname (BS.replicate 256 0x61)
Nothing

is_ascii_hostname :: Hostname -> Bool Source #

Whether a Hostname is non-empty and ASCII, as BOLT #7 requires.

>>> fmap is_ascii_hostname (hostname "caf\233")
Just False

Query fields

newtype QueryFlags Source #

A query_flags bitfield, sent for each short channel id in a query_short_channel_ids. Every value is valid; unassigned bits are kept.

Constructors

QueryFlags Word64 

Instances

Instances details
NFData QueryFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: QueryFlags -> () #

Generic QueryFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep QueryFlags 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep QueryFlags = D1 ('MetaData "QueryFlags" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "QueryFlags" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))
Show QueryFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq QueryFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep QueryFlags Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep QueryFlags = D1 ('MetaData "QueryFlags" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "QueryFlags" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

data QueryFlag Source #

The assigned bits of QueryFlags.

Constructors

WantChannelAnnouncement

bit 0

WantChannelUpdate1

bit 1: the channel_update of node 1

WantChannelUpdate2

bit 2: the channel_update of node 2

WantNodeAnnouncement1

bit 3: the node_announcement of node 1

WantNodeAnnouncement2

bit 4: the node_announcement of node 2

Instances

Instances details
NFData QueryFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: QueryFlag -> () #

Bounded QueryFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Enum QueryFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Generic QueryFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep QueryFlag 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep QueryFlag = D1 ('MetaData "QueryFlag" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) ((C1 ('MetaCons "WantChannelAnnouncement" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "WantChannelUpdate1" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "WantChannelUpdate2" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "WantNodeAnnouncement1" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "WantNodeAnnouncement2" 'PrefixI 'False) (U1 :: Type -> Type))))
Show QueryFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq QueryFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Ord QueryFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep QueryFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep QueryFlag = D1 ('MetaData "QueryFlag" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) ((C1 ('MetaCons "WantChannelAnnouncement" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "WantChannelUpdate1" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "WantChannelUpdate2" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "WantNodeAnnouncement1" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "WantNodeAnnouncement2" 'PrefixI 'False) (U1 :: Type -> Type))))

query_flags :: [QueryFlag] -> QueryFlags Source #

The QueryFlags with exactly the given bits set.

>>> query_flags [WantChannelAnnouncement, WantChannelUpdate2]
QueryFlags 5

has_query_flag :: QueryFlag -> QueryFlags -> Bool Source #

Whether the given bit is set.

>>> has_query_flag WantChannelUpdate1 (QueryFlags 2)
True

newtype QueryOption Source #

The query_option_flags bitfield of a query_channel_range. Every value is valid; unassigned bits are kept.

Constructors

QueryOption Word64 

Instances

Instances details
NFData QueryOption Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: QueryOption -> () #

Generic QueryOption Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep QueryOption 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep QueryOption = D1 ('MetaData "QueryOption" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "QueryOption" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))
Show QueryOption Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq QueryOption Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep QueryOption Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep QueryOption = D1 ('MetaData "QueryOption" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'True) (C1 ('MetaCons "QueryOption" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))

data QueryOptionFlag Source #

The assigned bits of QueryOption.

Constructors

WantTimestamps

bit 0

WantChecksums

bit 1

Instances

Instances details
NFData QueryOptionFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: QueryOptionFlag -> () #

Bounded QueryOptionFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Enum QueryOptionFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Generic QueryOptionFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep QueryOptionFlag 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep QueryOptionFlag = D1 ('MetaData "QueryOptionFlag" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "WantTimestamps" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "WantChecksums" 'PrefixI 'False) (U1 :: Type -> Type))
Show QueryOptionFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq QueryOptionFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Ord QueryOptionFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep QueryOptionFlag Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep QueryOptionFlag = D1 ('MetaData "QueryOptionFlag" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "WantTimestamps" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "WantChecksums" 'PrefixI 'False) (U1 :: Type -> Type))

query_option :: [QueryOptionFlag] -> QueryOption Source #

The QueryOption with exactly the given bits set.

>>> query_option [WantTimestamps, WantChecksums]
QueryOption 3

has_query_option :: QueryOptionFlag -> QueryOption -> Bool Source #

Whether the given bit is set.

>>> has_query_option WantChecksums (QueryOption 1)
False

data ChannelUpdateTimestamps Source #

The timestamps of a channel's latest channel_updates, from node_id_1 and node_id_2 (0 where there is none).

Instances

Instances details
NFData ChannelUpdateTimestamps Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: ChannelUpdateTimestamps -> () #

Generic ChannelUpdateTimestamps Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep ChannelUpdateTimestamps 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep ChannelUpdateTimestamps = D1 ('MetaData "ChannelUpdateTimestamps" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "ChannelUpdateTimestamps" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32)))
Show ChannelUpdateTimestamps Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq ChannelUpdateTimestamps Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep ChannelUpdateTimestamps Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep ChannelUpdateTimestamps = D1 ('MetaData "ChannelUpdateTimestamps" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "ChannelUpdateTimestamps" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32)))

data ChannelUpdateChecksums Source #

The checksums of a channel's latest channel_updates, from node_id_1 and node_id_2 (0 where there is none).

Instances

Instances details
NFData ChannelUpdateChecksums Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Methods

rnf :: ChannelUpdateChecksums -> () #

Generic ChannelUpdateChecksums Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Associated Types

type Rep ChannelUpdateChecksums 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep ChannelUpdateChecksums = D1 ('MetaData "ChannelUpdateChecksums" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "ChannelUpdateChecksums" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32)))
Show ChannelUpdateChecksums Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

Eq ChannelUpdateChecksums Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep ChannelUpdateChecksums Source # 
Instance details

Defined in Lightning.Protocol.BOLT7.Types

type Rep ChannelUpdateChecksums = D1 ('MetaData "ChannelUpdateChecksums" "Lightning.Protocol.BOLT7.Types" "ppad-bolt7-0.1.1-LkNbqSjp5I6927WSU3Yi65" 'False) (C1 ('MetaCons "ChannelUpdateChecksums" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 Word32)))

Short channel ids

format_short_channel_id :: ShortChannelId -> String Source #

Render a short channel id in the human-readable format of BOLT #7: block height, transaction index and output index, in decimal, separated by x.

>>> fmap format_short_channel_id (short_channel_id 539268 845 1)
Just "539268x845x1"