Bitcoin Forum
September 27, 2018, 09:56:16 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Extract Bitcoin Address from Public Key  (Read 1714 times)
antonimasso
Member
**
Offline Offline

Activity: 73
Merit: 10


View Profile
August 18, 2014, 11:54:01 AM
 #1

Hello,

I'd like to extract the bitcoin address from a public key.
I want to create a MultiSig address and would like to check if the bitcoin address corresponds to the public key.
Does anyone know if this has already been made with Javascript?

Thanks
1538085376
Hero Member
*
Offline Offline

Posts: 1538085376

View Profile Personal Message (Offline)

Ignore
1538085376
Reply with quote  #2

1538085376
Report to moderator
1538085376
Hero Member
*
Offline Offline

Posts: 1538085376

View Profile Personal Message (Offline)

Ignore
1538085376
Reply with quote  #2

1538085376
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1538085376
Hero Member
*
Offline Offline

Posts: 1538085376

View Profile Personal Message (Offline)

Ignore
1538085376
Reply with quote  #2

1538085376
Report to moderator
1538085376
Hero Member
*
Offline Offline

Posts: 1538085376

View Profile Personal Message (Offline)

Ignore
1538085376
Reply with quote  #2

1538085376
Report to moderator
1538085376
Hero Member
*
Offline Offline

Posts: 1538085376

View Profile Personal Message (Offline)

Ignore
1538085376
Reply with quote  #2

1538085376
Report to moderator
kolinko
Full Member
***
Offline Offline

Activity: 490
Merit: 101



View Profile
August 18, 2014, 12:44:32 PM
 #2

I don't know about a javascript implementation, but for python you can check out ours:

https://github.com/orisi/wiki/wiki/Installing-the-oracle-node

And then run ./runclient.sh main

Here's a code that does it:
https://github.com/orisi/orisi/blob/master/src/client/main.py
(function main)

Sidera | Blockchain Technologies
Decentralized Wearable Devices WEARING THE FUTURE
➜ TELEGRAM ➜ FACEBOOK ➜ TWITTER ➜ REDDIT ➜ LINKEDIN
antonimasso
Member
**
Offline Offline

Activity: 73
Merit: 10


View Profile
August 18, 2014, 03:44:51 PM
 #3

I'd like to avoid having to make a request to the server to extract the bitcoin address from the public key.
I found another example on how to extract it with PHP (https://stackoverflow.com/questions/19233053/hashing-from-a-public-key-to-a-bitcoin-address-in-php), but I really prefer doing in it Javascript.
ffe
Sr. Member
****
Offline Offline

Activity: 305
Merit: 250



View Profile
August 18, 2014, 04:02:59 PM
 #4

dig into the JavaScript from Bitaddress.org
TheButterZone
Legendary
*
Offline Offline

Activity: 2268
Merit: 1008


Pay with SegWit!


View Profile WWW
August 18, 2014, 11:27:33 PM
 #5

What happens when you put the public key after https://blockchain.info/address/

?

Saying that you don't trust someone because of their behavior is completely valid.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1005


Gerald Davis


View Profile
August 18, 2014, 11:58:20 PM
 #6

What happens when you put the public key after https://blockchain.info/address/ ?

Nothing because a PubKey is not an address.   An address is a hash of the pubkey (PubKeyHash) or a hash of the script (ScriptHash) with version and checksum encoded in base58.
TheButterZone
Legendary
*
Offline Offline

Activity: 2268
Merit: 1008


Pay with SegWit!


View Profile WWW
August 19, 2014, 12:05:49 AM
 #7

What happens when you put the public key after https://blockchain.info/address/ ?

Nothing because a PubKey is not an address.   An address is a hash of the pubkey (PubKeyHash) or a hash of the script (ScriptHash) with version and checksum encoded in base58.

https://blockchain.info/address/62e28bc02c39a27ead237ff0c4039871b29be836

Saying that you don't trust someone because of their behavior is completely valid.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1005


Gerald Davis


View Profile
August 19, 2014, 01:08:13 AM
 #8

What happens when you put the public key after https://blockchain.info/address/ ?

Nothing because a PubKey is not an address.   An address is a hash of the pubkey (PubKeyHash) or a hash of the script (ScriptHash) with version and checksum encoded in base58.

https://blockchain.info/address/62e28bc02c39a27ead237ff0c4039871b29be836

That isn't a Public key it is a hash.  PubKeys are 256 bits.
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1000


View Profile
August 19, 2014, 04:39:29 AM
 #9

Quote
That isn't a Public key it is a hash.  PubKeys are 256 bits.
{troll mode on}
No.
pubkeys are 512 bits.
Yes, it is possible to "compress" it to 257 bits  Grin
{troll mode off}
antonimasso
Member
**
Offline Offline

Activity: 73
Merit: 10


View Profile
August 19, 2014, 06:29:42 AM
 #10

I finally used brainwallet's JS client code.

Thanks
antonimasso
Member
**
Offline Offline

Activity: 73
Merit: 10


View Profile
August 19, 2014, 07:43:14 AM
 #11

Working demo:

http://www.amasso.info/bitcoin/
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!