<blockquote>
  <p>But what if all the eight nodes to whom a given node send the transaction are malicious/faulty? And all of them change the message in the original transaction. Wouldn't it allow for wrong transaction to get merged in the blockchain network?</p>
</blockquote>

<p>Transactions have signatures that sign the whole transaction (except signatures. Signatures are added after the transaction is signed). Signatures prove authenticity so it's impossible to change the transaction without invalidating the signature check.</p>

<blockquote>
  <p>I just want to know that when a node sends the transaction it received to its peers, the peers send it to their peers, how does the network keep the count of which transaction has been accepted by how many nodes? </p>
</blockquote>

<p>There's no count of acceptance. Every node keeps its own <em>mempool</em> which is a list of transactions that could be included in the next block.</p>

<p>PoW is about making blocks. When a block is broadcast, the transaction becomes the part of the immutable blockchain (unless that block is orphaned (replaced by another block.))</p>

<p>If the only nodes you're connected to are malicious, the worst thing they can do to you is to isolate you and log your IP-address and transactions.</p>

CC BY-SA 4.0
2020-05-13T15:18:54.393Z
Now I get that all nodes maintain the local list of verified transactions. I'm still not sure about counting the transaction part. I'm confused about whether the majority votes is required for verifying the transaction or for verifying the proposed block to merge in the chain? If it is required for merging the block, then how come the network find out that majority of nodes have verified the block. I have same doubt for the transaction part. Thank you for your answer :)
Ruchit Patel
CC BY-SA 4.0
2020-05-13T15:45:18.813Z
Miners validate transactions too. If even one transaction is invalid they would lose all the block reward. So invalid transactions don't make into blocks. If some of the other miners support the block and mine showing that block as the reference block, then there would be a chain split. Nodes don't vote, they just ignore a block and don't share it with their peers if they see the transaction as invalid (or nonstandard. There's also a standardness rule that transactions not obeying that can be included in blocks but those aren't relayed).
MCCCS
CC BY-SA 4.0
2020-05-13T12:58:47.477Z
2020-05-13T16:14:51.193Z
2020-05-13T16:14:51.193Z
MCCCS
<p>I looked at the question on how transactions are broadcast to the rest of the network in the blockchain network. 
In <a href="https://bitcoin.stackexchange.com/questions/32237/how-are-transactions-broadcast-to-the-rest-of-the-network/32479">this</a> stack exchange post, the author @morsecoder in the accepted answer mentions that : </p>

<blockquote>
  <p>Think of it like how gossip would spread. There are a bunch of people (nodes), and when one of them knows something, they tell it to the few (8 or so) people they are near (connected with), and then those people tell a few more people the message that was told to them, and then... Eventually everyone knows about the original information (transaction).</p>
</blockquote>

<p>But what if all the eight nodes to whom a given node send the transaction are malicious/faulty? And all of them change the message in the original transaction. Wouldn't it allow for wrong transaction to get merged in the blockchain network?</p>

<p>Also, once any given node sends the transaction it received to its peers, how does the network know that majority of peers have received the correct transaction and it's ready to get merged in the main chain. I'm not talking about the bitcoin network here. So, I'm not worried about the PoW for now. I just want to know that when a node sends the transaction it received to its peers, the peers send it to their peers, how does the network keep the count of which transaction has been accepted by how many nodes? </p>

CC BY-SA 4.0
2020-05-15T16:52:14.603Z
When you say "in the blockchain network", do you mean in the bitcoin network? Because different blockchain networks handle sybil protection differently.
David Schwartz
<relay><peer-discovery><broadcast><sybil-attack>
What if all the 8 peers of the node are malicious?
Ruchit Patel
# What if all the 8 peers of the node are malicious?

(Asked by: username_0 on 2020-05-13)

I looked at the question on how transactions are broadcast to the rest of the network in the blockchain network.
In [this](https://bitcoin.stackexchange.com/questions/32237/how-are-transactions-broadcast-to-the-rest-of-the-network/32479) stack exchange post, the author @morsecoder in the accepted answer mentions that :

> Think of it like how gossip would spread. There are a bunch of people (nodes), and when one of them knows something, they tell it to the few (8 or so) people they are near (connected with), and then those people tell a few more people the message that was told to them, and then... Eventually everyone knows about the original information (transaction).

But what if all the eight nodes to whom a given node send the transaction are malicious/faulty? And all of them change the message in the original transaction. Wouldn't it allow for wrong transaction to get merged in the blockchain network?

Also, once any given node sends the transaction it received to its peers, how does the network know that majority of peers have received the correct transaction and it's ready to get merged in the main chain. I'm not talking about the bitcoin network here. So, I'm not worried about the PoW for now. I just want to know that when a node sends the transaction it received to its peers, the peers send it to their peers, how does the network keep the count of which transaction has been accepted by how many nodes?

**Tags:** relay, peer-discovery, broadcast, sybil-attack

> **Comments:**
> **username_1**: When you say "in the blockchain network", do you mean in the bitcoin network? Because different blockchain networks handle sybil protection differently.  

---

## 1 answers

### Answer by username_2 on 2020-05-13. Score: 1 | Accepted answer

> But what if all the eight nodes to whom a given node send the transaction are malicious/faulty? And all of them change the message in the original transaction. Wouldn't it allow for wrong transaction to get merged in the blockchain network?

Transactions have signatures that sign the whole transaction (except signatures. Signatures are added after the transaction is signed). Signatures prove authenticity so it's impossible to change the transaction without invalidating the signature check.

> I just want to know that when a node sends the transaction it received to its peers, the peers send it to their peers, how does the network keep the count of which transaction has been accepted by how many nodes?

There's no count of acceptance. Every node keeps its own *mempool* which is a list of transactions that could be included in the next block.

PoW is about making blocks. When a block is broadcast, the transaction becomes the part of the immutable blockchain (unless that block is orphaned (replaced by another block.))

If the only nodes you're connected to are malicious, the worst thing they can do to you is to isolate you and log your IP-address and transactions.

> **Comments:**
> **username_0**: Now I get that all nodes maintain the local list of verified transactions. I'm still not sure about counting the transaction part. I'm confused about whether the majority votes is required for verifying the transaction or for verifying the proposed block to merge in the chain? If it is required for merging the block, then how come the network find out that majority of nodes have verified the block. I have same doubt for the transaction part. Thank you for your answer :)  
> **username_2**: Miners validate transactions too. If even one transaction is invalid they would lose all the block reward. So invalid transactions don't make into blocks. If some of the other miners support the block and mine showing that block as the reference block, then there would be a chain split. Nodes don't vote, they just ignore a block and don't share it with their peers if they see the transaction as invalid (or nonstandard. There's also a standardness rule that transactions not obeying that can be included in blocks but those aren't relayed).  

---

