Using the Lightning Network to Save on Fees
Buy Bitcoin Efficiently using a Lightning Wallet and Optimising Cold Storage
Written By The Lightning Pay Team
Updated December 4th, 2024
Effective UTXO (Unspent Transaction Output) management is a crucial skill for anyone holding and transacting bitcoin. As the adoption of Bitcoin grows and on-chain activity increases, transaction fees are likely to rise significantly, making it essential to minimize unnecessary costs. This article explores the importance of UTXO management, practical examples of its impact on your bitcoin holdings, and strategies to optimize costs—including leveraging the Lightning Network and cold storage.
UTXO Basics
Every bitcoin transaction creates at least one new UTXO, which are basically the pieces of bitcoin you receive and hold in your wallet until you decide to spend them. If you are buying something for $10 at a shop, and all you have is a $20, you give the $20 bill to the shop and receive a $10 bill in return. Except, in this case, you will destroy the $20 bill and each of you get brand new $10 bills, for example.
Why UTXO Management Matters
Every Bitcoin transaction creates UTXOs, which represents an amount that has been assigned to an address you own, and an amount you can spend. Over time, as you accumulate bitcoin, your wallet might contain many small UTXOs. While these seem harmless in low-fee environments, they can lead to significant costs when transaction fees spike.
Managing your UTXOs efficiently ensures that you can move or consolidate your bitcoin without incurring excessive fees, preserving more of your funds for long-term savings or investment.
When you send bitcoin, the more UTXOs you use in your transaction, the higher the transaction fees when you move your bitcoin. You might have a total bitcoin balance shown in your wallet, but every deposit you’ve made is another UTXO which adds to the fee when you go to spend or send it. Imagine you’re at the supermarket counter and your total is $100 but you’ve bought a wallet full of twenty and fifty cent coins. It takes you longer to count out your money than someone with a single $100 note. That’s the downside of having a large number of small UTXOs.
A Practical Example
Let’s consider a real-world scenario:
You’re dollar-cost averaging into bitcoin, purchasing NZ$100 worth of bitcoin each week. Each purchase generates a UTXO in your wallet. At current rates (circa late 2024), this translates to approximately 61,000 sats (0.00061 BTC) per UTXO. After a year, you’ve accumulated 52 UTXOs totaling 3.17 million sats (0.0317 BTC).
Here’s what it might cost to move this bitcoin under two different fee environments:
Scenario 1: Low-Fee Environment
- Fee rate: 8 sats/vB
- Cost to move a single UTXO: 544 sats
- Total cost for 52 UTXOs: 28,288 sats
- NZD equivalent: ~$46.67 to move NZ$5,230.50 worth of bitcoin.
- Effective fee rate: 0.9%
This fee is reasonable, but the situation can change dramatically during periods of network congestion.
Scenario 2: High-Fee Environment
- Fee rate: 200 sats/vB (seen in early 2024)
- Cost to move a single UTXO: 13,500 sats
- Total cost for 52 UTXOs: 702,000 sats
- NZD equivalent: ~$1,160 to move the same amount of bitcoin.
- Effective fee rate: 22%
At this fee level, a significant portion of your bitcoin value is consumed by transaction fees, highlighting the need for proactive UTXO management.
The Lightning Network as a Solution
Lightning’s Role in Bitcoin Storage
One effective strategy to minimize fees is by utilizing the Lightning Network, a second-layer scaling solution built on Bitcoin. Because the Lightning Network is a layer on top of the bitcoin blockchain it doesn’t create a UTXO every time you transact. By conducting frequent small transactions on Lightning, you can avoid creating numerous small UTXOs on-chain.
Now, you can create a UTXO when you send your balance to the main network. This is a bit like exchanging your smaller coins for larger notes before depositing them in a bank, reducing the number of transactions (and fees) when it’s time to move your bitcoin to more secure storage.
Sending bitcoin to Cold Storage
While a Lightning Wallet is excellent for handling regular, small transactions, it’s not the most secure place to store large amounts of bitcoin for the long term. This is where cold storage comes in. Cold storage refers to keeping bitcoin offline, where it is safe from online threats such as hackers. Once you've accumulated a significant amount of bitcoin in your Lightning Wallet, transferring it to cold storage ensures greater security. By waiting until you have a reasonable amount to move, you can also minimise the number of costly UTXO transactions involved. How much you’re comfortable with keeping in your lightning wallet is up to you. But if you’re unsure a good rule of thumb is to aim to keep your average fees to less than 1% of the transaction size. So, with fees on bitcoin averaging 50 sats per vByte you should be aiming for about 1 million satoshis, or 0.01 BTC to send your cold storage wallet.
Strategy:
- DCA Using Lightning: Instead of accumulating small UTXOs on-chain, make your regular purchases via the Lightning Network. Many exchanges and platforms support Lightning withdrawals, allowing you to consolidate funds off-chain.
- Consolidate UTXOs During Low Fees: Periodically, when on-chain fees are low, consolidate your Lightning funds into a single UTXO and move it to cold storage.
- Cold Storage for Long-Term Savings: After consolidation, secure your bitcoin in a hardware wallet or another cold storage solution. This ensures that your funds are safe and ready for future use without unnecessary fragmentation.
By adopting this approach, you can significantly reduce transaction costs while maintaining the flexibility to move funds on-chain when necessary.
Exploring UTXO Costs with a Fee Calculator
To understand how fees impact your transactions, you can use tools like the Economically Unspendable Bitcoin UTXO Calculator created by Jameson Lopp. This tool allows you to input variables such as fee rates and UTXO characteristics to estimate the cost of moving specific bitcoin outputs.
Key Variables:
- UTXO Size: The amount of bitcoin in each output.
- Transaction Type: Whether it’s a P2TR (Taproot), P2SH (SegWit), or legacy transaction.
- Fee Rate: The current or projected fee rate (in sats/vB).
- Signatures and Public Keys: Typical wallets will have 1 of each. This relates to multisig wallets that may require more signatures to spend.
Using this tool, you can plan your transactions more effectively, especially in high-fee environments.
Final Thoughts
Effective UTXO management is an essential part of being a responsible bitcoin holder. By leveraging tools like the Lightning Network for day-to-day transactions and consolidating funds during low-fee periods, you can save significant amounts of bitcoin over time. Additionally, by regularly evaluating your UTXO set and planning ahead for high-fee environments, you ensure that your funds remain accessible and cost-effective to move.
As bitcoin adoption continues to grow, fees are likely to increase over the long term. Start managing your UTXOs today to stay ahead of these challenges and maximize the value of your bitcoin holdings.