<p>The block validation process involves checking that all the individual transactions in it are all valid according to the consensus rules which are set in the Bitcoin Core C++ implementation.</p>

<p>Block validation is done by Bitcoin full nodes and one would assume by all miners. If a block is not valid then it will be rejected and any miner who attempted to insert an invalid transaction would have wasted all the time and effort to generate the block hash.</p>

CC BY-SA 3.0
2017-12-08T08:28:16.083Z
"checking that all the individual transactions in it are all valid"
How is performed this action?
BossShell
CC BY-SA 3.0
2017-12-08T09:12:18.573Z
In the case of a Bitcoin Core full node, for block verification see https://github.com/bitcoin/bitcoin/blob/master/src/validation.cpp and for transactions see https://github.com/bitcoin/bitcoin/blob/master/src/consensus/tx_verify.cpp. Other wallet software or miners may or may not employ equivalent logic.
sipsorcery
CC BY-SA 3.0
2017-12-07T22:50:47.247Z
2017-12-07T22:50:47.247Z
sipsorcery
<blockquote>
  <p>But how do they verify that the transactions in the block are not false? How do they see that the amounts are properly authorized? An attacker could create a transaction in which Alice sends him 5 BTC, without Alice knowing about it. Is it possible?</p>
</blockquote>

<p>Most coins spent to addresses require a signature to spend them. That signature can only be generated if you know the private key(s) corresponding to the address which they were sent to. Without the private key, the transaction spending those coins is invalid, and anyone can see that it is invalid. Thus if a transaction with an invalid signature was included in a block, that entire block would be invalid too, and rejected by the network.</p>

CC BY-SA 3.0
2018-01-07T02:14:34.500Z
2018-01-07T02:14:34.500Z
meshcollider
<p>When a miner can find a number to create a hash with enough zeros, the other miners can verify his work by testing that number and seeing if everything is correct. But how do they verify that the transactions in the block are not false? How do they see that the amounts are properly authorized? An attacker could create a transaction in which Alice sends him 5 BTC, without Alice knowing about it. Is it possible?</p>

<transactions><block><validation>
validation of a block with false transactions
BossShell
# validation of a block with false transactions

(Asked by: username_0 on 2017-12-07)

When a miner can find a number to create a hash with enough zeros, the other miners can verify his work by testing that number and seeing if everything is correct. But how do they verify that the transactions in the block are not false? How do they see that the amounts are properly authorized? An attacker could create a transaction in which Alice sends him 5 BTC, without Alice knowing about it. Is it possible?

**Tags:** transactions, block, validation


---

## 2 answers

### Answer by username_1 on 2017-12-07. Score: 2

The block validation process involves checking that all the individual transactions in it are all valid according to the consensus rules which are set in the Bitcoin Core C++ implementation.

Block validation is done by Bitcoin full nodes and one would assume by all miners. If a block is not valid then it will be rejected and any miner who attempted to insert an invalid transaction would have wasted all the time and effort to generate the block hash.

> **Comments:**
> **username_0**: "checking that all the individual transactions in it are all valid" How is performed this action?  
> **username_1**: In the case of a Bitcoin Core full node, for block verification see https://github.com/bitcoin/bitcoin/blob/master/src/validation.cpp and for transactions see https://github.com/bitcoin/bitcoin/blob/master/src/consensus/tx_verify.cpp. Other wallet software or miners may or may not employ equivalent logic.  

---

### Answer by username_2 on 2018-01-07. Score: 2

> But how do they verify that the transactions in the block are not false? How do they see that the amounts are properly authorized? An attacker could create a transaction in which Alice sends him 5 BTC, without Alice knowing about it. Is it possible?

Most coins spent to addresses require a signature to spend them. That signature can only be generated if you know the private key(s) corresponding to the address which they were sent to. Without the private key, the transaction spending those coins is invalid, and anyone can see that it is invalid. Thus if a transaction with an invalid signature was included in a block, that entire block would be invalid too, and rejected by the network.


---

