Bitcoin Forum
November 24, 2017, 08:33:07 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
   Home   Help Search Donate Login Register  
Pages: [1]
Author Topic: Possible use for the double hash in blocks  (Read 902 times)
Hero Member
Offline Offline

Activity: 539

View Profile WWW
May 31, 2012, 05:53:03 PM

It has been said that double hashing in the PoW of the blocks serves to prevent hash extension attacks. This has been refuted: that attack does not make any harm because the hash preimage is public.

Today I realize that there is another reason why double hashing can be useful.

Double hashing can be used to prove that one have a block with certain PoW, before sending the whole header to a peer.

Suppose that H=Hash(W) and W=Hash(Block-header).

We want that blocks travel as fast as they can through the network to reduce the chances of the creation of parallel chains.
The Bitcoin block header size is generally 81 bytes, so each peer must receive at least 81 bytes in order decide if the block will be accepted, and forward it.
But if a node firsts sends only W, then the peer can compute H'=Hash(W) and conclude immediately that a lot of work has been put in order to build W. So the peer can immediately stop what is doing (downloading/uploading transactions) and set maximum priority to receive the block whose header hashes to W and resend it to its peers.

I know that it's not much that is gained (32 bytes instead of 81), but at least that is an use for the double hash.
Best regards,
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Full Member
Offline Offline

Activity: 126

View Profile
June 02, 2012, 10:22:07 PM

I would say it's latency, and not the size of the block header, that matters. - 1Dinox3mFw8yykpAZXFGEKeH4VX1Mzbcxe
Active trader on #bitcoin-otc - See here - Proof that my nick is dinox here
Pages: [1]
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!