<p>In spending a pay-to-pubkey transaction output, just the signature is put into the scriptSig. The signature can be used to do public key recovery, but you won't be able to uniquely identify the exact public key representation that was put into the scriptPubKey. You can mathematically narrow it down to 4 possibilities using the public key recovery method, but to get the exact representation that was used, you'll need to do a lookup on the previous output. </p>

<p>For more on public key recovery, look at <a href="https://crypto.stackexchange.com/questions/18105/how-does-recovering-the-public-key-from-an-ecdsa-signature-work">https://crypto.stackexchange.com/questions/18105/how-does-recovering-the-public-key-from-an-ecdsa-signature-work</a></p>

<p>In brief, you can determine the X coordinate of the ECC public key, and then the Y coordinate can be one of two values. And for each of those two points ((X, Y) &amp; (X, -Y)), there are two representations, compressed and decompressed form. </p>

CC BY-SA 3.0
2016-03-26T02:22:15.933Z
2016-03-26T02:22:15.933Z
2017-04-13T12:48:25.933Z
morsecoder
<p>I can't understand your question but I will try to clarify the things for you.</p>

<p>A Pay-to-Pub-Key transaction is a type of transaction which is generated basically from a miner in order to send back to his own address the reward(now is 25 BT) after a suceessful creation of a Block. This transaction is called coinbase transaction and is the first located transaction of the Block which is going to be mined by him.</p>

<p>The structure of the script which satisfies this kind of transaction is:</p>

<p>•   Locking Script or scriptPubKey (which located in the Output of a transaction)</p>

<pre><code>&lt; Public Key of Miner&gt; OP_CHECKSIG
</code></pre>

<p>•   Unlocking Script or scriptSig (which located in the Input of a transaction)</p>

<pre><code>&lt;Signature from Private Key of Miner&gt; 
</code></pre>

<p>•   Validation Script</p>

<pre><code>&lt;Signature from Private Key of Miner&gt; &lt; Public Key of Miner&gt; OP_CHECKSIG
</code></pre>

<p>In order the miner to redeem the 25BT value :</p>

<p>His signature located in Locking script have to be created by his private key.
In order to check that condition, his public key is used, which corresponds to this private key.</p>

<p>As a result the public Key can't create a signature. A signature is created by the private key and a message (or transaction) which is going to be signed with this private key.
You can't calculate the public key from the input, because the public key is located in the output or better in the Locking Script.</p>

CC BY-SA 3.0
2016-01-22T21:43:00.553Z
2016-01-22T21:43:00.553Z
gtopal
<p>I am looking to be able to calculate the public key from the transaction input.  The input is from a 'pay to public key' output.<br>
Can the public key of the input be generated from just the signature and the transaction that the input is in?</p>

<signature><transaction-input>
Is it possible to get the public key from a transaction input that is a 'pay to public key' output?
Jason Serafin
# Is it possible to get the public key from a transaction input that is a 'pay to public key' output?

(Asked by: username_0 on 2016-01-22)

I am looking to be able to calculate the public key from the transaction input. The input is from a 'pay to public key' output.  
Can the public key of the input be generated from just the signature and the transaction that the input is in?

**Tags:** signature, transaction-input


---

## 2 answers

### Answer by username_1 on 2016-03-26. Score: 1

In spending a pay-to-pubkey transaction output, just the signature is put into the scriptSig. The signature can be used to do public key recovery, but you won't be able to uniquely identify the exact public key representation that was put into the scriptPubKey. You can mathematically narrow it down to 4 possibilities using the public key recovery method, but to get the exact representation that was used, you'll need to do a lookup on the previous output.

For more on public key recovery, look at <https://crypto.stackexchange.com/questions/18105/how-does-recovering-the-public-key-from-an-ecdsa-signature-work>

In brief, you can determine the X coordinate of the ECC public key, and then the Y coordinate can be one of two values. And for each of those two points ((X, Y) & (X, -Y)), there are two representations, compressed and decompressed form.


---

### Answer by username_2 on 2016-01-22. Score: 1

I can't understand your question but I will try to clarify the things for you.

A Pay-to-Pub-Key transaction is a type of transaction which is generated basically from a miner in order to send back to his own address the reward(now is 25 BT) after a suceessful creation of a Block. This transaction is called coinbase transaction and is the first located transaction of the Block which is going to be mined by him.

The structure of the script which satisfies this kind of transaction is:

• Locking Script or scriptPubKey (which located in the Output of a transaction)

```
< Public Key of Miner> OP_CHECKSIG

```

• Unlocking Script or scriptSig (which located in the Input of a transaction)

```
<Signature from Private Key of Miner> 

```

• Validation Script

```
<Signature from Private Key of Miner> < Public Key of Miner> OP_CHECKSIG

```

In order the miner to redeem the 25BT value :

His signature located in Locking script have to be created by his private key.
In order to check that condition, his public key is used, which corresponds to this private key.

As a result the public Key can't create a signature. A signature is created by the private key and a message (or transaction) which is going to be signed with this private key.
You can't calculate the public key from the input, because the public key is located in the output or better in the Locking Script.


---

