<blockquote>
  <p>How miners validate each transaction?</p>
</blockquote>

<p>Miners do not validate transactions. The nodes validate transactions, see Node Operation under <a href="https://en.bitcoin.it/wiki/Bitcoin#Bitcoin_mining" rel="nofollow noreferrer">Bitcoin Mining</a>. The miners get a block template from the node, which includes the block header that they will try to hash until the hash value is less than the target. See <a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow noreferrer">Bitcoin Hashing Algorithm</a>.</p>

<p>Nodes will make sure that the transactions are valid by checking the following:  </p>

<ol>
<li>The outputs signatures satisfy the input locking script. (The spender has access to spend the funds).</li>
<li>The output values are less than the inputs.</li>
<li>The values and the format is valid.</li>
</ol>

<blockquote>
  <p>There is a locking to each transaction? and sender also attach his
  digital signature to that transaction?</p>
</blockquote>

<p>Yes, transaction outputs have a locking script that the next spender must be able to satisfy with a digital signature. See the verification section in <a href="https://en.bitcoin.it/wiki/Transaction" rel="nofollow noreferrer">Transaction</a>.</p>

<blockquote>
  <p>What I understand is they check locking and digital signature. but
  locking contains receiver address. Then how digital signature of a
  sender will work with locking (which contains receiver address)?</p>
</blockquote>

<p>"A Bitcoin address is only a hash, so the sender can't provide a full public key in scriptPubKey. When redeeming coins that have been sent to a Bitcoin address, the recipient provides both the signature and the public key. The script verifies that the provided public key does hash to the hash in scriptPubKey, and then it also checks the signature against the public key," see <a href="https://en.bitcoin.it/wiki/Transaction#Verification" rel="nofollow noreferrer">Transaction Verification</a>.</p>

CC BY-SA 4.0
2018-08-04T17:34:39.067Z
2018-08-05T03:09:18.350Z
2018-08-05T03:09:18.350Z
JBaczuk
<p>There is a locking to each transaction? and sender also attach his digital signature to that transaction?</p>

<p>When this transaction comes to miners then how they validate this transaction is valid. </p>

<p>What I understand is they check locking and digital signature. but locking contains receiver address. Then how digital signature of a sender will work with locking (which contains receiver address)?</p>

<transactions><bitcoin-core><transaction-verification>
How miners validate each transaction?
bugCracker
# How miners validate each transaction?

(Asked by: username_0 on 2018-08-04)

There is a locking to each transaction? and sender also attach his digital signature to that transaction?

When this transaction comes to miners then how they validate this transaction is valid.

What I understand is they check locking and digital signature. but locking contains receiver address. Then how digital signature of a sender will work with locking (which contains receiver address)?

**Tags:** transactions, bitcoin-core, transaction-verification


---

## 1 answers

### Answer by username_1 on 2018-08-04. Score: 3 | Accepted answer

> How miners validate each transaction?

Miners do not validate transactions. The nodes validate transactions, see Node Operation under [Bitcoin Mining](https://en.bitcoin.it/wiki/Bitcoin#Bitcoin_mining). The miners get a block template from the node, which includes the block header that they will try to hash until the hash value is less than the target. See [Bitcoin Hashing Algorithm](https://en.bitcoin.it/wiki/Block_hashing_algorithm).

Nodes will make sure that the transactions are valid by checking the following:

1. The outputs signatures satisfy the input locking script. (The spender has access to spend the funds).
2. The output values are less than the inputs.
3. The values and the format is valid.

> There is a locking to each transaction? and sender also attach his
> digital signature to that transaction?

Yes, transaction outputs have a locking script that the next spender must be able to satisfy with a digital signature. See the verification section in [Transaction](https://en.bitcoin.it/wiki/Transaction).

> What I understand is they check locking and digital signature. but
> locking contains receiver address. Then how digital signature of a
> sender will work with locking (which contains receiver address)?

"A Bitcoin address is only a hash, so the sender can't provide a full public key in scriptPubKey. When redeeming coins that have been sent to a Bitcoin address, the recipient provides both the signature and the public key. The script verifies that the provided public key does hash to the hash in scriptPubKey, and then it also checks the signature against the public key," see [Transaction Verification](https://en.bitcoin.it/wiki/Transaction#Verification).


---

