Skip to content
Go back

How the Lightning Network Works

How the Lightning Network Works

The Engine Behind Instant, Global Bitcoin Payments

“Bitcoin is the foundation. Lightning is the superhighway.”

In the last post, we explored how Lightning transforms Bitcoin into a spendable, global currency—fast, cheap, and borderless.

Now, we take the next step:
How does the Lightning Network actually work under the hood?

Let’s break it down into human terms—from the basics of channels and liquidity to the elegant mechanics of routing and security.

Whether you’re a builder, educator, or merchant, this post gives you a full mental model of what makes Lightning tick.


⚡ What Is the Lightning Network?

Lightning is a Layer 2 payment protocol built on top of Bitcoin’s base layer.
It solves Bitcoin’s scaling limitations by moving most activity off-chain—while retaining Bitcoin’s security guarantees.

Think of it like this:

Instead of writing every payment into the Bitcoin blockchain, users open payment channels and transact off-chain.

Only the final result is settled on-chain—like closing a tab at a café.


🔐 Step 1: Opening a Channel

To use Lightning, two parties must first open a channel between them.

Kai opens a channel with Alice.
He deposits 0.01 BTC into the channel.
Now he can send Alice 1000 small payments instantly.

The channel stays open until they decide to close it and settle back to the main chain.


🧭 Step 2: Transacting Through Channels

Once a channel is open, you don’t need to wait for confirmations.

Each new payment is:

These off-chain updates allow millions of micro-payments per second, at fraction-of-a-sen fees.

But here’s the real magic…

You don’t need a direct channel to everyone. Lightning can route your payment through multiple nodes—just like the internet.


🔄 Step 3: Routing Payments

Let’s say you want to send sats to someone you’ve never met.

As long as there’s a path through other connected nodes, the payment will be routed automatically.

Kai → Bob → Carol → Dan

Each node in the path temporarily forwards the payment, and receives a tiny routing fee.

The route is found automatically using:

Lightning is like Waze for money—constantly finding the best route.


🧮 But What About Trust?

Lightning uses HTLCs (Hashed Time Locked Contracts)—a form of smart contract that:

Each node only forwards the payment if the next node successfully receives it. It’s atomic: all or nothing.

You don’t need to trust intermediaries—you trust math.


💧 Liquidity: The Heart of Lightning

Here’s where many new users get confused: You need liquidity for payments to succeed.

Two kinds of liquidity matter:

  1. Outbound Liquidity = how much you can send
  2. Inbound Liquidity = how much you can receive

For example:

This is why Liquidity Service Providers (LSPs) matter—they help new users get inbound liquidity and route payments efficiently.


🧠 Visualizing a Payment Flow

Let’s break down a sample payment:

1. Kai wants to pay RM10 worth of sats to Nabil.
2. Kai doesn’t have a direct channel with Nabil.
3. Lightning finds a route:
   Kai → NodeX → NodeY → Nabil
4. Each node along the path has:
   - Enough liquidity
   - Reasonable fee
   - Good uptime
5. Payment reaches Nabil in 0.5 seconds.
6. Each routing node earns 1–10 sats in fee.

Nobody knows the full route except the sender. The payment is onion-routed—private, fast, and trustless.


🔧 Channel Management: Behind the Scenes

If you run your own node (as an LSP or enthusiast), you need to manage channels:

Channel management is part art, part math, and part business.

Think of it like running a mini bank—except you don’t lend, you route.


💸 Who Pays Routing Fees?

You can earn Bitcoin simply by keeping your channels open and balanced. This is the essence of being a Lightning Service Provider (LSP).


🛠️ What Tools Power the Network?

Popular node implementations:

Node dashboards and tools:

Cloud-based hosting:


🇲🇾 Lightning in Malaysia: The Frontier

Right now, Lightning adoption in Malaysia is early—but growing:

You don’t need a license to be sovereign. You only need knowledge + sats + uptime.


📦 TL;DR: Lightning’s Core Building Blocks

ConceptDescription
ChannelSmart contract that holds BTC between two parties
Inbound/OutboundDetermines if you can receive or send BTC
RoutingLightning finds path through connected nodes
HTLCSecurity mechanism for trustless forwarding
LSPProvides liquidity and earns from routing
Onion RoutingPrivacy via encrypted multi-hop payments
RebalancingRedistributes funds to maintain healthy channels
Routing FeesTiny amounts earned by nodes for forwarding payments

🛤️ Next: Becoming a Lightning Service Provider (LSP)

Now that you understand how Lightning works… what if you became a key part of the network?

In the next post, we’ll explore:


kheAI is a Bitcoin-native microbusiness based in Malaysia. We hold BTC, run Lightning experiments, and teach others how to reclaim financial and creative sovereignty. Build with us at kheai.com


Share this post on:

Previous Post
Becoming a Lightning Service Provider (LSP)
Next Post
Bitcoin as a Medium of Exchange and The Rise of Lightning