Bitcoin Forum
December 10, 2016, 09:02:47 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: What is the difference between char[32] hashes and char[64] hashes?  (Read 790 times)
bitcoinandroid
Jr. Member
*
Offline Offline

Activity: 37


View Profile
September 12, 2011, 05:42:22 AM
 #1

This is probably a simple question but I haven't seen an answer anywhere.

The protocol describes a number of char[32] hashes:
https://en.bitcoin.it/wiki/Protocol_specification#getblocks

But it looks like all the hashes are 64 characters long:

http://blockexplorer.com/rawblock/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

Why is this?

Base58 encoding it seems to make it 40 characters long.  Is it truncating the hash and only using the first 32 characters of it?
1481360567
Hero Member
*
Offline Offline

Posts: 1481360567

View Profile Personal Message (Offline)

Ignore
1481360567
Reply with quote  #2

1481360567
Report to moderator
1481360567
Hero Member
*
Offline Offline

Posts: 1481360567

View Profile Personal Message (Offline)

Ignore
1481360567
Reply with quote  #2

1481360567
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481360567
Hero Member
*
Offline Offline

Posts: 1481360567

View Profile Personal Message (Offline)

Ignore
1481360567
Reply with quote  #2

1481360567
Report to moderator
1481360567
Hero Member
*
Offline Offline

Posts: 1481360567

View Profile Personal Message (Offline)

Ignore
1481360567
Reply with quote  #2

1481360567
Report to moderator
casascius
Mike Caldwell
VIP
Legendary
*
Offline Offline

Activity: 1344


The Casascius 1oz 10BTC Silver Round (w/ Gold B)


View Profile WWW
September 12, 2011, 05:46:35 AM
 #2

I think you have the difference between a character and a byte confused.

They are 64 hexadecimal characters long.  That means 32 bytes.  Each byte takes two symbols (0-9, A-F) to represent in hexadecimal, because there's 8 bits in a byte, and each hex symbol only represents 4 bits.

Companies claiming they got hacked and lost your coins sounds like fraud so perfect it could be called fashionable.  I never believe them.  If I ever experience the misfortune of a real intrusion, I declare I have been honest about the way I have managed the keys in Casascius Coins.  I maintain no ability to recover or reproduce the keys, not even under limitless duress or total intrusion.  Remember that trusting strangers with your coins without any recourse is, as a matter of principle, not a best practice.  Don't keep coins online. Use paper wallets instead.
RSmith
Newbie
*
Offline Offline

Activity: 8


View Profile
September 12, 2011, 05:56:43 AM
 #3

A hexadecimal character represents 4 bits; a 'char' (aka a byte) represents 8 bits.  So 64 hex characters stands for 256 bits, as does 32 bytes.  So the difference is notation, nothing else.


bitcoinandroid
Jr. Member
*
Offline Offline

Activity: 37


View Profile
September 12, 2011, 06:13:04 AM
 #4

Ahh, makes sense - I should have caught that.  Sorry for the newbie question and thanks for the help!  Smiley
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!