Skip to main content

Running a Fedimint Lightning Gateway

Lightning Gateways are users of a Fedimint who also run lightning nodes, and act as lightning service providers to other users of the Federation. Lightning Gateways can service many Fedimints, and Fedimints can be serviced by many Lightning Gateways.

TODO: Add a diagram here

Running a Lightning Gateway involves running a Lightning node and requires active management of channels, liquidity, and managing ecash balances. Fedimint users pay the gateway a fee to send or receive lightning on the users' behalfs through a contracting mechanism with the Fedimint consensus. This means that the gateway is not a custodian of the Fedimint, and is not a part of the Fedimint consensus. The gateway is a user of the Fedimint, and is paid by the Fedimint users to provide lightning services.

How this Guide is Organized

We've organized this guide into two parts:

  1. Spinning up a Lightning Node
  2. Spinning up a Gateway

The first part will walk you through normal bitcoin and lightning tooling of setting up a node. We'll use a Mutinynet Faucet and signet coins, but everything should work the same if you're using this as reference for running a mainnet node.

The second part will walk you through spinning up a Fedimint Gateway, which is the client software that can create Lightning Contracts to facilitate Fedimint User payments between ecash and Lightning.

We'll use Clovyr throughout and a fork of Thunderhub that we've added Fedimint ecash tooling to for easier liquidity management. If you already knkow how Bitcoin and Lightning node management & channel liquidity works, feel free to skip to part 2.

Let's get started.