OK I'm stuck.
I've been following along
https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addressesI'd like to do that in php.
The goal is generation of pseudo brain wallets for business - e.g.
fas568#!hj + some string that acts as a key to me + serialNumber
Generate 10k pairs of private keys / public addresses to store in database kept off-line.
As purchases are confirmed, I can query that database for the private keys and import them into a wallet.
In the event that the offline computer fails, I just need to know the salt and the phrase and can re-generate them.
With that link above, I have all the steps figured out except :
* generation of the public key from the ECDSA
* base58 encoding of 25-byte binary Bitcoin Address
First I haven't even tried to tackle yet, but I'm having a little trouble understanding the algorythm behind the base58 encoding.
It's treated as a long integer, but are the 00 at the front considered part of that? That doesn't make sense. What about the checksum at the end?
Is it all one long integer or is it converted 256-bit component at a time? Nothing I seem to try matches the results for public address in the example.
I'm a little surprised php-pear doesn't already have something in it bitcoin specific, maybe I just wasn't looking for right thing?
As far as why use php, it's what I know - and works just fine from the command line, a small little script will be able to generates hundreds of thousands of addresses I can (as needed) import for use into the public web server without needing any bitcoin software on the web server. Just have to be careful of hackers injecting their own addresses into the pool, but that would be quickly caught.
Anyway, any tips on the base58 encoding in php would be greatly appreciated.