, 16 tweets, 4 min read Read on Twitter
Bitcoin Mining Explained. There is lots not covered here, but shooting for an intro rather than deep dive.

1/ Bitcoin is a ledger of accounts where thousands of people have a copy. In order to ensure consistency of the ledger, only one person can write to the ledger at a time.
2/ To ensure only one write, we implement a lottery system. The lottery will allow the winner to write to the ledger. It will also reward the winner with newly created Bitcoin. This is how we make Bitcoin distribution "fair"
3/ A lottery system needs tickets, but we can't trust anyone to sell tickets. Instead, players must burn energy to buy the tickets. Each ticket costs a certain amount of electricity. Electricity costs money because of 1st law of thermodynamics.
4/ Each ticket consists of a run of a "hashing algorithm." This is a piece of code that takes data and creates a fingerprint of that data. The number of possible fingerprints is roughly 2^256, or about the number of atoms in the universe. We can visualize it as a number line.
5/ To generate a ticket, you take the payments that everyone wants to make (the transactions), you add a random number, and you produce this "hash". The hash is a number between 0 and the number of atoms in the universe and lands somewhere on this number line.
6/ Ahead of time, everyone has agreed that in order to win, you have to find a hash that's under a specific Target Number. Let's say that number is 100,000,000,000. That means every time you roll your random generator, you have to land in a tiny space on this number line to win.
7/ Most of the time, you miss. Roughly once every 10 minutes somewhere in the world, someone hits a number that's lower than the Target Number and wins the Block Reward of newly minted Bitcoin. In order to win, they present to the network all the data they used to get the hash.
8/ Since the chances of hitting that tiny space are very very small, by proving that they generated such a number, they are proving that they've done the work of burning a certain amount of energy.
9/ But if more people start mining, doesn't that increase the chances that we'd find a winning number more frequently? Yes! So, every 2016 blocks, every node checks for how often blocks have been coming and adjust the Target Number proportionally.
10/ If blocks came too fast, the Target is decreased, making it less likely to hit the Target, meaning you have to spend more energy to find a winning combination.
11/ And if blocks are coming too slowly, because too few miners are active, then we can increase the Target, making it more likely that you'd hit the Target with fewer rolls of the die, and thus more profitable. This will attract more miners.
12/ The data that produces the hash consists basically of the transactions we want to write to the ledger, the hash of the prior block, and a random number. This connects every found block to the prior block, ensuring a consistent chain of history.
13/ A large amount of energy goes into mining each block, and the block's hash acts as a fingerprint on the data that's in the block. If someone wants to modify an old record in the Bitcoin ledger, they have to re-mine that block by producing a new hash. This is very expensive!
14/ If they try to tamper with an old block, that block's hash will change. But because every subsequent block used that block's hash as part of its hash, then every subsequent block will change too. That means you have to re-mine the entire chain from the point of tampering.
15/ This makes it extremely expensive to change the Bitcoin ledger. You would have to spend as much energy as the entire honest mining network.

Fin. If you found this insightful, I would appreciate a retweet of the first tweet in this thread!
Corrected picture for Tweet 11, showing increase of target.
Missing some Tweet in this thread?
You can try to force a refresh.

Like this thread? Get email updates or save it to PDF!

Subscribe to Yan Pritzker ⚡️
Profile picture

Get real-time email alerts when new unrolls are available from this author!

This content may be removed anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


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

Become a Premium Member ($3.00/month or $30.00/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 Become our Patreon

Thank you for your support!