Post
Topic
Board Bitcoin Discussion
Re: What is the actual point of the many working parts of Bitcoin/blockchains?
by
ranochigo
on 24/03/2021, 13:25:17 UTC
I get that first-come-first-served alone is just a beacon for frauds, but I still don't get how the mining makes it more secure (yes, I am that dense. Sorry...). I may need to watch the B3B1 video a few dozen more times....
Keyword is consensus.

When Bitcoin transactions are made, they are not sent to another central authority but to a Bitcoin node[1]. Due to this, each node will see a transaction at a different timing. As such node A may see it first while Node B can take a few seconds (say 5s) for it to be finally relayed to it(TX A). In this short 5s, since node B hasn't seen the transaction yet, it allows the attacker to spend another transaction and this time its a different transaction (TX B) that spends the same inputs but the outputs have different spending requirements (or to be sent to different address). The problem now is that since, 50% of the network has seen TX A but not TX B and vice versa. Essentially, they cannot agree on the same transaction that is relayed first. To both, TX A is first seen by half and TX B is seen by the other half and both think that they saw it first. Since you would very much rather not trust what another node says, there is a fairly significant deviation from the unix time for most of the nodes and thus the time received by each node cannot be taken as is. Nodes are independent entities that do not trust each other.

What mining essentially does is to ensure consensus by making everyone follow the same set of Blockchain with the same set of transactions. The disagreements are now solved by this common Blockchain that is recognized by all of the nodes as valid. By enforcing the rule that the Blockchain with the longest PoW is valid, you essentially makes it such that for someone to alter the Blockchain, they have to expend resources to make an alternative chain with a different transaction at that point to make nodes accept it as valid[2]. Since it is more expensive for an attacker to reverse a transaction than to just mine with the honest miners, the game theory makes it such that people are disincentivized to attack.



[1] Full node being defined as a client that validates transactions and blocks and enforcing protocol rules in the process, usually running Bitcoin Core or similar implementations.

[2] See 51% attack.