Author

Topic: How to convert Hex keys to WIF as a math problem? (Read 1117 times)

member
Activity: 70
Merit: 10
Thanks for all the links guys. Some very good reading. Bitcoin really is beautiful when you look behind the scenes.
sr. member
Activity: 412
Merit: 275
I have an implementation that illustrates the maths - it's mostly a generic base conversion trick. https://github.com/Bit-Wasp/bitcoin-php/blob/master/src/Base58.php look at the encode() and decode() functions.
legendary
Activity: 3416
Merit: 4658
- snip -
hex private key to WIF using a mathematical
- snip -

There are two mathematical algorithms you'll need.

First you'll need to calculate SHA256. This is generally binary "math" consisting of the logic functions (and, or, xor, not) and shifting or rotating positions.  You can find a description of the algorithm here:
https://en.wikipedia.org/wiki/SHA-2#Pseudocode

Then you'll need to convert from base 16 (hex) to base 58.

copper member
Activity: 1498
Merit: 1520
No I dont escrow anymore.
I have noticed that behind the scenes of bitcoin code there is a lot of math. Which made me wonder, Is there a way to convert a hex private key to WIF using a mathematical algorithm? If so, could someone please post the formula as i cannot find it anywhere if it exists. I am by far no math wiz or anything i just find math interesting sometimes, and this is one of them.

In math terms its pretty borring -> https://en.bitcoin.it/wiki/Wallet_import_format
member
Activity: 70
Merit: 10
I have noticed that behind the scenes of bitcoin code there is a lot of math. Which made me wonder, Is there a way to convert a hex private key to WIF using a mathematical algorithm? If so, could someone please post the formula as i cannot find it anywhere if it exists. I am by far no math wiz or anything i just find math interesting sometimes, and this is one of them.
Jump to: