Skip to main content

Routing

RGB v0.11 line (rgb-cmd 0.11.1)

This describes the RGB Lightning Node (RLN) and its rust-lightning fork, which is alpha software. Read RGB on Lightning first. See Two RGB lines.

An RGB payment can cross several channels, as long as every hop has a channel with the same asset and enough liquidity in it. Alice → Bob → Carol works when Alice–Bob and Bob–Carol both hold contract C. Each hop forwards the asset amount, and at least 3,000 sats along with it (RLN's HTLC minimum).

What the fork (RGB-Tools/rust-lightning, branch rgb, commit of 2026-08-07) changes:

  • Payment: an ordinary payment carries one (contract ID, amount) pair end to end (RouteParameters.rgb_payment and RouteHop.rgb_payment, lightning/src/routing/router.rs). The onion (rgb_payment_to_forward) and the update_add_htlc message carry it too (lightning/src/ln/msgs.rs). No state proofs travel along the route. Channel peers exchange RGB data for their own commitment updates.
  • Gossip: channel announcements add the channel's contract_id, and channel updates add htlc_maximum_rgb (lightning/src/ln/msgs.rs, stored in lightning/src/routing/gossip.rs). The router uses them to skip channels with the wrong asset or not enough of it. Route hints in invoices carry htlc_maximum_rgb too.
  • Fees are paid in msat only, set per channel with fee_base_msat and fee_proportional_millionths. Routing fees in the asset don't exist.
  • No split asset amounts: the router skips any channel that can't carry the whole RGB amount (effective_capacity_rgb, router.rs), so an asset amount isn't split across paths. RLN's own route builder, used for swaps, also sets max_path_count: 1 (src/utils.rs). RLN doesn't use trampoline routing.
  • No cross-asset invoices. To exchange one asset for another, or for BTC, use RLN's maker/taker swaps: the maker calls POST /makerinit and gets a swap string, the taker accepts it with POST /taker, and the maker completes it with POST /makerexecute (with the swap string, payment_secret and taker_pubkey). The maker then sends one circular payment, maker → taker → maker: the hops of one leg carry one asset and the hops of the other leg carry the other (maker_execute in src/routes.rs). Both legs are one payment with one payment hash, so they settle or fail together.

Privacy is as in Lightning: onion routing hides the sender and recipient from intermediate hops. Every hop learns the asset (contract ID) and the amount it forwards, and public channels announce their asset in gossip.

Paying​

There is no route query endpoint. Routing happens inside the payment calls:

# pay a BOLT11 invoice that carries RGB fields
curl -X POST -H "Content-type: application/json" \
-d '{"invoice": "<lnbcrt…>"}' http://localhost:3001/sendpayment
# spontaneous payment to a node pubkey
curl -X POST -H "Content-type: application/json" \
-d '{"dest_pubkey": "<pubkey>", "amt_msat": 3000000, "asset_id": "<asset_id>", "asset_amount": 10}' \
http://localhost:3001/keysend

GET /listpayments and POST /getpayment show the result. GET /networkinfo returns the network and the block height, and GET /nodeinfo returns the counts of known nodes and channels.