# Why aren't public-private keys sufficient to build a block chain? Why do we need proof of work/stake?

Taking the simple case of Bitcoin here:

If all nodes can validate published transactions by checking the signature (created using the private key of the sender) of the transaction against the public key of the sender, why isn't that sufficient to validate a block?

I understand that we also solve the puzzle of finding a nonce that when combined with a block's contents, gives us a hash that has N number of leading zeroes. Why do we need this at all? Isn't it enough to check the validity of each transaction in the block?

As for double spending, if a miner decides erroneously to include both transactions, nodes can see there isn't enough balance and reject such blocks. As for which transaction of the two to take, the code could have a way to order transactions and if an attacker decides to do the opposite intentionally and decides to spam the network (since there's no proof of work cost) but how does the attacker benefit from that?

• You focus too much on double spending as only goal of an attacker. Without some mechanism to fix past transactions, the entire blockchain would be meaningless, and anyone could change every transaction from everyone. The only guarantee it has: As long as no one controls half of the participating computing powers, no one can change past transactions. That does not work without proof of work. – tylo Apr 3 at 11:15

Blockchain is a decentralized system, and PoW secures it with a large computational cost, such as RandomX developed by the Monero development team. If there are no PoW, an attacker would easily acquire enough computer power which can prevent the other nodes from verifying properly. PoW, therefore, makes acquiring such power difficult, or economically infeasible. Solutions for a PoW is trivial to check, which makes generating fake solutions unable to DDoS any node. Breaking PoS requires the attacker to own 50% or more of the network's coins, and that will break its value.