Bitcoin Forum
May 26, 2024, 09:14:28 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Comprehensive Article on Generating a Bitcoin Address Using JavaScript  (Read 1599 times)
jp (OP)
Member
**
Offline Offline

Activity: 69
Merit: 10



View Profile WWW
August 27, 2013, 10:01:11 PM
 #1

Hey guys, I noticed the lack of a comprehensive article out there that explains exactly how Bitcoin addresses are created. So, I did the research, and wrote one Smiley It's pretty in depth. I'd love any feedback, thanks!

http://procbits.com/2013/08/27/generating-a-bitcoin-address-with-javascript

Helping the world exit the traditional financial system.
Bitalo_Maciej
Member
**
Offline Offline

Activity: 80
Merit: 10


Lead developer


View Profile WWW
August 28, 2013, 01:28:27 PM
 #2

Very nice write up. There are some libraries like bitcoin-js that do accomplish that task, but they aren't very well documented, so your work is definitely welcome here.

One note - The version byte can have up to four valid values for Bitcoin network:
- 0x00 - main network pubkey hash address
- 0x05 - main network script hash address (e.g. multisig address)
- 0x6F - test network pubkey hash address
- 0xC4 - test network script hash address

More information: https://en.bitcoin.it/wiki/List_of_address_prefixes

Web wallets get hacked all the time. Computer wallets get hacked all the time as well.
Solution? Hybrid P2SH wallets - safer than your online and offline wallets combined. Check it out, store and trade your Bitcoins with ease of mind!
hayek
Sr. Member
****
Offline Offline

Activity: 370
Merit: 250


View Profile
August 28, 2013, 03:53:23 PM
 #3

This was a great read
Nubarius
Sr. Member
****
Offline Offline

Activity: 310
Merit: 253


View Profile
August 30, 2013, 01:41:40 PM
 #4

Excellent article!
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1091


View Profile
August 30, 2013, 02:34:48 PM
 #5

Very nice write up. There are some libraries like bitcoin-js that do accomplish that task, but they aren't very well documented, so your work is definitely welcome here.

One note - The version byte can have up to four valid values for Bitcoin network:
- 0x00 - main network pubkey hash address
- 0x05 - main network script hash address (e.g. multisig address)
- 0x6F - test network pubkey hash address
- 0xC4 - test network script hash address

More information: https://en.bitcoin.it/wiki/List_of_address_prefixes

Obligatory, related plugs:

https://github.com/gasteve/node-libcoin  (bitcoin JS library, for node.js -- an update of bitcoinjs-server)
https://en.bitcoin.it/wiki/Identity_protocol_v1  (also uses base58-encode-check and a well known prefix)




Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
jp (OP)
Member
**
Offline Offline

Activity: 69
Merit: 10



View Profile WWW
August 30, 2013, 04:39:05 PM
 #6

Very nice write up. There are some libraries like bitcoin-js that do accomplish that task, but they aren't very well documented, so your work is definitely welcome here.

One note - The version byte can have up to four valid values for Bitcoin network:
- 0x00 - main network pubkey hash address
- 0x05 - main network script hash address (e.g. multisig address)
- 0x6F - test network pubkey hash address
- 0xC4 - test network script hash address

More information: https://en.bitcoin.it/wiki/List_of_address_prefixes

Obligatory, related plugs:

https://github.com/gasteve/node-libcoin  (bitcoin JS library, for node.js -- an update of bitcoinjs-server)
https://en.bitcoin.it/wiki/Identity_protocol_v1  (also uses base58-encode-check and a well known prefix)


Thanks, I wasn't aware of node-libcoin despite being so heavily invested in the Node.js community: https://npmjs.org/~jp. Jeff, it looks like you're one of the authors of the Node.js libcoin. I'm curious, why did you choose to do the ECC code in C++?


Helping the world exit the traditional financial system.
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1091


View Profile
August 30, 2013, 04:47:21 PM
 #7

Very nice write up. There are some libraries like bitcoin-js that do accomplish that task, but they aren't very well documented, so your work is definitely welcome here.

One note - The version byte can have up to four valid values for Bitcoin network:
- 0x00 - main network pubkey hash address
- 0x05 - main network script hash address (e.g. multisig address)
- 0x6F - test network pubkey hash address
- 0xC4 - test network script hash address

More information: https://en.bitcoin.it/wiki/List_of_address_prefixes

Obligatory, related plugs:

https://github.com/gasteve/node-libcoin  (bitcoin JS library, for node.js -- an update of bitcoinjs-server)
https://en.bitcoin.it/wiki/Identity_protocol_v1  (also uses base58-encode-check and a well known prefix)


Thanks, I wasn't aware of node-libcoin despite being so heavily invested in the Node.js community: https://npmjs.org/~jp. Jeff, it looks like you're one of the authors of the Node.js libcoin. I'm curious, why did you choose to do the ECC code in C++?

Using OpenSSL is important for bug-for-bug compatibility, even ignoring the performance improvements.


Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
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!