2

How does a node decide whether a transaction is valid and whether to propagate it to other nodes?

enter image description here

Could you please mention some of the basic rules that nodes follow for such a purpose?

1 Answer 1

1

There are consensus rules and policy rules for a transaction to follow. If a transaction doesn't follow all these rules then a node won't allow that transaction to enter into its mempool and won't propagate it to its peers. Policy rules include checking the transaction pays a non-zero transaction fee (above the dust level) and isn't spending from an undefined (soft fork) SegWit version.

Transactions that don't follow policy rules can still make it into a mined block however as a miner may have different policy rules to a node(s) on the network. But a transaction that doesn't follow consensus rules can't be included in a block as other miners and other nodes on the network would reject a block with that consensus invalid transaction in it. Consensus rules check things like the transaction isn't creating new Bitcoin out of thin air (unless a coinbase transaction), that it includes the required signature(s) and isn't encumbered by an unexpired timelock.

2
  • Thank you for the detailed response :) I have two questions .. 1) the consensus and policy rules are performed only by full nodes, right? 2) Do the lightweight nodes validate transactions or just pass transactions to full nodes, which then validate them based on the defined rules?
    – Nikolas
    Commented Jul 25, 2022 at 20:40
  • @Nikolas: Yes only by full nodes. Lightweight nodes rely on the miners not including invalid transactions in their blocks. You'd expect miners not to do that but lightweight nodes aren't able to check that. Commented Jul 25, 2022 at 20:57

Your Answer

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

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