LogFAQs > #942190817

LurkerFAQs, Active DB, DB1, DB2, DB3, DB4, DB5, Database 6 ( 01.01.2020-07.18.2020 ), DB7, DB8, DB9, DB10, DB11, DB12, Clear
Topic List
Page List: 1
TopicI still don't understand the fundamental concept of Bitcoins.
Sad_Face
07/16/20 1:31:13 PM
#14:


Rika_Furude posted...
how does mining it even work

You install some app and it pounds your gpu
It processes some algorithms... for who? For what reason? And that generates money how?

So you wanna know about mining, or proof of work, eh?

The way it works is that your node on the network takes a number and hashes it using the SHA-256 algorithm into a long string of fairly random characters. For example, running 118 through that algorithm outputs:

00cc2e9f7a37a0fdf0fc99d8fa0c7ce8f7cae298854c8581886c66dc1776fd00

But here's the kicker what makes this so cool. What miners are looking for is to check for the number of zeroes prefacing the rest of the hash. Here, the 2 zeroes preface the rest of the hash. So the miner that found this hash would broadcast to the network that this "nonce" (an integer used once), 118, produces the hash above. Everyone else verifies that 118 outputs the above string from the algorithm, verifies that 118 hasn't been used before and boom, they'll use that hash for the header of the block for all the log of all transactions that occurred from when the last header was found to this new header to add to the blockchain and a new bitcoin is minted and awarded to the node that found the nonce. Then the rest of the network moves on as each node goes looking for a new number that produces a hash of at least 2 zeroes.

But here's the interesting part, if it's too easy, they'll amp up the difficulty of the hash, i.e. demand more zeroes prefacing the hash. It took me .00023 seconds to find 118 that gives me 2 zeroes prefacing the hash. This is on a 2014 15 inch Macbook Pro. I'm running a script right now simulating the proof of work algorithm and it took me 21 seconds to find a nonce that hashes into a string with 6 zero starting bits. 8 zero starting bits? That's gonna take a few hours on my computer. As you can see, it going from .00023 seconds -> 21 seconds -> HOURS, it's exponential. Checking the latest header on blockchain.com, the header is

0000000000000000000944ecde6d106ce0025743e2f375aa3731426f92f96f15

Where they are looking for output strings that have at least 19 zeroes prefacing the string. So you can see how simplistic this strategy is to mine yet how secure it is. It's bloody ingenious. I implore anyone to read Satoshi Nakamoto's whitepaper and test out the proof of work algorithm on your computer so you can have an appreciation for mining.

Anyone, feel free to correct me if I messed up on the explanation.

---
... Copied to Clipboard!
Topic List
Page List: 1