2
I know that getting the address from the blk*.dat files is discussed a lot of times. But I don't get it why? When I have the raw scriptSig I can encode it and get the bitcoin address or not?
E.g. the first block the first transation:
input scriptSig (this value is correct, as defined here: https://en.bitcoin.it/wiki/Genesis_block):
04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73
output scriptSig:
4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac
as written in here: https://en.bitcoin.it/wiki/Genesis_block the address of the output is:
1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
now, how to get from the scriptSig 4104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac to the address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa?
If you try it here: http://gobittest.appspot.com/Address the output is NOT the expected address "1A1....."
My fault was, that I took the first and last byte also as part of the pub-key. when I removed it, everything was correct – Erhard Dinhobl – 2016-05-30T06:08:03.760
But how to convert all the others to an address (beside those in the genesis block)? like: 76a91487bfdc1e986af9671805a902e0b2ca853f587d6288ac – Erhard Dinhobl – 2016-06-10T06:16:36.877
1Take out the 76a914 at the beginning (OP_DUP, OP_HASH160, 20 byte length) and the 88ac at the end (OP_EQUALVERIFY, OP_CHECKSIG) and put that into box 3. – Jimmy Song – 2016-06-10T20:07:05.207
Thanks I will try it! But is there a general approache for that? Because I have some other scripts and I think asking for every case would lead to a huge blowup..... – Erhard Dinhobl – 2016-06-13T12:23:24.947
Should I interpret the script and take the stack? – Erhard Dinhobl – 2016-06-13T13:01:31.533
because "a9149cb09d17e24e9b985a4efccf44ee4debce48ef0b87" is another problem and I tried many paddings left and right – Erhard Dinhobl – 2016-06-13T15:04:26.300
1The way to get this generally is to take the binary and make it into script form. OP_HASH160 <hash> OP_EQUAL seems to be the form, so if you take out the a914 at the front and 87 at the end, you'll have the hash160 (box 3). Note this means there needs to be no signature, so it's a very dangerous script that shouldn't get used. – Jimmy Song – 2016-06-19T02:17:23.033
Ok,. I take
Transaction e99783084c44b670c8206c8b3071878963bcf691812005bb416666ba1f500301
At out1 script sig is: a914564960b6d6eb2d10e4580b1441fd69793a184c0287
and then based on walletexplorer.com, the
address there should be: 39ZFwRH6LrYwSttfWU8Kme7vMpC1jpZVvM
So I take "a914" (begin) and "87" (end) away.
Remaining script sig: 564960b6d6eb2d10e4580b1441fd69793a184c02
Now i tried this in every box on the site http://gobittest.appspot.com/Address but I never got the address: 39ZFwRH6LrYwSttfWU8Kme7vMpC1jpZVvM.
Maybe someone else has some information. – Erhard Dinhobl – 2016-07-25T11:15:22.190