Bitcoin Forum
November 08, 2024, 07:51:42 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Extract Bitcoin Address from Public Key  (Read 1812 times)
antonimasso (OP)
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
kolinko
Full Member
***
Offline Offline

Activity: 518
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)
antonimasso (OP)
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: 308
Merit: 250



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

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

Activity: 3066
Merit: 1032


RIP Mommy


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: 1079


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: 3066
Merit: 1032


RIP Mommy


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: 1079


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: 1019


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 (OP)
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 (OP)
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:  

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