<p>First small problem: blockchair.com give me only output scripts, not input - is any blockexplorer online with it? I read binary data and this may be hard recreate my sample data and verify.
I test BTC block 500186. First is coinbase tx =   </p>

<pre><code> d45f88974168a7c1d04c9501872ee04ad2a1c4ef2d855afdc2a69c69d7802543
</code></pre>

<p>and I don't analyse it because has not previous transactions.</p>

<pre><code> Next is a bit odd transaction =              
 95637dddd99653a6421086e6ab9326341d47f5c29a3cea521e0d2dd6b7c693b1; 


 odd because script is short:      
 1600149471ea5ecd8f6c51cbe1793df6f5c8ee1894a694
</code></pre>

<p>this can I also skip.</p>

<pre><code>Next is 
83951f7cb7db18e22f30f319ecbfba2adfc0828a31a0df4edecb46a580c4df10

has script     
483045022100df7b1f04615972c7e9d05e9c6c176b95f1a9fc9b73e86eb6d6747336da118a4d02202021d00dab65b6000ef2fcae7525427d1dbec40a2def4196111b8b11c5247bfd012103eafee16adb27d36dc89e4aae0d1b5e0f8ddb2c9136612dc733ec65b1db128cca , 

it give me signature:  
 3045022100df7b1f04615972c7e9d05e9c6c176b95f1a9fc9b73e86eb6d6747336da118a4d02202021d00dab65b6000ef2fcae7525427d1dbec40a2def4196111b8b11c5247bfd01 
and key 
03eafee16adb27d36dc89e4aae0d1b5e0f8ddb2c9136612dc733ec65b1db128cca 
and hash of previous tx = 
132d98c0bf70264d224f8a2d19325a1f34edd5fddd387939c1f51dd9790aead5
</code></pre>

<p>I amd computing r and s numbers:
first has 33 bytes, second 32 bytes (should be 32 + 33?)</p>

<pre><code> r =   
 2100df7b1f04615972c7e9d05e9c6c176b95f1a9fc9b73e86eb6d6747336da118a
 s = 
 2021d00dab65b6000ef2fcae7525427d1dbec40a2def4196111b8b11c5247bfd
</code></pre>

<p>RecoverCompact can't recover becasue is 33+22 not 32+33 bytes, if I exchange r and s, is also bad; next scripts give me s and r for example 32+32, 33+33 bytes etc. 
Question: </p>

<pre><code>how compute r and s ?
RecoverCompact (from Bitcoin sources) hs parameter hash - it is hash of current or previous transaction?
After recover I must obtain second array of script from frist array of script + hash?
</code></pre>

CC BY-SA 4.0
2019-10-22T16:26:28.230Z
[In case it helps, here is how you get r and s from a pubkey in Python](https://bitcoin.stackexchange.com/questions/58853/how-do-you-figure-out-the-r-and-s-out-of-a-signature-using-python).
Jose Fonseca
CC BY-SA 4.0
2019-10-23T10:41:42.560Z
Main problem : is CKey::Sign and CKey::SignCompact but only one CKey::RecoverCompact. It is impossible recover key from normal signing message?
Saku
CC BY-SA 4.0
2019-10-24T09:00:18.197Z
@Saku you want to get the private key to Signature or you want to verify the Signature meccing with the public key?
vincenzopalazzo
<script><public-key><verification>
How verify (in C++) input signature?
Saku
# How verify (in C++) input signature?

(Asked by: username_0 on 2019-10-22)

First small problem: blockchair.com give me only output scripts, not input - is any blockexplorer online with it? I read binary data and this may be hard recreate my sample data and verify.
I test BTC block 500186. First is coinbase tx =   
 d45f88974168a7c1d04c9501872ee04ad2a1c4ef2d855afdc2a69c69d7802543

and I don't analyse it because has not previous transactions.
 Next is a bit odd transaction =              
 95637dddd99653a6421086e6ab9326341d47f5c29a3cea521e0d2dd6b7c693b1; 


 odd because script is short:      
 1600149471ea5ecd8f6c51cbe1793df6f5c8ee1894a694

this can I also skip.
Next is 
83951f7cb7db18e22f30f319ecbfba2adfc0828a31a0df4edecb46a580c4df10

has script     
483045022100df7b1f04615972c7e9d05e9c6c176b95f1a9fc9b73e86eb6d6747336da118a4d02202021d00dab65b6000ef2fcae7525427d1dbec40a2def4196111b8b11c5247bfd012103eafee16adb27d36dc89e4aae0d1b5e0f8ddb2c9136612dc733ec65b1db128cca , 

it give me signature:  
 3045022100df7b1f04615972c7e9d05e9c6c176b95f1a9fc9b73e86eb6d6747336da118a4d02202021d00dab65b6000ef2fcae7525427d1dbec40a2def4196111b8b11c5247bfd01 
and key 
03eafee16adb27d36dc89e4aae0d1b5e0f8ddb2c9136612dc733ec65b1db128cca 
and hash of previous tx = 
132d98c0bf70264d224f8a2d19325a1f34edd5fddd387939c1f51dd9790aead5

I amd computing r and s numbers:
first has 33 bytes, second 32 bytes (should be 32 + 33?)
 r =   
 2100df7b1f04615972c7e9d05e9c6c176b95f1a9fc9b73e86eb6d6747336da118a
 s = 
 2021d00dab65b6000ef2fcae7525427d1dbec40a2def4196111b8b11c5247bfd

RecoverCompact can't recover becasue is 33+22 not 32+33 bytes, if I exchange r and s, is also bad; next scripts give me s and r for example 32+32, 33+33 bytes etc. 
Question: 
how compute r and s ?
RecoverCompact (from Bitcoin sources) hs parameter hash - it is hash of current or previous transaction?
After recover I must obtain second array of script from frist array of script + hash?

**Tags:** script, public-key, verification

> **Comments:**
> **username_1**: [In case it helps, here is how you get r and s from a pubkey in Python](https://bitcoin.stackexchange.com/questions/58853/how-do-you-figure-out-the-r-and-s-out-of-a-signature-using-python).  
> **username_0**: Main problem : is CKey::Sign and CKey::SignCompact but only one CKey::RecoverCompact. It is impossible recover key from normal signing message?  
> **username_2**: @username_0 you want to get the private key to Signature or you want to verify the Signature meccing with the public key?  

---

## 0 answers

