Author

Topic: [ANN] bip32.org: JavaScript BIP32 - Now available for Dogecoin! (Read 3320 times)

jr. member
Activity: 34
Merit: 1
Personally, I think altcoins should not define a new version byte for extended private/public keys. BIP44 defines a way to derive altcoin addresses from a bitcoin extended private key, which all altcoins should support instead of making their own specification.
member
Activity: 210
Merit: 10
How would you initialize a new BIP32 object, using
Code:
gen_bip32 = new BIP32(xprv)
There's an error at
Code:
this.eckey.setCompressed(true);
, cant seem to find the setCompressed method anywhere...
sr. member
Activity: 412
Merit: 287
Fuck it, including those magic bytes in my PHP library for bip32..
member
Activity: 88
Merit: 10
This didn't get a whole lot of traction over in the Bitcoin forums, so I wanted to add support for my favorite coin!  If this can be of use to anyone, let me know!  Below is a copy-paste of what's in the other post:

---

I want to announce http://bip32.org, a JavaScript implementation of BIP32.  This project is based on my Multisignature P2SH project.

What is BIP32?

BIP0032 is a Bitcoin Improvement Proposal that describes a method to determinsiticly generate Bitcoin (and now DOGECOIN!) addresses and private keys. It also describes some really cool features such as public key derivation which allows you to generate new addresses without needing a private key.

Why should I care?

If you're like me, then you just care because this stuff is cool.  If you're not quite like me, then you're probably only interested in this if you like and/or use Brain Wallets.  This implementation allows you to produce Extended Private Keys based only on a single passphrase, which is in turn used to produce multiple Bitcoin addresses.  You have the advantage of deriving new addresses without ever needing to type in your passphrase.

How do I use it?

Simple. Change the Network type to "Dogecoin Mainnet" in the upper-righthand corner.  Then type in a passphrase into the "Passphrase" box and tweak the value in "Keypair index".  The generated keys are shown at the bottom of the page, along with a Dogecoin address you can send coins to.  

In order to spend, copy the "Derived private key", change the button at the top of the page to "BIP32 Key" and paste in the key you just copied.  Now copy the "Key" in the Key Info section.  This is the Dogecoin private key, and it can be used to spend by using the transaction generator at http://brainwallet.org/

More advanced users can use the site to do the following things:

  • Inspect extended key information: Simply paste in the key, and the Key Info fields are shown
  • Use any key derivation path you want: Switch the "Derivation Path" to "Custom" and enter your key path. The key must being with an "m". Variables "i" and "k" can show up in the path (i cannot be last), and you can only use private key derivation (using the apostrophe symbol) if the extended key you're deriving from is a private key.
  • The public key/private key derivation method only describes whether the final Keypair Index is generated using Public Key or Private Key derivation.  If this doesn't make sense to you, ignore it and leave it set to "Public Key"

Thanks. Feedback appreciated!  Donations are welcome: DCcF9r3UqSzjQWAjDnsrw9WJvddhuuPXFM



To the devs out there:   Dogecoin doesn't have any official "version bytes" for extended private keys, so I had to come up with some.  If anyone cares to draft a BIP0032 proposal for Dogecoin, here are the constants I used:

Code:
var DOGECOIN_MAINNET_PUBLIC = 0x02facafd;
var DOGECOIN_MAINNET_PRIVATE = 0x02fac398;
var DOGECOIN_TESTNET_PUBLIC = 0x0432a9a8;
var DOGECOIN_TESTNET_PRIVATE = 0x0432a243;
Jump to: