One article I am reading said that proof of work system is used in Bitcoin to prevent double spending. More particularly:

Imagine we are protecting against double spending in following way. When Bob receives transaction from Alice saying that "Alice transfers some 1234 BTC to Bob", bob would broadcast this to entire network to ask them to verify whether this is a legitimate transaction. In the mean time say if Alice had sent also same message to Charlie (saying that she is transfering same 1234 BTC to Charlie), Charlie would have also broadcast this message and other nodes on the network would spot that Alice is trying to spend same 1234 BTC with two persons, and they would let Bob (or Charlie) know that this is invalid transaction. Or if all is ok Bob or Charlie would wait till some nodes send acknowledgment that this is valid transaction.

SOCK PUPPET ATTACK: Above scheme would work but Alice could cheat in the following way. She could create say one million fake identities on network, and they would lie to Bob and Charlie that the transactions was valid- making them accept payment.

Now comes my question. It seems proof of work was introduced in Bitcoin to prevent exactly the above kind of sock poppet attack. But I fail to see how proof of work helps protect against above sock puppet attack. Why would Alice not be able to introduce those fake 100000 identities on the network anymore?

Can someone ealaborate and explain?

ps. I know what proof of work is, this question is more related how and why it prevents above mentioned sock puppet attack.

3 Answers 3


It is not really the Proof of Work which prevents double spends but rather the blockchain itself which prevents double spends. The Proof of Work is just one aspect of the blockchain.

For a transaction to be considered final, it must be in the blockchain. Otherwise it could disappear forever and everyone forgets about it. For a transaction to be added to the blockchain, it must be included in a block, and miners will do a Proof of Work for the block. In order for the transaction to be included in a block, the outputs that it spends from must have not been spent by any other transaction in the blockchain nor by any other transaction in the block. If such an other transaction exists in the blockchain, then the block will be invalid.

It is this process of including transactions in blocks which avoids double spends. It essentially establishes an order and says "this transaction is the real transaction, all others which spends any of the outputs which this transaction spends are fake".

The proof of work mechanism exists in Bitcoin because that is what makes the blockchain immutable. A valid proof of work means that a miner is proving that they did a certain amount of work, on average, in order to produce a block. In order to replace that block, someone else must also do about the same amount of work for that block. If someone wanted to modify a block in the blockchain and have everyone accept it, that person must perform the same amount of work that went into creating the block, then do the same for every single block that follows it because those blocks would be invalid since a block in their history has changed. This makes the blockchain immutable; the amount of work required to rewrite history is considered to be infeasible and much too costly to do practically. That is what the Proof of Work is for.

  • you may want to read the question once again. Only block chain would not suffice. All nodes have blockchain locally. So as in question if alice simultaneously sends same transaction to bob and charlie in both users' blockchain it would seem that the transaction is valid (because that coin has not been spent yet). So you need a consesus protocol where bob and charlie would ask for example whole network if the transaction they receive is OK. but there comes the sock puppet attack I mentioned.
    – user62822
    Commented Oct 26, 2017 at 18:30
  • That's not how the blockchain works. The blockchain is the consensus protocol where Bob and Charlie asks the network whether the transaction they receive is ok. The blockchain is not something that is added to locally when new transactions are received. It is added to locally when new blocks are received, and new blocks can only be created by performing the proof of work. Blocks and transactions must also conform to the consensus rules that the node is following. Those rules also include double spend protection.
    – Ava Chow
    Commented Oct 26, 2017 at 18:33
  • Here is article I referred to: michaelnielsen.org/ddi/how-the-bitcoin-protocol-actually-works. Section "proof of work"
    – user62822
    Commented Oct 26, 2017 at 18:42
  • And besides can you then explain (maybe in answer) WHY proof of work was added to bitcoin? what purpose does it serve?
    – user62822
    Commented Oct 26, 2017 at 18:42
  • I have updated my answer
    – Ava Chow
    Commented Oct 27, 2017 at 0:00

For a transaction to be valid it is not enough to be broadcasted by the attacker or repeated by many nodes. It must be added to the blockchain by some node in the network. Adding the transaction to the blockchain is not easy, as some node in the network must make PoW, which is time and processing power consuming.

Inside single chain transactions cannot collide. Each node accepts longest chain as valid one so for an attack to succede the attacker must maintain two equally long chains. Then some nodes will accept one chain and others other chain as valid, thus allowing an attacker to spend money twice - within one transaction on one chain and other 'colliding' transaction on other chain.

If attacker has 10% of total nodes in the network (by processing power) he is unlikely to maintain 2 such chains and put wanted different transactions in each as the majority of nodes (honest 90%) will outpace him with their own chain. Thus there will exist (in long term: 2, 3 or more blocks) only one chain. As said, inside single chain transactions cannot colide, thus you cannot double spend.

  • If we could assume that the majority of nodes are honest (i.e. following rules), we could use less wasteful rules (i.e. without proof-of-work) for creating a new block.
    – rapt
    Commented Aug 21, 2019 at 18:56

The Sock Puppet reference

Why would Alice not be able to introduce those fake 100000 identities on the network anymore?

Impersonation, ID-faking of the nodes/miners based on IP spoofing is "difficult" in Blockchain as it involves Proof of Work/Hash Guessing problem to be solved first before a node can broadcast a (rogue?) message to the network. Since the amount of computation required (do Hash Guessing) to send rogue messages is so high, it becomes impractical to do 1M impersonation requests.

She could create say one million fake identities on network...

One can steal private keys of other nodes to create transactions on their behalf, but still it would follow Blockchain consensus principles. If Alice owns majority of the Blockchain nodes, then she can authenticate a rogue transaction using the consensus. This is commonly referred as 51% attack, Sybil attack.

Faking identities is quite difficult and the scenarios why it will eventually fail has been explained in croraf's answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.