<p>The miner "collects" transactions just by listening on the <a href="https://bitcoin.stackexchange.com/questions/11270/how-do-bitcoin-nodes-know-where-to-send-new-transactions-and-blocks-to/11272#11272">peer-to-peer gossip network</a> where nodes send transactions to one another.</p>

<p>Every transaction has a digital signature which proves that this specific transaction was authorized by the owner of the funds (specifically, the person who knows the private key corresponding to the address where the funds were previously held).  You can't change the amount, destination, or fee of the transaction without invalidating the signature.  So the miner doesn't have to trust that all received transactions are valid; she can (and must) actually verify the signatures.  </p>

<p>There's no guarantee that all transactions sent over the gossip network are "authentic", but as noted above any inauthentic transactions would be immediately detected and ignored, due to the signature being invalid.  Moreover, nodes that send such transactions get banned by their peers - this isn't strictly necessary for security (since everybody is verifying signatures anyway) but just helps keep those nodes from wasting everyone's time and bandwidth.</p>

<p>Likewise, when a miner produces a block, other miners (and every other node on the network) will check that the block meets all requirements of the Bitcoin protocol.  One of these requirements is that every transaction in the block has valid signatures.  So if our miner tries to "distort" transactions, their signatures will be invalid, and so her block will be considered invalid by other miners.  This means that when they produce their own blocks, nobody will list her block as the "previous", meaning that it won't end up as part of the block chain in the long run.  This in turn means that she won't get the 12.5 BTC block reward, nor the transaction fees associated with her block.  So trying to mess with transactions in the block won't work, and carries a severe penalty besides.</p>

CC BY-SA 3.0
2018-01-12T15:37:59.270Z
2018-01-12T15:37:59.270Z
Nate Eldredge
<p>From this post, I get some sense of how bitcoin works:</p>

<blockquote>
  <p><a href="https://bitcoin.stackexchange.com/questions/148/what-exactly-is-mining">What exactly is Mining?</a></p>
</blockquote>

<p>Some dots I can't connect are related to how collecting transaction works: </p>

<ul>
<li><p>Where to collect? Are these collected transactions always be
authentic (i.e. the user intended to perform such transaction with
promised transaction fees.)? </p></li>
<li><p>I can't see how a block ensures the collected transactions are
faithfully represented. can't they be distort by a miner?</p></li>
</ul>

<p>Thank you for shedding some lights.</p>

<transactions>
What exactly is collecting transactions?
cz0590
# What exactly is collecting transactions?

(Asked by: username_0 on 2018-01-12)

From this post, I get some sense of how bitcoin works:

> [What exactly is Mining?](https://bitcoin.stackexchange.com/questions/148/what-exactly-is-mining)

Some dots I can't connect are related to how collecting transaction works:

* Where to collect? Are these collected transactions always be
  authentic (i.e. the user intended to perform such transaction with
  promised transaction fees.)?
* I can't see how a block ensures the collected transactions are
  faithfully represented. can't they be distort by a miner?

Thank you for shedding some lights.

**Tags:** transactions


---

## 1 answers

### Answer by username_1 on 2018-01-12. Score: 0 | Accepted answer

The miner "collects" transactions just by listening on the [peer-to-peer gossip network](https://bitcoin.stackexchange.com/questions/11270/how-do-bitcoin-nodes-know-where-to-send-new-transactions-and-blocks-to/11272#11272) where nodes send transactions to one another.

Every transaction has a digital signature which proves that this specific transaction was authorized by the owner of the funds (specifically, the person who knows the private key corresponding to the address where the funds were previously held). You can't change the amount, destination, or fee of the transaction without invalidating the signature. So the miner doesn't have to trust that all received transactions are valid; she can (and must) actually verify the signatures.

There's no guarantee that all transactions sent over the gossip network are "authentic", but as noted above any inauthentic transactions would be immediately detected and ignored, due to the signature being invalid. Moreover, nodes that send such transactions get banned by their peers - this isn't strictly necessary for security (since everybody is verifying signatures anyway) but just helps keep those nodes from wasting everyone's time and bandwidth.

Likewise, when a miner produces a block, other miners (and every other node on the network) will check that the block meets all requirements of the Bitcoin protocol. One of these requirements is that every transaction in the block has valid signatures. So if our miner tries to "distort" transactions, their signatures will be invalid, and so her block will be considered invalid by other miners. This means that when they produce their own blocks, nobody will list her block as the "previous", meaning that it won't end up as part of the block chain in the long run. This in turn means that she won't get the 12.5 BTC block reward, nor the transaction fees associated with her block. So trying to mess with transactions in the block won't work, and carries a severe penalty besides.


---

