Formatted post here: https://bitconsult.co/2018/04/17/the-lightning-network/
In today’s post, we present a high-level overview of the Lightning Network. We’ll also walk you through making a lightning purchase using the Éclair wallet on Android.
Introduction
Bitcoin is more than a digital currency; it is a protocol for sending value over a peer-to-peer network. The protocol allows for on-chain transfers of Bitcoin between a single sender and single recipient. This is your straightforward “Alice pays Bob 1 BTC” transaction. Most Bitcoin users have sent simple on-chain transactions in order to pay for goods and services, or to move Bitcoin from an exchange account to a private wallet.
Sophisticated users may be familiar with more complex Bitcoin transactions, such as multi-signature (multi-sig) or time-locked transactions. Multi-signature wallets can be set up so that Bitcoin can only be spent if two specific signatures are used to sign a transaction. Think of a joint bank account, where both you and your spouse need to approve of a transaction before the funds can be released. Time-locked transactions also require special conditions to be satisfied before Bitcoin can be sent. For instance, a transaction may require a certain amount of blocks (or time) to pass before a transaction is considered valid. These special conditions are part of what makes Bitcoin “programmable money”.
While multi-sig and time-locked transactions may seem relatively simple, they actually allow for much more complex payment solutions than stated in the examples above. One such solution under development is the “Lightning Network”.
What is the Lightning Network?
The Lightning Network is a “second layer” payment protocol that operates on top of the Bitcoin blockchain and allows for near-instant, incredibly cheap Bitcoin transactions. The Lightning Network is a mesh of nodes connected through a network of bidirectional payment channels.
Bitcoin lightning network éclair ACING android lnd clightning routing blockstream store sticker guide dummies node scaling block size
An idealized “mesh network” The dark line shows a payment routed from node A to node Q
In order to transact on the Lightning Network, a user must open a payment channel by committing a funding transaction on the Bitcoin Blockchain. Once a channel is funded, the user can transact with other lightning nodes indefinitely, so long as their channel is funded. Once the user is finished with their transactions, they can close the channel by sending a close-out transaction on the main Bitcoin blockchain.
Let’s walk through an (imperfect) analogy. Lightning works a lot like a bar tab. If you’re planning to post-up at the bar and double-fist ice-cold crispies for a few hours, it doesn’t make sense to pay each time you get another round. If you’re paying in cash, this would require the server to get correct change for each transaction. Worse, if you’re paying with credit, the server would need to run your card and get a signature every time. You want to drink without interruption, but the bar owner wants to make sure you don’t run off with a free buzz, so what do you do? You open a tab.
“Bro, I’m gonna turn things around, I’m launching an ICO”
When you open a tab, the bartender will keep track of what you’re drinking, and you won’t pay until you decide you’re done for the night. In order to prevent getting stiffed, the bartender may keep your credit card or even your identification. If you forget to close your tab, the bartender will charge your account for the drinks and likely give himself a fat tip, and you’ll have to take the walk of shame the following morning to pick up your cards and what is left of your pride.
When you start your tab and hand over your credit card, you are effectively opening a payment channel. The bartender keeps tabs on how much you owe, and updates the state of your payment channel every time you order another beer. When you’re done, the bartender swipes your card, you add your tip, and you close the tab and close your payment channel. In addition to being efficient, there is only a small amount of trust involved. Once the bartender has your card, the bar is more or less guaranteed to get paid. You can check the tab at the end of the night and ensure that you’re paying the correct amount. If the amount is wrong, you’d likely have to talk with the owner. If the two of you still disagree on the amount owed, you may need to take the complaint to your credit card company.
With the Lightning Network, you open a channel by sending a Bitcoin transaction on the Bitcoin blockchain, and commit a certain amount of funds to a lightning channel. Once funded, you can transact with anyone on the Lightning Network that shares an open channel with you. You can transact indefinitely until you are finished or out of funds, then post a closing transaction to the blockchain. The Lightning protocol uses a combination of smart contracts, time-locked transactions, multi-sig addresses, game theory, and more to ensure proper routing and payment. There are many great resources that explain the network in detail, but the main takeaways are as follows:
-Lightning allows for instant, cheap transactions.
-Security is enforced by blockchain smart contracts, without creating on-blockchain transactions for individual payments.
The Lightning Network will not only save you a few bucks if you transact frequently, but it effectively allows for non-linear scaling of Bitcoin in general. If enough consumers/merchants use Lightning, Bitcoin will be capable of Billions of Lightning transactions per second. The implications of this statement are massive. Not only can Bitcoin scale better than traditional payment systems like Visa, Lightning will allow for “streaming money”, machine-to-machine micropayments, and other solutions that have no yet been envisioned.
So, can the average Joe buy stuff on lightning right now, or is it vaporware?
Using the Lightning Network
Bitcoin lightning network éclair ACING android lnd clightning routing blockstream store sticker guide dummies node scaling block size
Don’t lie, you want this sticker
Joseph Poon and Thaddeus Dryja wrote the initial Lightning white paper a couple of years back. The specification was announced after the white paper, and it is currently under development by multiple parties (Elements Project, Lightning Labs, and ACINQ). For all intents and purposes, Lightning should be treated as Alpha or Beta-level software that is not ready for public release. If you decide to open a lightning channel, only a small amount should be used at this time, and you should be prepared to lose funds.
That being said, Lightning is live on mainnet Bitcoin and you can fund a channel and make real-life purchases right now! In fact, Bitconsult just made a purchase from the Blockstream Store, and we’ll walk you through the process step-by-step.
Step 1 – Download the Éclair Wallet for Android
Bitcoin lightning network éclair ACING android lnd clightning routing blockstream store sticker guide dummies node scaling block size
eclair for android
Éclair is a Bitcoin + Lightning wallet developed by ACINQ. For this demo, Bitconsult is using a Google Pixel running Android 8.1.0. To get the app, head on over to the Google Play store and search “Éclair Wallet” by ACINQ. There’s a Testnet version available, but we want mainnet for this demo.
Step 2 – Create a Bitcoin Wallet on Éclair
The Éclair app serves as a Bitcoin wallet and also allows you to create Lightning channels. If you’ve created a Bitcoin wallet before, you’ll be familiar with the process. Follow the on-screen instructions to create a wallet. You’ll be given a 24 word phrase. This phrase is used to recover your on-chain Bitcoin funds. You’ll also be asked to create a 6 digit pin to and access your wallet in the future. Write the recovery seed and password down and store them in a safe place. As always, don’t take screenshots of the recovery phrase or store it on a computer. Once you’ve written the phrase down, you’ll be asked to confirm some of the words.
Step 3 – Fund your Bitcoin Wallet
Bitcoin lightning network éclair ACING android lnd clightning routing blockstream store sticker guide dummies node scaling block size
Send funds to your new eclair BTC address….or mine if you’re feeling generous
Click the “Your Bitcoin Address” tab to see your address (segwit, yay!) and QR code. Fund this wallet with Bitcoin. I’d suggest funding the address with .01 BTC (about $80) or less. Again, be prepared to run into an issue and potentially lose all of your funds when using this BETA software.
Step 4 – Open Lightning Channel
After a few confirmations, your Bitcoin will appear in your Éclair wallet. You’ll see your BTC balance update at the top of the screen and the transaction should appear on you “transaction history” tab. All on-chain Bitcoin transactions will appear with the Bitcoin “B” symbol in orange on the left side of the screen. Once your funding is confirmed, head to the “Lightning Channels” tab and click the plus sign. Here, you’ll have to designate the lightning node that you’d like to open a channel with. In order to transact on Lightning, your channel needs to be connected to the node you are trying to pay. You can head over to a lightning explorer to find a well-connected lightning node. However, for this tutorial, you should use the Blockstream Store’s node. To do this, select “Scan a node URI” and use the code below:
Blockstream URI – Thanks for the code @notgrubles !!!! (twitter) 02f6725f9c1c40333b67faea92fd211c183050f28df32cac3f9d69685fe9665432@104.198.32.198:9735
This is really the only semi-difficult part. I searched google and the Blockstream site for the Blockstream Store URI but couldn’t find it for my life. So, I opened channels with some well-connected nodes but was not able to get my payment to Blockstream. So, I resorted to twitter, where @notgrubles was kind enough to send me the information and QR code.
If you want to connect to a different node, check out a lightning explorer like #recksplorer. Don’t forget to stop and admire the network.
Lightning network visualization from reksplorer
After a couple of confirmations, the channel should show “Normal” in the Éclair app. Note that you’ll need to pay a BTC transaction fee and commit funds to open this channel.
This tab shows your lightning channels
Step 5 – Checkout on Blockstream
Now that your channel is open and funded, head on over to the Blockstream Store and fill your cart with goodies! The Blockstream Store accepts Lightning payments. In fact, it’s the only way to currently pay for items at the store. Once your cart is full, proceed to checkout and you’ll be given a QR code to scan for payment.
Bitcoin lightning network éclair ACING android lnd clightning routing blockstream store sticker guide dummies node scaling block size
Checkout screen for Blockstreams LN store
Scan the code and BAM! Your browser and Éclair app will update in a fraction of a second showing that your payment has been made. You can now see the lightning transaction on the Éclair “transaction history” tab next to a cool lightning icon. You can click on the transaction for some more info, including the routing fee. My transaction had zero fees!
Step 6 – Close the Channel (optional)
Now, you can decide to close the channel or keep it open. Obviously, it doesn’t make much sense to post on-chain transactions to open and close a lightning channel so that you can make a single lightning payment. But if you wish to, you can click your channel on the “Lightning Channels” tab and click “close channel”. After a few confirmations, you’ll see a new Bitcoin transaction in your “Transaction History”. Your BTC wallet balance will update, minus a miner fee.
Alternatively, you can leave the channel open and receive payments, or spend your remaining BTC on VPN or other services!
Considerations and Drawbacks
The Lightning Network is currently front and center in the Bitcoin scaling debate. Big-blockers are convinced that Blockchains can scale simply by increasing the blocksize when more capacity is needed. Small blockers are convinced that more elegant solutions like SegWit, Schnorr Signatures, MAST and Lightning Network will allow for exponential scalability that can truly compete with and ultimately outperform legacy payment rails.
Those who argue that LN is too complicated for ordinary users are being short-sighted. When the Lightning Network went live in December, it was too difficult for many users (including me) to use, even with a guide. However, in just a couple of months, ACINQ has put out this incredibly easy to use Eclair wallet. While the software and protocol are certainly not ready for mass adoption at this time, developers are working around the clock on UI and user improvements.
Is Lightning the end-all-be-all solution for Bitcoin? No. I like to think of lightning as a complementary payment option. With fiat, I’ve got cash in investments, checking accounts, and my wallet, all with varying degrees of liquidity and security. I see Lightning serving more as the cash in your wallet for the short term. You can hit the ATM, pay a fee, and have a wallet full of cash for small purchases in the physical world. Online, you’ll open a lightning channel, pay a fee, then transact with little to no fees until you need to top up your wallet again. Eclair has already made the wallet pretty seemless, putting the BTC wallet and lightning channels in the same app. I wouldn’t be surprised if Bitcoin wallets are soon available which totally hide the lightning back end from the user.
Conclusion
The Lightning Network is an incredible idea that is just getting started. The inner workings and beautiful and complex, and you should certainly learn more about exactly how LN works, beyond this quick intro. If this article helped you pick up those beautiful stickers, leave us a comment below.
As always, contact us if you have any questions about Bitcoin, Lightning, and more!
upvote and re-steemed. About to talk about on my show today
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
you're the best, I'll be listening
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
You really put effort into this! Thank you!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thanks for reading! check out my other posts on bitconsult.co !!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @bitconsult! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
You got your First payout
Award for the total payout received
Click on any badge to view your own Board of Honor on SteemitBoard.
To support your work, I also upvoted your post!
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOP
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations! Your post has been selected as a daily Steemit truffle! It is listed on rank 25 of all contributions awarded today. You can find the TOP DAILY TRUFFLE PICKS HERE.
I upvoted your contribution because to my mind your post is at least 26 SBD worth and should receive 150 votes. It's now up to the lovely Steemit community to make this come true.
I am
TrufflePig
, an Artificial Intelligence Bot that helps minnows and content curators using Machine Learning. If you are curious how I select content, you can find an explanation here!Have a nice day and sincerely yours,
TrufflePig
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Lighting network is obviously a really good think. This is another feature and mesagge that Crypto is going forward and one day will be huge - Stable - without minuses.
Have a great day!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit