When does a transaction end up in the transaction pool?

0

I have been reading about the validation of transactions. And I understand the actual method in which a transaction is composed (by inputs and outputs). And I know a transaction ends up in a transaction pool before being put in a block.

However, I want to know what happens in between. How many nodes need to validate my transaction before it ends up in the transaction pool?

Yippee ki-yay

Posted 2018-05-04T11:49:29.170

Reputation: 1

Answers

4

The transaction pool (or mempool, as it's usually called) is not a network-wide pool. Each node maintains its own mempool.

When a node receives your tx, it will validate and add it to its own mempool, and possibly broadcast it further on. In some cases, such as a lot of unconfirmed txs, a node's mempool may be full, in which case it will not be added.

There is no network-wide consensus required to add your transaction to the mempool, each node does so individually, regardless of how many other nodes have validated that transaction.

Raghav Sood

Posted 2018-05-04T11:49:29.170

Reputation: 10 897

1

What Raghav said is entirely correct. Furthermore, if an invalid transaction was added to a node's transaction pool for some reason (e.g., the node wanted to cheat the network), the node would still have to do all the expensive mining (finding the right nonce) before it gets a chance of publishing the invalid transaction to the blockchain. If somehow it got lucky and was the first node in the network to find the correct hash, the transactions still had to be independently validated by every other node in the network. At which point, the other nodes will reject this invalid transaction (assuming other nodes are not collaborating) and the first node did all the mining for nothing.

G Bob

Posted 2018-05-04T11:49:29.170

Reputation: 11