Author

Topic: hash160 -> base58. Quick Question @devs! (Read 3025 times)

legendary
Activity: 1428
Merit: 1093
Core Armory Developer
August 19, 2011, 12:45:11 PM
#6
For reference, see this diagram I created:

http://dl.dropbox.com/u/1139081/BitcoinImg/PubKeyToAddr.png

I have a few other diagrams posted here that you might find useful if you start looking at other calculations.
full member
Activity: 238
Merit: 100
August 19, 2011, 12:02:03 PM
#5
That's it perfect, thanks!
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
August 19, 2011, 11:57:21 AM
#4
I depends of what you want to do

If you only have the hash160 of your pubkey, I answered correctly
If you just want to convert an hex number to a base58 number, here's the process:

hex = "1d3f3a"
dec = 1*16^5 + 13*16^4 + 3*16^3 + 15*16^2 + 3*16^1 + 10*16^0
      = 1916730

The rest is just some divisions (start with the power "number of digit in the hex representation"):
dec / 58^6 = 0. ...
dec / 58^5 = 0. ...
dec / 58^4 = 0. ...
dec / 58^3 = 9.8237......
so the first character is 9, and you substract 9*58^3 to dec -> dec = 160722
dec / 58^2 = 47.777.....
so the next character is 47, and you substract 47*58^2 to dec -> dec = 2664
dec / 58^1 = 45.931.....
so the next character is 45, and you substract 45*58^1 to dec -> dec = 54
the final character is 54

Your base58 number is [9-47-45-54], ie 9mov



Your calculator may not really appreciate the value of a 64-digit hexadecimal number though
full member
Activity: 238
Merit: 100
August 19, 2011, 11:47:18 AM
#3
The address is just the base58 representation of the hexadecimal number above


Oh I think you misunderstood. Or I didn't express myself correctly.
The red part is what I'm interested in. That's why I mentioned pen+paper. I need the b58 routine.
But thanks anyways!
.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
August 19, 2011, 11:39:21 AM
#2
Add "00" before, and add the first 4 bytes of sha256(sha256("00" + hash160)) after your hash160     (the + is the concatenate operation, not sum)
So you have [ "0065f2a3921afacd998e6c98a5aaa94325ed07ee14" + first4bytesof(sha256(sha256("0065f2a3921afacd998e6c98a5aaa94325ed07ee14"))) ]
The address is just the base58 representation of the hexadecimal number above

Base58 characters: '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'



-pen,
-paper,
-calculator.
Quote
sha256(sha256("0465f2a3921afacd998e6c98a5aaa94325ed07ee14"))
Lol



If you really want to do it with a calculator only, there's a sha256 pseudocode here: http://en.wikipedia.org/wiki/SHA-2
full member
Activity: 238
Merit: 100
August 19, 2011, 11:04:22 AM
#1
Just a quick question:

How do I go from here:
65f2a3921afacd998e6c98a5aaa94325ed07ee14

to here:
1AJ3vE2NNYW2Jzv3fLwyjKF1LYbZ65Ez64
?

Things I have at my disposal to accomplish this task:

-pen,
-paper,
-calculator.

What do I need to do?
.
Jump to: