I have question about bitcoin protocol. In Satoshi's paper it is mentioned that:
- New transactions are broadcast to all nodes.
- Each node collects new transactions into a block.
- Each node works on finding a difficult proof-of-work for its block.
- When a node finds a proof-of-work, it broadcasts the block to all nodes.
- Nodes accept the block only if all transactions in it are valid and not already spent.
- Nodes express their acceptance of the block by working on creating the next block in the chain, using the hash of the accepted block as the previous hash.
My question is, in step 5 nodes accepts the transactions if they are valid, so if a transaction is detected as "not valid" by a node after proof of work (i.e. step 4) it will not be accepted. I think if it is true, the power that is used for proof of work is wasted and it is not acceptable. I wanted to know am I understand this process well and is my assumption correct?
I will appreciate any guide and help.
Thank you