Bitcoin Forum
May 08, 2024, 06:35:38 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How receive sender Public Key from bitcoin transaction ?  (Read 2110 times)
roleg (OP)
Newbie
*
Offline Offline

Activity: 40
Merit: 0


View Profile
December 21, 2013, 07:27:37 AM
 #1

I have this transaction:

Code:
Array
(
    [txid] => 107b485a1b19d659173e5c5de762f4ae235f4cd913bffe0386ac87c28721d3ef
    [version] => 1
    [locktime] => 0
    [vin] => Array
        (
            [0] => Array
                (
                    [txid] => ee759554cffc082d1168691df3c51bba0b16cdcd2d2e340b20d16ac734b525a5
                    [vout] => 0
                    [scriptSig] => Array
                        (
                            [asm] => 304502205be1eeb9c2bbbec97958fa52109dfb4845e15882772f28433c42089aca248322022100af23b8dc1d2b1d9bae4bf1a31027554a7c0c2dc75ead0297617e6e4a9939316501 022e2531ee7a16dbaf83e3554334bb6adea93af0fb2f221cb17b9ffbb587e6bb7f
                            [hex] => 48304502205be1eeb9c2bbbec97958fa52109dfb4845e15882772f28433c42089aca248322022100af23b8dc1d2b1d9bae4bf1a31027554a7c0c2dc75ead0297617e6e4a993931650121022e2531ee7a16dbaf83e3554334bb6adea93af0fb2f221cb17b9ffbb587e6bb7f
                        )

                    [sequence] => 4294967295
                )

        )

    [vout] => Array
        (
            [0] => Array
                (
                    [value] => 0.01
                    [n] => 0
                    [scriptPubKey] => Array
                        (
                            [asm] => OP_DUP OP_HASH160 686f68f7c47a0b11dc971857cdc2148a8dd11418 OP_EQUALVERIFY OP_CHECKSIG
                            [hex] => 76a914686f68f7c47a0b11dc971857cdc2148a8dd1141888ac
                            [reqSigs] => 1
                            [type] => pubkeyhash
                            [addresses] => Array
                                (
                                    [0] => LUkA14u3fjLCgnBfC5NcoN7DhVt5XARbd7
                                )

                        )

                )

            [1] => Array
                (
                    [value] => 0.04091674
                    [n] => 1
                    [scriptPubKey] => Array
                        (
                            [asm] => OP_DUP OP_HASH160 4567476389e2e7bb397f55da01d0b0f9c62de7e4 OP_EQUALVERIFY OP_CHECKSIG
                            [hex] => 76a9144567476389e2e7bb397f55da01d0b0f9c62de7e488ac
                            [reqSigs] => 1
                            [type] => pubkeyhash
                            [addresses] => Array
                                (
                                    [0] => LRYvcPbrT8K3WxrP8cN7ZR6L5tSzH1HgD4
                                )

                        )

                )

        )


How receive sender Public Key from this transaction?
Or where I can get sender Public Key using bitcoin RPC API?
1715193338
Hero Member
*
Offline Offline

Posts: 1715193338

View Profile Personal Message (Offline)

Ignore
1715193338
Reply with quote  #2

1715193338
Report to moderator
Activity + Trust + Earned Merit == The Most Recognized Users on Bitcointalk
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715193338
Hero Member
*
Offline Offline

Posts: 1715193338

View Profile Personal Message (Offline)

Ignore
1715193338
Reply with quote  #2

1715193338
Report to moderator
1715193338
Hero Member
*
Offline Offline

Posts: 1715193338

View Profile Personal Message (Offline)

Ignore
1715193338
Reply with quote  #2

1715193338
Report to moderator
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 275


View Profile
December 21, 2013, 09:27:42 AM
 #2

The public key isn't stored in a transaction or the block chain, but it's hash is. Normally blockexplorer or something will pick out the public key from the signature when spent (you're looking for the public key for the sender, who has just signed the transaction with this part:)
Code:
                    [scriptSig] => Array
                        (
                            [asm] => 304502205be1eeb9c2bbbec97958fa52109dfb4845e15882772f28433c42089aca248322022100af23b8dc1d2b1d9bae4bf1a31027554a7c0c2dc75ead0297617e6e4a9939316501 022e2531ee7a16dbaf83e3554334bb6adea93af0fb2f221cb17b9ffbb587e6bb7f
                            [hex] => 48304502205be1eeb9c2bbbec97958fa52109dfb4845e15882772f28433c42089aca248322022100af23b8dc1d2b1d9bae4bf1a31027554a7c0c2dc75ead0297617e6e4a993931650121022e2531ee7a16dbaf83e3554334bb6adea93af0fb2f221cb17b9ffbb587e6bb7f
                        )

Can't get onto explorer.litecoin.com right now but it might help you when it gets back up..

Bitwasp Developer.
roleg (OP)
Newbie
*
Offline Offline

Activity: 40
Merit: 0


View Profile
December 21, 2013, 09:40:52 AM
 #3

I want recover sender address from this transaction.
andytoshi
Full Member
***
Offline Offline

Activity: 179
Merit: 151

-


View Profile
December 21, 2013, 10:05:23 PM
 #4

I want recover sender address from this transaction.

There is no from address. It is clear what you are asking for, but not why you need it or why you believe it is the "sender's address".

You may find it worthwhile to read http://download.wpsoftware.net/bitcoin/bitcoin-faq.pdf .
piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1354


aka tonikt


View Profile WWW
December 22, 2013, 12:55:33 AM
 #5

the public key in your example is:
Code:
022e2531ee7a16dbaf83e3554334bb6adea93af0fb2f221cb17b9ffbb587e6bb7f

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
roleg (OP)
Newbie
*
Offline Offline

Activity: 40
Merit: 0


View Profile
December 22, 2013, 06:33:29 PM
 #6

the public key in your example is:
Code:
022e2531ee7a16dbaf83e3554334bb6adea93af0fb2f221cb17b9ffbb587e6bb7f

OK!

and I try, create address from it
Code:
step1 022e2531ee7a16dbaf83e3554334bb6adea93af0fb2f221cb17b9ffbb587e6bb7f - public key
step2 0366f01948a5f5621ec9b7f78a6e7f549b4600656f5e51706b24350b37c9168b - sha256
step3 7ec68dcd19e108813204d645b0a6354999acdad2 - ripemd160
step4 007ec68dcd19e108813204d645b0a6354999acdad2 - 00 + step3
step5 4342cf3808ad504d28a366ea89a098249104921781a6d46347e70c2c43bdbb96 - sha256
step6 88774008f1d141d6efc3b55ffd8062d46d2b12137655f1d5be608d3d059938aa - sha256
step7 88774008 - checksum substr($step6,0,8)
step8 007ec68dcd19e108813204d645b0a6354999acdad288774008 - step4 + checksum
step9 1CZKzwR9tM5SLTS9bZEQyd1eHCGHewFQ87 - address in base58

but is not true  Embarrassed
piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1354


aka tonikt


View Profile WWW
December 22, 2013, 06:39:55 PM
 #7

but is not true  Embarrassed
It is true - that's the address.
Why do you think that it isn't?

1CZKzwR9tM5SLTS9bZEQyd1eHCGHewFQ87 - is exactly what 022e2531ee7a16dbaf83e3554334bb6adea93af0fb2f221cb17b9ffbb587e6bb7f points to.

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
roleg (OP)
Newbie
*
Offline Offline

Activity: 40
Merit: 0


View Profile
December 22, 2013, 06:48:16 PM
 #8

becouse I send from LWnHG9iyy1KVbG8JmhDiFe5QVQdZnxtqGW
but Litecoin address to Litecoin address
piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1354


aka tonikt


View Profile WWW
December 22, 2013, 06:51:13 PM
 #9

becouse I send from LWnHG9iyy1KVbG8JmhDiFe5QVQdZnxtqGW
but Litecoin proto
Well, then you should have told us that you meant litecoin, not bitcoin.

I don't know litecoin address specifics, but I guess that there should be at least a different "version" byte (the 00 in front, added in step4, will likely be something else).

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1354


aka tonikt


View Profile WWW
December 22, 2013, 06:58:32 PM
 #10

the 00 in front, added in step4, will likely be something else
It is 48 (decimal) - replace 00 with 30 and you will get LWnHG9iyy1KVbG8JmhDiFe5QVQdZnxtqGW

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
roleg (OP)
Newbie
*
Offline Offline

Activity: 40
Merit: 0


View Profile
December 22, 2013, 07:05:47 PM
 #11

the 00 in front, added in step4, will likely be something else
It is 48 (decimal) - replace 00 with 30 and you will get LWnHG9iyy1KVbG8JmhDiFe5QVQdZnxtqGW

 Cheesy OMG !
You My HERO!!!  Grin
snks!
bitpop
Legendary
*
Offline Offline

Activity: 2912
Merit: 1060



View Profile WWW
December 22, 2013, 09:28:58 PM
 #12

Wow

marathasam
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
May 04, 2017, 02:30:19 PM
 #13

Hi Roleg,

I'm trying develop same function to get vin address from public key by using c++, while coding i tried pub key mentioned above in this post and generated sha256 but i'm getting different output.
(output: 36bdb67e9a379df3e208ab87941d7320aabde7204f6eb4a1b31660804f958c15). I have used openssl/sha.h for sha256. It would be great, if you could tell me how you got that sha256 value from pubkey this pubkey (022e2531ee7a16dbaf83e3554334bb6adea93af0fb2f221cb17b9ffbb587e6bb7f).


Kristina303
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
April 27, 2019, 02:48:08 PM
 #14

There is more easy way  to find the publickey... only from( R S Z ) in a seconds.

Plus i have a code which working just perfectly...  Wink





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!