3 ms·
Almost. Proof-of-work is an anti-spam mechanism (originally invented for email, as Hashcash). Bitcoin needs this, since it treats the longest chain as "correct"
by chriswarbo 4y ago
Almost. Proof-of-work is an anti-spam mechanism (originally invented for email, as Hashcash). Bitcoin needs this, since it treats the longest chain as "correct".
For example, if we used a public-writable git repo to track our cryptocurrency transactions, it would have the Merkle structure required for append-only/immutable-history. However, we could get lots of diverging branches; e.g.
+--- Commit sending all my money to Alice
|
Parent commit --+
|
+--- Commit sending all my money to Bob
Who gets my money? The consensus mechanism used by Bitcoin will choose the branch with the longest history. In the above case they're equal, so we wait until some more commits appear. If more commits appear on the Alice branch, then that's chosen as the "correct" one. However, Bob can later spam a bunch of commits on top of the other branch (e.g. just sending one coin back-and-forth), until that branch becomes the longest. The consensus will then change, to consider that branch as the "correct" one, and Alice loses all the money (as does anyone she previously sent it to!).
Proof-of-work makes this spamming much harder. All miners will be trying to add blocks to the longest branch they're aware of (picking arbitrarily, in case there are multiple), since it's unlikely any shorter chain will be able to overtake it (this is a largely self-fulfilling prediction!).
- p4bl0 4y agoI know all this, thanks. Preventing double spending is a feature of the consensus mechanism indeed, if it is augmented with other rules (longest chain wins), but immutability does not rely on it, as I said in the comment you are replying to. EDIT: I've updated my previous comment to make it clearer that what I'm saying is "PoW is not an immutability mechanism" (to which answering "you are wrong, PoW prevents double spending" makes little sense).