Show Posts
|
Pages: [1]
|
Note the last line of the code at that link: alphabet[bn] in that code is equivalent to the $alphabet[gmp_strval($divmod[0])] that is missing from your code. Yeah I just figured out that's what you meant, lol. Once again, thanks!
|
|
|
As you exit this loop: while (gmp_strval($divmod[0]) >= 58) { $divmod = divmod($divmod[0], 58); $out = $alphabet[gmp_strval($divmod[1])] . $out; }
$divmod[0] = 4 But you never use that value. You exit the loop and print out the conversion that you've done so far, but you never calculate the final $alphabet[gmp_strval($divmod[0])] Oh you're right. I don't understand why, though? I'm porting it from https://github.com/bkkcoins/misc/blob/master/hexwif/hexwifand it's pretty much the exact same code, isn't it? Either way, thanks a lot!
|
|
|
https://en.bitcoin.it/wiki/Wallet_import_formatTrying to follow this example here to do this in PHP, but I get stuck at step 3. I can't seem to get the same SHA256 hash. I take the extended key from step 2 "800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D" and SHA256 it. I should get "8147786C4D15106333BF278D71DADAF1079EF2D2440A4DDE37D747DED5403592" according to step 3 but I just get "E2E4146A36E9C455CF95A4F259F162C353CD419CC3FD0E69AE36D7D1B6CD2C09" What am I doing wrong? As with everyone who comes here asking this question (I think this is the fifth time I've answered it, and I'm sure others have answered it many times as well), you are hashing the string (an ASCII representation of a hex number) instead of the actual hex number itself. Awesome! Thanks! I've got it working near perfectly, now. The only issue is that it's messing up on the final character. Do you by chance know PHP? $keyHex = $argv[1];
$alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
$exKey = '80' . $keyHex;
$chksum = substr(strtoupper(hash('sha256', hex2bin(strtoupper(hash('sha256', hex2bin($exKey)))))), 0, 8); echo "Checksum: " . $chksum . "\n";
$divmod = array(gmp_init($exKey . $chksum, 16), 0);
$out = "";
while (gmp_strval($divmod[0]) >= 58) { $divmod = divmod($divmod[0], 58); $out = $alphabet[gmp_strval($divmod[1])] . $out; }
echo $out . "\n";
function divmod($x, $y) { $div = gmp_div($x, $y); $mod = gmp_mod($x, $y);
return array($div, $mod); }
If I plug in "0C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D", it outputs "HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ", but it should be outputting "5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ" (note the prepending 5)
|
|
|
https://en.bitcoin.it/wiki/Wallet_import_formatTrying to follow this example here to do this in PHP, but I get stuck at step 3. I can't seem to get the same SHA256 hash. I take the extended key from step 2 "800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D" and SHA256 it. I should get "8147786C4D15106333BF278D71DADAF1079EF2D2440A4DDE37D747DED5403592" according to step 3 but I just get "E2E4146A36E9C455CF95A4F259F162C353CD419CC3FD0E69AE36D7D1B6CD2C09" What am I doing wrong?
|
|
|
I'm using vanitygen. I supply a public key to it and a prefix. It then finds the vanity address using said public key and provides me a partial private key. Sites like bitaddress.com can take that public key and the partial private key and determine the address. The public key itself is not enough; that returns a different address.
That functionality is intended for vanity key "farms" that calculate private keys as a service. The key combination ensures the generated key is known only by the client and not the service. I was involved in a short discussion on this a while back so I'll link the thread https://bitcointalk.org/index.php?topic=268567.0 in case its of any use to you. ...It generates a partial private key that gets converted to a public key and then added with the buyer's public key to calculate the address. Multiple sites and scripts offer this service, such as bitaddress and pybitcointools I'd like to know the algorithm to do this so that I can do it up in PHP.
|
|
|
In this, where would I stick the partial private key?
The private key is used to calculate the public key. You said you already have the public key. Not sure if this is the right section. Sorry if not.
How can I calculate the address if I have the public key and a private partial key?
Once you have the public key, that's all you need for calculating the address. Okay let me explain the scenario. I'm using vanitygen. I supply a public key to it and a prefix. It then finds the vanity address using said public key and provides me a partial private key. Sites like bitaddress.com can take that public key and the partial private key and determine the address. The public key itself is not enough; that returns a different address.
|
|
|
In this, where would I stick the partial private key?
|
|
|
bitaddress.org and navigate to the vanity wallet
Thank you. And now how can I do it offline? Save the site, access it from an offline computer. All the logic is in the client side javascript. It works just as well offline. Alright and now let's assume I want to know how it's done.
|
|
|
bitaddress.org and navigate to the vanity wallet
Thank you. And now how can I do it offline?
|
|
|
Not sure if this is the right section. Sorry if not.
How can I calculate the address if I have the public key and a private partial key?
|
|
|
Been Googling and looking at code for a couple of hours. I've seen a few javascript implementations but honestly I haven't the slightest idea how to port it over. The whole thing's above my head. I'd like to have this in PHP. Can anyone help?
|
|
|
I want to start up a small private pool for generating vanity addresses for just myself and a few friends to do the generating together. Does anyone know of a free vanity address pool that I can set up it up on my server?
Sorry if this is the wrong section.
|
|
|
Want to start up a small private vanity pool, but I don't have the knowledge necessary to write an efficient server for this. Do any open source ones exist already?
|
|
|
|