If you’ve spent any time researching Bitcoin then you’ve probably heard about the Lightning Network but…

Why does it exist?
What is it?
How does it help Bitcoin scale?

I’ve been working with it for years, let me help explain it in simple terms 👇
Bitcoin produces blocks every 10 mins and they can hold a limited number of transactions. This limited space creates a fee market where users can bid for their transactions to be included in a block. This means transactions take at least 10 minutes and must pay fees to miners.
The Lightning Network is a p2p network of payment channels

A payment channel is a contract between two people where they commit funds using a single onchain tx. Once the funds are committed they can make an unlimited amount of instant & free payments over the channel.
You can think of it as a tab where each person tracks how much money they are owed. Each time a payment is made over the channel both parties update their record of how much money each person has. These updates all happen off-chain and only the parties involved know about them
When it’s time to settle up the two parties can take the final balances of the channel and create a channel closing transaction that will be broadcast on chain. This closing transaction sends each party the final amounts they are owed.
This means for the cost of two on-chain transactions (the opening and closing of the channel) two parties can transact an unlimited number of times and the overall cost of each transaction approaches zero with every additional transaction they make over the channel.
Payment channels are a great solution for two parties to transact quickly and cheaply but what if we want to be able to send money to anyone in the world quickly and cheaply? This is where the Lightning Network comes into play, it’s a p2p network of these payment channels.
This means if Alice has a payment channel with Bob and Bob has a channel with Charlie that Alice can send a payment to Charlie with Bob’s help. This idea can be extended such that you can route a payment over an arbitrary number of channels until you can reach the entire world.
Routing a payment over multiple channels uses a specific contract called a Hash Time Locked Contract (HTLC). It introduces the ability for Bob and any other nodes you route through to charge a small fee. These fees are typically orders of magnitude smaller than onchain fees.
This all sounds great but what if someone tries to cheat? I thought the whole point of Bitcoin was that we no longer had to trust anyone and it sure sounds like there must be some trust in our channel partners to use the Lightning Network?
The contracts used in Lightning are built to prevent fraud while requiring no trust. There is a built-in penalty mechanism where if someone tries to cheat and is caught then they lose all of their money. This does mean you need to be monitoring the chain for fraud attempts.
It’s not as complicated as it sounds though. Lightning node software built by @lightning, @blockstream, @acinq_co, and @lightningdevkit will automatically do all of this monitoring for you.
When a fraud attempt is detected the software will automatically construct and broadcast the penalty tx onchain. This transaction sends ALL of the cheaters money to your wallet!
Hope this helps give you a better understanding of how the Lightning Network works and how it provides a new layer for transacting Bitcoin in a much faster and cheaper way. I plan to cover it in more detail over the coming weeks so be sure to follow for more Bitcoin content!

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with John Cantrell

John Cantrell Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @JohnCantrell97

8 Jan
You’ve probably heard Bitcoin lets you send money for free. You’ve also probably heard Bitcoin transactions are too expensive.

What’s going on here and why is there so much confusion around the cost to send Bitcoin? It’s kind of complicated, so let me break it down for you 👇
Technically it’s possible to make a Bitcoin transaction for free but in practice it’s really difficult. There’s nothing stopping miners from including transactions that do not pay a fee but most nodes on the network won’t relay transactions with a fee under a certain amount.
This means you either need to be a miner or somehow send your transaction directly to a miner. The latter case is still unlikely to work unless the miner is your friend because miner’s are incentivized to include transactions that pay them the most in fees.
Read 15 tweets
6 Jan
The Fundamental Trade-Off Between Scalability and Decentralization And Why I’m Focused On Bitcoin

A core principle in Bitcoin is that every participant keeps a copy of the ledger and is able to verify every change made to that ledger. Without this we must trust someone else.
Decentralization is not a binary value but more of a sliding scale. It’s closely related to the number of participants in a system that can keep a copy of the ledger and are able to verify it. More participants, more decentralization. Less participants, less decentralization.
Like decentralization, scalability is also not a binary value. In monetary systems like Bitcoin, most people refer to scalability in terms of the number of transactions it can handle per time period. The more transactions it can process per second, the more scalable the system
Read 12 tweets
5 Jan
How Will We Onboard Earth’s 7.753 Billion People To The Lightning Network?

I ran the numbers, let’s see how we can onboard the entire population of Earth onto the Lightning Network, how long it might take, and what we can do to speed the process up 👇
To onboard onto the lightning network it requires sending btc into a 2-of-2 multisig funding transaction with your channel partner. To optimize space in this transaction we want 1 native segwit input and a single channel funding output. This produces a tx of roughly 121vbytes.
If 100% of the transactions in a block were these channel opening txs we could onboard about 8,264 people to lightning per block. With a global population of 7.753 billion people it would take roughly 938,166 blocks or 17.8 YEARS for everyone on Earth to have a channel.
Read 10 tweets
4 Jan
You probably saw the image of the Bitcoin genesis block with Satoshi’s hidden message in it over a thousand times yesterday (happy belated bday!).

If you were at all curious how Satoshi actually sent the hidden message in the genesis block then read more below 👇
The message is actually embedded in the first transaction ever made on the Bitcoin blockchain. It is part of a special transaction called a coinbase transaction (and no, nothing to do with the shitcoin casino company – though that is where their name came from!).
Every block mined *must* contain at least one transaction, the coinbase transaction, and it has the ability to generate up to the current block reward new bitcoins. Because it generates new coins, It’s the only transaction that must not spend another transaction’s output.
Read 5 tweets
3 Jan
Most of my career I worked on web tech using js and ruby. Typed, compiled languages were alien to me but I was intrigued by the reliability, performance, and usability Rust offers. The rust-bitcoin ecosystem finally motivated me to start my Rust journey. Here’s how I did it 👇
📕The Book - doc.rust-lang.org/book

The book is single handedly the best resource for starting out in Rust. I recommend reading through this at least once to get a good overview and then use it as needed as a reference when a specific topic comes up in your programming.
🧙‍♂️Rust Analyzer - rust-analyzer.github.io

The Rust compiler is known for producing errors that are actually helpful. Rust Analyzer is a plugin that brings this info to you in real time as you code. It also automatically surfaces docs, auto-completion, and so much more.
Read 6 tweets
19 Jun 20
I got a lot of great feedback and questions after posting my article about brute forcing yesterday

I wanted to address a question that came up over and over again because I think a lot of people extrapolated what I did to the false conclusion that Bitcoin isn't safe or secure /0
Q: Are my bitcoins stored in a wallet generated from a 12-word mnemonic safe?
A: Yes, just don't give out any of your words on Twitter.

Brute forcing @alistairmilne's wallet was only possible because he publicly exposed eight words from his twelve word mnemonic seed. /1
It would take the same system that brute forced the last 4 words of his mnemonic 837 quintillion millennium to brute force all possible 12 word mnemonics. /2
Read 8 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(