<p>The number of nodes that perform validation is completely irrelevant, because there is no vote.</p>
<p>Validating nodes validate everything independently; they all have their own mempool with transactions they believe are valid. Who cares that an attacker spins up a gazillion nodes? It won't make <em>your</em> node (which you're presumably using to validate your payments, if any) accept these invalid things.</p>

CC BY-SA 4.0
2021-12-06T15:53:53.907Z
If there is no vote then why is a transaction further propagated to other nodes after being validated by that node? Also does the fact that "Validating nodes validate everything independently" means that a transaction will stand invalid even if one of the nodes find it to be invalid?
Manav Kampani
CC BY-SA 4.0
2021-12-06T16:01:24.793Z
Nodes are free to relay a transaction or not, and they can certainly wreak havoc in the network if suddenly a huge portion of the network stops relaying. But they cannot *ever* make an honest node think an invalid transaction is valid. Which transactions *your* node considers valid or invalid is not determined at all by what its peers or other network nodes think about it.
Pieter Wuille
CC BY-SA 4.0
2021-12-06T16:13:30.070Z
ok I am a little confused now. Can you please explain me how a transaction is labelled valid or invalid in the bitcoin blockchain to be included in the mempool of the valid transactions?
Manav Kampani
CC BY-SA 4.0
2021-12-06T16:16:49.810Z
There are hundreds of rules, and I can't go into detail for all of them, but the big picture is: doesn't steal someone's money without their signature, doesn't conjure up money out of nothing, doesn't spend the same coins twice. *Every* honest node validates *all* these rules for *every* transaction independently (it does not trust what other nodes think about it), for every transaction it sees separately (as a mempool tx) or in a block (in which case, if the transaction is invalid, the entire block it is in is considered invalid too).
Pieter Wuille
CC BY-SA 4.0
2021-12-06T16:24:25.543Z
so are you saying that every node has it's own mempool and includes a tx in it according to it's personal understanding of the tx as a valid or invalid one?
Manav Kampani
CC BY-SA 4.0
2021-12-06T16:24:50.330Z
Yes, every node has its own mempool. There are often small inconsistencies between nodes. Every node also has its own idea of which blocks are valid and accepted (e.g. they may not have heard about a new block that was recently mined), but due to the incentives around PoW, all nodes necessarily converge towards the same blockchain after some time. That convergence does not exist for the mempool.
Pieter Wuille
CC BY-SA 4.0
2021-12-06T16:32:54.280Z
okay makes sense, but then how do the miner nodes decide from which validator node's mempool to pick up the transactions and block them together?
Manav Kampani
CC BY-SA 4.0
2021-12-06T16:34:09.633Z
They draw transactions to mine from *their own* mempool. That's the only one they know is honest.
Pieter Wuille
CC BY-SA 4.0
2021-12-06T16:35:04.110Z
but I have read that not all miner nodes need to be validator nodes too. What about them?
Manav Kampani
CC BY-SA 4.0
2021-12-06T16:43:27.487Z
That's hard to answer without context. Perhaps that statement is using the word "miner" to refer to hashing hardware, which generally outsources the block construction to a mining pool operator entirely (so hashers don't have a mempool, but they also don't select transactions for blocks at all). Perhaps the statement is referring to the theoretical possibility of having a miner that only produces empty blocks (which works without a mempool). But in practice: all miners (in the sense of nodes that produce block candidates for mining) have their own mempool.
Pieter Wuille
CC BY-SA 4.0
2021-12-06T16:47:57.333Z
so a mining pool operator, being a true "miner node" will have it's own mempool to select the txns from right? Here is the article I read it from: https://medium.com/sazmining/what-is-a-bitcoin-node-b1106b050ace
Manav Kampani
CC BY-SA 4.0
2021-12-06T16:49:38.087Z
Yes, mining pools construct block templates, and do so based on the contents of their own validating node's mempool.
Pieter Wuille
CC BY-SA 4.0
2021-12-06T16:50:00.407Z
Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/132098/discussion-between-manav-kampani-and-pieter-wuille).
Manav Kampani
CC BY-SA 4.0
2021-12-07T12:31:17.620Z
I suppose as soon as such a malicious node get's introduced which doesn't work according to the protocol, it would soon get banned.
Manav Kampani
CC BY-SA 4.0
2021-12-06T15:48:00.547Z
2021-12-06T16:27:38.710Z
2021-12-06T16:27:38.710Z
Pieter Wuille
<p>In a blockchain there are miner nodes and validator nodes. The job of a validator node is to validate transactions to be included in the mempool, broadcast or propagate the transaction for the other nodes and then to validate the candidate blocks created by the miner nodes. So can a validator node be maliciously programmed and deployed on the network by an attacker to accept/validate tampered transactions(favoring the attacker such as by double spending) generated by the attacker? If yes then what happens if the attacker owns more than 50% of the nodes? (not &gt;50% of the total hash power but &gt;50% of the total validator nodes)</p>

<transactions><security><full-node><nodes><sybil-attack>
Can a node be maliciously programmed to validate all the transactions coming from a specific entity?
Manav Kampani
# Can a node be maliciously programmed to validate all the transactions coming from a specific entity?

(Asked by: username_0 on 2021-12-06)

In a blockchain there are miner nodes and validator nodes. The job of a validator node is to validate transactions to be included in the mempool, broadcast or propagate the transaction for the other nodes and then to validate the candidate blocks created by the miner nodes. So can a validator node be maliciously programmed and deployed on the network by an attacker to accept/validate tampered transactions(favoring the attacker such as by double spending) generated by the attacker? If yes then what happens if the attacker owns more than 50% of the nodes? (not >50% of the total hash power but >50% of the total validator nodes)

**Tags:** transactions, security, full-node, nodes, sybil-attack


---

## 1 answers

### Answer by username_1 on 2021-12-06. Score: 5 | Accepted answer

The number of nodes that perform validation is completely irrelevant, because there is no vote.

Validating nodes validate everything independently; they all have their own mempool with transactions they believe are valid. Who cares that an attacker spins up a gazillion nodes? It won't make *your* node (which you're presumably using to validate your payments, if any) accept these invalid things.

> **Comments:**
> **username_0**: If there is no vote then why is a transaction further propagated to other nodes after being validated by that node? Also does the fact that "Validating nodes validate everything independently" means that a transaction will stand invalid even if one of the nodes find it to be invalid?  
> **username_1**: Nodes are free to relay a transaction or not, and they can certainly wreak havoc in the network if suddenly a huge portion of the network stops relaying. But they cannot *ever* make an honest node think an invalid transaction is valid. Which transactions *your* node considers valid or invalid is not determined at all by what its peers or other network nodes think about it.  
> **username_0**: ok I am a little confused now. Can you please explain me how a transaction is labelled valid or invalid in the bitcoin blockchain to be included in the mempool of the valid transactions?  
> **username_1**: There are hundreds of rules, and I can't go into detail for all of them, but the big picture is: doesn't steal someone's money without their signature, doesn't conjure up money out of nothing, doesn't spend the same coins twice. *Every* honest node validates *all* these rules for *every* transaction independently (it does not trust what other nodes think about it), for every transaction it sees separately (as a mempool tx) or in a block (in which case, if the transaction is invalid, the entire block it is in is considered invalid too).  
> **username_0**: so are you saying that every node has it's own mempool and includes a tx in it according to it's personal understanding of the tx as a valid or invalid one?  
> **username_1**: Yes, every node has its own mempool. There are often small inconsistencies between nodes. Every node also has its own idea of which blocks are valid and accepted (e.g. they may not have heard about a new block that was recently mined), but due to the incentives around PoW, all nodes necessarily converge towards the same blockchain after some time. That convergence does not exist for the mempool.  
> **username_0**: okay makes sense, but then how do the miner nodes decide from which validator node's mempool to pick up the transactions and block them together?  
> **username_1**: They draw transactions to mine from *their own* mempool. That's the only one they know is honest.  
> **username_0**: but I have read that not all miner nodes need to be validator nodes too. What about them?  
> **username_1**: That's hard to answer without context. Perhaps that statement is using the word "miner" to refer to hashing hardware, which generally outsources the block construction to a mining pool operator entirely (so hashers don't have a mempool, but they also don't select transactions for blocks at all). Perhaps the statement is referring to the theoretical possibility of having a miner that only produces empty blocks (which works without a mempool). But in practice: all miners (in the sense of nodes that produce block candidates for mining) have their own mempool.  
> **username_0**: so a mining pool operator, being a true "miner node" will have it's own mempool to select the txns from right? Here is the article I read it from: https://medium.com/sazmining/what-is-a-bitcoin-node-b1106b050ace  
> **username_1**: Yes, mining pools construct block templates, and do so based on the contents of their own validating node's mempool.  
> **username_0**: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/132098/discussion-between-username_0-username_0-and-username_1-username_1).  
> **username_0**: I suppose as soon as such a malicious node get's introduced which doesn't work according to the protocol, it would soon get banned.  

---

