Skip to content
Dr. Maxim Orlovsky edited this page Jun 21, 2022 · 3 revisions

This wiki summarizes technical documentation for LNP/BP nodes.

Node interfaces

Each of LNP/BP Nodes provides a couple of network interfaces.

First of all, the interfaces divide into public P2P network connections and internal RPC communications.

For P2P networks, nodes can bind to a local port and listen for incoming connections - or can actively connect to a remote peer if they are given appropriate command via command-line options, configuration file or through RPC API interface.

Public P2P network connections used by nodes:

Network Protocol Encoding Encryption Default port Node Service
Lightning network, Bolt subnetwork BOLT-1 Lightning Brontide (BOLT-8) 9735 LNP Node peerd
Lightning network, Bifrost subnetwork LNPBP-50 Strict (LNPBP-7) Brontozaur (LNPBP-15, 18) 9999 LNP Node peerd
Bitcoin Bitcoin wire Bitcoin consensus - 8333 BP Node wired

RPC interfaces are used for two main purposes:

  1. Communications between services
  2. API for clients

All RPC interfaces use the following stack of protocols (implemented by [rust-internet2](https://github.com/Internet2-WG/rust-internet2 library):

Layer Standard
Connectivity & framing ZMTP
Session ZMQ
Encryption None or Brontozaur (LNPBP-18)
Encoding Strict (LNPBP-7)

Since all RPC connections are based on ZMQ they can run through

  1. TCP port (in plain or on top of Tor), used by remote client-server connections and always encrypted with Brontozaur protocol.
  2. Local IPC socket file, used when different services runs as separate processes.
  3. Shared memory communications, when microservices runs as threads or tasks within the same process.

RPC sessions are managed with rust-microservices library. The library provides two main formats for RPC sessions:

  1. Client/server RPC (or simply "RPC session"), where client sends requests and awaits until the server replies before sending next request;
  2. ESB RPC (or simply "ESB session"), where microservices can asynchoneusly send each other messages without waiting for the response.
Node Bus name Type Default socket TCP port Cmd flag Purpose
LNP Node MSG ESB ~/.lnp/msg -M Messages from and to LN handled through peerd to other services
LNP Node CTL ESB ~/.lnp/ctl -X Control messages from managing daemon (lnpd) to other LNP Node serivces
LNP Node CHNL ESB ~/.lnp/chnl -C Messages between channeld service and channel extension services
LNP Node API ESB ~/.lnp/api 62962 -R API for clients connecting the node
RGB Node CTL ESB ~/.rgb/ctl -X Control messages from managing daemon rgbd to containerd
RGB Node API ESB ~/.rgb/api 63963 -R API for clients connecting the node
BP Node BLOCKS ESB ~/.bp/blocks -N Notifications about new mined blocks to subscriber services
BP Node API ESB ~/.bp/api 61961 -R API for clients connecting the node
BP Node SIGN ESB ~/.bp/sign -K Signer service
Storm Node STORE RPC ~/.storm/store 60960 -S Storage RPC API for all services requiring persistence
Storm Node STORM ESB ~/.storm/storm -E Messages for Storm applications run as extension services
Storm Node API ESB ~/.storm/api 64964 -R API for clients connecting the node
Clone this wiki locally