As per my understanding user seed somehow gets generated into a private key, then using that private key to derive the public key and from that you derive the address. Does anyone have any further information on how this achieved with javascript or what is the architecture for this kind of setup. Any help on understanding it would be great.
The generatepublickey function's parameter is private key. I find the public key is generated by hashing private key in your code. I find the public key is generated by hashing private key in your code. Now that we have our private key, we can generate a public key. Recall that Bitcoin keys use the secp256k1 (info on 2.7.1) parameters. Public keys are generated by: $$ Q = dG $$ where $ Q $ is the public key, $ d $ is the private key, and $ G $ is a curve parameter. A private key represented as random words is safe. For a brute-force attacker such a private key is just as difficult to guess as the fully random 64 character bitcoin private key. Also, words are much easier to write down or even remember. A Bitcoin private key is a secret number which every Bitcoin wallet has. This 256-bit number can be represented in several formats: in hexadecimal – 256 bits, in hexadecimal is 32 bytes, or 64 characters in the range 0-9 or A-F, Base64 string, a WIF key, or a mnemonic phrase.
This project was written in May 2013 for educational purposes.
Modern cryptocurrency wallets should use hierarchical deterministic (HD) keys instead.
btckeygenie is a standalone Bitcoin keypair/address generator written in Go.btckeygenie generates an ECDSA secp256k1 keypair, dumps the public key incompressed and uncompressed Bitcoin address, hexadecimal, and base64 formats,and dumps the private key in Wallet Import Format (WIF), Wallet Import FormatCompressed (WIFC), hexadecimal, and base64 formats.
btckeygenie includes a lightweight Go package called btckey to easily generatekeypairs, and convert them between compressed and uncompressed varieties ofBitcoin Address, Wallet Import Format, and raw bytes.
See documentation on btckey here: https://godoc.org/github.com/vsergeev/btckeygenie/btckey
Generate public and private key online. Donations are welcome at 15PKyTs3jJ3Nyf3i6R7D9tfGCY1ZbtqWdv
:-)
To fetch, build, and install btckeygenie to $GOPATH/bin
:
btckeygenie is MIT licensed. See the included LICENSE
file for more details.