<p>One is a pay-to-pubkey-hash script (the typical script represented by normal addresses), the other is a pay-to-pubkey script. Both are perfectly valid and standard.</p>

<p>The reason for using direct pay-to-pubkey in coinbases is because they are older. For most purposes pay-to-pubkey-hash is superior (you don't need to know the full public key of the recipient, there is a standard address type for them, there is a marginal security benefit, and they require less space in the validation database). However, direct pay-to-pubkey is just as valid, and the mining code was never adapted to use pubkey hashes instead.</p>

CC BY-SA 3.0
2014-05-26T07:48:00.227Z
2014-05-26T07:48:00.227Z
Pieter Wuille
<p>So, through an odd bug in hacking some stuff onto Bitcoin, I encountered a peculiar thing. </p>

<p>Basically, I managed to generate an transaction with 2 outputs. The first output was a typical  txout</p>

<pre><code>DUP HASH160 20:905a...a998 EQUALVERIFY CHECKSIG
</code></pre>

<p>However, a bug caused the second output (the change output, to send it back to myself) to be a mining generate transaction script:</p>

<pre><code>33:025c...6718 CHECKSIG
</code></pre>

<p>This was not considered a non-standard TX, and as far as I can tell, was interpreted as a valid transaction for sending coins and block explorers see it as being sent to the proper address. </p>

<p>What exactly is the difference between these two scripts? What is the significance of using a mining script for a transaction? </p>

<script><coinbase-transaction><p2sh>
What happens when a transaction script for mining is used for fund transfer?
Earlz
# What happens when a transaction script for mining is used for fund transfer?

(Asked by: username_0 on 2014-05-26)

So, through an odd bug in hacking some stuff onto Bitcoin, I encountered a peculiar thing.

Basically, I managed to generate an transaction with 2 outputs. The first output was a typical txout

```
DUP HASH160 20:905a...a998 EQUALVERIFY CHECKSIG

```

However, a bug caused the second output (the change output, to send it back to myself) to be a mining generate transaction script:

```
33:025c...6718 CHECKSIG

```

This was not considered a non-standard TX, and as far as I can tell, was interpreted as a valid transaction for sending coins and block explorers see it as being sent to the proper address.

What exactly is the difference between these two scripts? What is the significance of using a mining script for a transaction?

**Tags:** script, coinbase-transaction, p2sh


---

## 1 answers

### Answer by username_1 on 2014-05-26. Score: 2

One is a pay-to-pubkey-hash script (the typical script represented by normal addresses), the other is a pay-to-pubkey script. Both are perfectly valid and standard.

The reason for using direct pay-to-pubkey in coinbases is because they are older. For most purposes pay-to-pubkey-hash is superior (you don't need to know the full public key of the recipient, there is a standard address type for them, there is a marginal security benefit, and they require less space in the validation database). However, direct pay-to-pubkey is just as valid, and the mining code was never adapted to use pubkey hashes instead.


---

