<p>There are consensus rules and <a href="https://bitcoin.stackexchange.com/questions/100317/what-is-the-difference-between-policy-and-consensus-when-it-comes-to-a-bitcoin-c">policy rules</a> 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.</p>
<p>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.</p>

CC BY-SA 4.0
2022-07-25T20:40:07.707Z
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
CC BY-SA 4.0
2022-07-25T20:57:36.480Z
@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.
Michael Folkson
CC BY-SA 4.0
2022-07-25T17:23:00.253Z
2022-07-25T17:28:50.100Z
2022-07-25T17:28:50.100Z
Michael Folkson
<p>How does a node decide whether a transaction is valid and whether to propagate it to other nodes?</p>
<p><a href="https://i.sstatic.net/qkPCt.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/qkPCt.png" alt="enter image description here" /></a></p>
<p>Could you please mention some of the basic rules that nodes follow for such a purpose?</p>

<transaction-verification><transaction-propagation>
What rules does a node execute to determine if a transaction is valid and propagate it to other nodes?
Nikolas
# What rules does a node execute to determine if a transaction is valid and propagate it to other nodes?

(Asked by: username_0 on 2022-07-25)

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

[![enter image description here](https://i.sstatic.net/qkPCt.png)](https://i.sstatic.net/qkPCt.png)

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

**Tags:** transaction-verification, transaction-propagation


---

## 1 answers

### Answer by username_1 on 2022-07-25. Score: 1 | Accepted answer

There are consensus rules and [policy rules](https://bitcoin.stackexchange.com/questions/100317/what-is-the-difference-between-policy-and-consensus-when-it-comes-to-a-bitcoin-c) 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.

> **Comments:**
> **username_0**: 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?  
> **username_1**: @username_0: 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.  

---

