-1

I have understood the sha256 algorithm example . But how does a node in a network decide if a transaction is valid or not .

0

Proof of work has nothing to do with transaction validity.

Transaction is valid when it meets certain simple rules:

  1. You do not spend more ether than you have.
  2. Index number(nonce) of the transaction follows previous transaction of your address.

All valid transactions go in a block. And that's where Proof of Work comes.

Imagine it like finding a needle in a haystack. All miners start to do it in the same time. The one who finds it becomes the creator of the block. It used to verify that miner used a lot of computing power. The reason for this is to prevent malicious users from creating long chains which may compromise whole blockchain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.