The Lightning Network is a second-layer protocol created to scale bitcoin payments by creating a web of payment channels that settle balances with one another instead of on the bitcoin blockchain. Every payment channel you create is based on a bitcoin UTXO locked up with a hashed time lock contract, and as users create different sized channels, you get different paths for payment.
Adding to the complexity of payment routing is that even when a channel is established at a certain size, let’s say 0.1 Bitcoin or 10 million satoshis, it doesn’t mean that channel can route payments of that size as the channel owner needs to manage it’s inbound and outbound liquidity accordingly.
If you’re sending a lot of payments, your outbound liquidity can become unbalanced, and if you receive a lot of payments, your inbound liquidity can become unbalanced. This constant shifting of balances and liquidity can cause paths to be blocked and limit the number of payments that can be routed.
The Lightning network, therefore, needs a mechanism to signal to the market; we need liquidity, the type of liquidity, the size of liquidity and what they are willing to pay for that access to funds. Remember when you remove funds from cold storage to move to Lightning, you’re putting funds into a hot wallet and helping the network.
That risk and that time value of money sitting in that channel need to be compensated, and this is where Liquidity markets come into play.
What is Liquidity?
Liquidity is an essential aspect of managing a Lightning Network node and its channels. Its peers’ inbound capacities will determine how much bitcoin they can receive, and their outbound capacities will determine how much bitcoin they can send.
Users can obtain outbound capacity by opening a channel with another peer on the network, but to receive Lightning transactions, one needs to acquire inbound capacity. But a tricky part of managing Lightning liquidity is how to quickly find the new inbound capacity to keep your business receiving lightning network payments.
Lightning and the need for Liquidity
Liquidity marketplaces like Lightning Pool and Magma seek to improve communication about where liquidity is needed in the Lightning Network. Market pricing information can help participants with some extra bitcoin make the best decision about where their liquidity is needed (and get paid for it), creating an APR or risk rate for adding your bitcoin to Lightning.
In the case of a P2P marketplace, to function, channels between participants need to have funds deposited in the channel that can be transacted back and forth. Payments in the Lightning Network can flow both ways. It’s trading the same funds over and over, rather than trying to enter new funds into the ecosystem for every purchase, that allows the marketplace to function without a central authority providing liquidity.
However, a problem emerges when a buyer signals their need for liquidity.
What is Magma?
Magma is a liquidity marketplace for the bitcoin lightning network created by Lightning explorer Amboss. Users can buy or sell channels from other participants in the magma marketplace. Magma is intended to be simple for any lightning node operator without restrictions on implementing a certain type of Lightning Client (LND, CLN, Eclair, etc.).
Magma leverages “HODL” invoices to create simple, smart contracts. This technology enables channel sellers to receive lightning payments only if they open the channel that they agreed to open within a very short timeframe.
Additionally, this technology allows Magma to facilitate the transaction without ever taking custody of user funds allowing for a P2P interaction. Using HODL invoices isn’t a silver bullet and comes with a few tradeoffs, but the result is that channels need to be opened and confirmed quickly, making this a very responsive market to liquidity needs.
You will need to be active when purchasing liquidity on the market, and this is ideal for people who are actively routing payments and not the part-time Lightning user.
To keep up to date with orders, Magma recommends you set up notifications about the status of Magma offers. Orders are provided through @theambossbot on Telegram, so you never miss an order.
Why the need for Magma?
The Lightning network continues to grow and decentralise, and as more nodes come online, they may run different implementations of the Lightning Network. If you’re running LND, for example, it’s easy to use LND native tools like Lightning Pool, but if you’re running another implementation, it might become a blocker.
As the Lightning network also needs to maintain a level of decentralisation, we need different tools offering different methods of access to open market liquidity, and that’s why markets like Magma are so important. The more markets, the more competitive the rates can be, and the more efficient the network can operate and keep costs down.
In addition to decentralisation, Magma wants to create a network of reliable providers.
Building a Lightning reputation
Amboss is also building a reputation system on Magma to help ensure the integrity of the marketplace. The reputation system is a way for users to discern good and bad actors and reward market participants who follow the rules and penalising those who manipulate the system.
If a consumer purchased a channel that, for some reason, did not resolve, Amboss will track the fee updates and update the reputation of the seller. Repeated abuse of the system or confirmations of cheating could result in expulsion from the Magma marketplace, which would require bad actors to use another channel for liquidity needs.
Learn more about Magma
To get a better idea of how you can use Magma, check out the following tutorial by BTC sessions.
A tutorial on Magma by BTC sessions
If you would like to learn more about Magma and dive down the rabbit hole, then we recommend checking out the following resources.
Are you a bitcoin and lightning fan?
Have you been using Lightning to make micro-payments? Stream sats or engage with apps? Which app is your favourite? Have you tried all the forms of Lightning payments? Which one do you prefer? Let us know in the comments down below.