Bitcoin Forum
May 21, 2024, 01:16:12 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: possible to decode bitcoin address from 'scriptSig' in a raw transaction?  (Read 2332 times)
derrend (OP)
Hero Member
*****
Offline Offline

Activity: 707
Merit: 505



View Profile WWW
May 19, 2014, 04:18:06 AM
 #1

Code:
7.  "in":[
8.    {"prev_out":
9.      {"hash":"2007ae...",
10.      "n":0},
11.    "scriptSig":"304502... 042b2d..."}],

Quote
Line 11 contains the signature of the person sending the money,
304502..., followed by a space, and then the corresponding public key, 04b2d.... Again, these are both in hexadecimal.

Can I convert the public key in scriptSig back into it's corresponding bitcoin address or is this not possible?
Thanks Smiley
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
May 19, 2014, 04:43:01 AM
 #2

Code:
7.  "in":[
8.    {"prev_out":
9.      {"hash":"2007ae...",
10.      "n":0},
11.    "scriptSig":"304502... 042b2d..."}],

Quote
Line 11 contains the signature of the person sending the money,
304502..., followed by a space, and then the corresponding public key, 04b2d.... Again, these are both in hexadecimal.

Can I convert the public key in scriptSig back into it's corresponding bitcoin address or is this not possible?
Thanks Smiley

http://lmgtfy.com/?q=technical+background+of+bitcoin+address&l=1
cp1
Hero Member
*****
Offline Offline

Activity: 616
Merit: 500


Stop using branwallets


View Profile
May 19, 2014, 04:55:55 AM
 #3

Yes, there are many utilities to do that, or you can write your own.  For example:

Code:
$ echo 0406b7bb1663fc7b6a8a5630038a393581fe24c4fa6da64d94fd76de758885809f40ba54c40b95040294defc84d255079b4a13d1f784c1cf271dbc0d4e864a1696 | sx addr
$ 1F1kaJLcYMFGK8Fzx5HD1gBjciGJ6U3a1e

Guide to armory offline install on USB key:  https://bitcointalk.org/index.php?topic=241730.0
derrend (OP)
Hero Member
*****
Offline Offline

Activity: 707
Merit: 505



View Profile WWW
May 19, 2014, 05:22:30 AM
 #4

I did it with gferrin's bitcoin-code,
My confusion stemmed from the
Code:
base58.public_key_to_bc_address()
function in gavinandresen's bitcointools giving me the wrong result. (most likely I am running the wrong version or something)

Thank you for the pointers fellas Smiley
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!