<p>The problem that Bitcoin solved was the <em>double spending problem</em>. The scenario that causes the double spending problem does not pertain to &quot;miner x&quot; trying to spend Bob's money—he can't obviously. The double spending problem stems from Mallory, an attacker, being able to sign two conflicting transactions in parallel, one stating that he paid Alice, another stating that he paid the same funds to Bob. How does a system without an arbiter decide which of the two takes precedence? Obviously they cannot both be valid, or the money wouldn't be scarce. We can't leave each individual participant to make their own decision, or the network would be split immediately as each transaction is seen by parts of the network first.</p>
<p>Satoshi Nakamoto discovered that Proof of Work could be used to create a distributed lottery, a lottery which elects a sole author for each block. By allowing a single entity to record their version of the transaction journal, the blockchain records a canonical order of the transactions. If the author saw Mallory's transaction to Alice first, that's the one that's authoritative, and the one that paid Bob is invalid. Thus, the double spending problem is solved.</p>

CC BY-SA 4.0
2022-01-14T02:41:30.910Z
2022-01-14T03:24:27.757Z
2022-01-14T03:24:27.757Z
Murch
<blockquote>
<p>But why is it even necessary since transactions are confirmed only if they contain valid signature?</p>
</blockquote>
<p>Proof of work is not used for transaction validation. A signature prevents other people stealing bitcoin which they do not own (without the private key), and prevents a transaction from being tampered with. However, Bob could spend the same bitcoin multiple times, sign all the transactions, and they would all be valid as transactions independently. Obviously, though, they all conflict with each other and can't all be included in the blockchain - this is the double spend problem. Only one of these competing transactions can be accepted. The one that <em>does</em> end up in the blockchain is the valid transaction, and all the others are discarded as invalid.</p>
<p>For more information on proof-of-work, see some of the other questions on this site. For example, <a href="https://bitcoin.stackexchange.com/questions/51286/why-do-we-need-proof-of-work-in-bitcoin">Why do we need Proof of Work in bitcoin?</a></p>

CC BY-SA 4.0
2022-01-14T02:41:05.653Z
2022-01-14T02:41:05.653Z
meshcollider
<p>So I understand the concept behind PoW (that if someone wants to overturn the current chain, they'd have to do all that work again).</p>
<p>But why is it even necessary since transactions are confirmed only if they contain valid signature?</p>
<p>Say there is Bob and Alice and miner X and all the other miners. Bob signs a transaction showing that he sent Alice $10, and the miners seeing the signature is indeed valid and there is enough balance, deduct it from Bob and add it to Alice. Now say miner x, wants to make a fake transaction to empty Bob's wallet for himself, sure, he could make a fake transaction with a fake signature, but in that case, all the other miners reject it, and he himself can't add balance to his own wallet from the empty air, because again, all the other miners reject it (another wallet with the actual balance has to sign the transaction). Now I can see how that would make rewarding difficult, but again, you can't just reward yourself without all the other miners also agreeing (could be that the reward goes to the first miner to add it to chain and again in case of conflicting chains, miners switch to the one with the most other miners in, the one that the majority agree on, and if they are both equal, this goes on until the majority switches to either chain).</p>
<p>And again, if someone just went and made up their own chain, all the other miners reject it, since they are only one miner, and the majority don't agree with that chain.</p>
<p>Now how do you track the majority? The same way you connect to other peers in the network, you connect to different peers, and always update this info (you connect to many peers, so that if one peer lies to you, most of the others tell the truth, you keep a list of all the other miners with you and the chain they all agree with).</p>
<p>You might then wonder &quot;why can't one node create many clones and make you think they are many&quot;? Sure, if they can overcome the sheer number of other miners that is and keep up (without getting blacklisted by other peers too, keep in mind that even without PoW there is still a cost). It'd be like acquiring all the ips on internet as an example.</p>

CC BY-SA 4.0
2022-01-14T02:13:22.327Z
I'm not really sure I understand the question, but in any case it's to give an authoritative way to set the order of transactions. There can only be one "correct" order, and if you relied on merely connecting to different peers, everyone's ordering of transactions would be slightly different if not for any reason than they each find out about different transactions at different times. So instead, we use this lottery system to pick one "authoritative" ordering of transactions per block, and to make it computationally impossible for anyone to modify the historical order of transactions.
ieatpizza
CC BY-SA 4.0
2022-01-14T11:28:00.947Z
Does this answer your question? [What is the problem that mining solves?](https://bitcoin.stackexchange.com/questions/14461/what-is-the-problem-that-mining-solves)
RedGrittyBrick
<proof-of-work><doublespend>
Why is PoW even necessary?
user131438
# Why is PoW even necessary?

(Asked by: username_0 on 2022-01-14)

So I understand the concept behind PoW (that if someone wants to overturn the current chain, they'd have to do all that work again).

But why is it even necessary since transactions are confirmed only if they contain valid signature?

Say there is Bob and Alice and miner X and all the other miners. Bob signs a transaction showing that he sent Alice $10, and the miners seeing the signature is indeed valid and there is enough balance, deduct it from Bob and add it to Alice. Now say miner x, wants to make a fake transaction to empty Bob's wallet for himself, sure, he could make a fake transaction with a fake signature, but in that case, all the other miners reject it, and he himself can't add balance to his own wallet from the empty air, because again, all the other miners reject it (another wallet with the actual balance has to sign the transaction). Now I can see how that would make rewarding difficult, but again, you can't just reward yourself without all the other miners also agreeing (could be that the reward goes to the first miner to add it to chain and again in case of conflicting chains, miners switch to the one with the most other miners in, the one that the majority agree on, and if they are both equal, this goes on until the majority switches to either chain).

And again, if someone just went and made up their own chain, all the other miners reject it, since they are only one miner, and the majority don't agree with that chain.

Now how do you track the majority? The same way you connect to other peers in the network, you connect to different peers, and always update this info (you connect to many peers, so that if one peer lies to you, most of the others tell the truth, you keep a list of all the other miners with you and the chain they all agree with).

You might then wonder "why can't one node create many clones and make you think they are many"? Sure, if they can overcome the sheer number of other miners that is and keep up (without getting blacklisted by other peers too, keep in mind that even without PoW there is still a cost). It'd be like acquiring all the ips on internet as an example.

**Tags:** proof-of-work, doublespend

> **Comments:**
> **username_1**: I'm not really sure I understand the question, but in any case it's to give an authoritative way to set the order of transactions. There can only be one "correct" order, and if you relied on merely connecting to different peers, everyone's ordering of transactions would be slightly different if not for any reason than they each find out about different transactions at different times. So instead, we use this lottery system to pick one "authoritative" ordering of transactions per block, and to make it computationally impossible for anyone to modify the historical order of transactions.  
> **username_2**: Does this answer your question? [What is the problem that mining solves?](https://bitcoin.stackexchange.com/questions/14461/what-is-the-problem-that-mining-solves)  

---

## 2 answers

### Answer by username_3 on 2022-01-14. Score: 6

The problem that Bitcoin solved was the *double spending problem*. The scenario that causes the double spending problem does not pertain to "miner x" trying to spend Bob's money—he can't obviously. The double spending problem stems from Mallory, an attacker, being able to sign two conflicting transactions in parallel, one stating that he paid Alice, another stating that he paid the same funds to Bob. How does a system without an arbiter decide which of the two takes precedence? Obviously they cannot both be valid, or the money wouldn't be scarce. We can't leave each individual participant to make their own decision, or the network would be split immediately as each transaction is seen by parts of the network first.

Satoshi Nakamoto discovered that Proof of Work could be used to create a distributed lottery, a lottery which elects a sole author for each block. By allowing a single entity to record their version of the transaction journal, the blockchain records a canonical order of the transactions. If the author saw Mallory's transaction to Alice first, that's the one that's authoritative, and the one that paid Bob is invalid. Thus, the double spending problem is solved.


---

### Answer by username_4 on 2022-01-14. Score: 4

> But why is it even necessary since transactions are confirmed only if they contain valid signature?

Proof of work is not used for transaction validation. A signature prevents other people stealing bitcoin which they do not own (without the private key), and prevents a transaction from being tampered with. However, Bob could spend the same bitcoin multiple times, sign all the transactions, and they would all be valid as transactions independently. Obviously, though, they all conflict with each other and can't all be included in the blockchain - this is the double spend problem. Only one of these competing transactions can be accepted. The one that *does* end up in the blockchain is the valid transaction, and all the others are discarded as invalid.

For more information on proof-of-work, see some of the other questions on this site. For example, [Why do we need Proof of Work in bitcoin?](https://bitcoin.stackexchange.com/questions/51286/why-do-we-need-proof-of-work-in-bitcoin)


---

