Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: jp on August 27, 2013, 10:01:11 PM



Title: Comprehensive Article on Generating a Bitcoin Address Using JavaScript
Post by: jp on August 27, 2013, 10:01:11 PM
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 :) It's pretty in depth. I'd love any feedback, thanks!

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


Title: Re: Comprehensive Article on Generating a Bitcoin Address Using JavaScript
Post by: Bitalo_Maciej on August 28, 2013, 01:28:27 PM
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


Title: Re: Comprehensive Article on Generating a Bitcoin Address Using JavaScript
Post by: hayek on August 28, 2013, 03:53:23 PM
This was a great read


Title: Re: Comprehensive Article on Generating a Bitcoin Address Using JavaScript
Post by: Nubarius on August 30, 2013, 01:41:40 PM
Excellent article!


Title: Re: Comprehensive Article on Generating a Bitcoin Address Using JavaScript
Post by: jgarzik on August 30, 2013, 02:34:48 PM
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)





Title: Re: Comprehensive Article on Generating a Bitcoin Address Using JavaScript
Post by: jp on August 30, 2013, 04:39:05 PM
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++?



Title: Re: Comprehensive Article on Generating a Bitcoin Address Using JavaScript
Post by: jgarzik on August 30, 2013, 04:47:21 PM
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.