Bitcoin Forum
October 29, 2020, 02:50:21 AM *
News: Latest Bitcoin Core release: 0.20.0 [Torrent]
   Home   Help Search Login Register More  
Pages: [1]
Author Topic: Possible use for the double hash in blocks  (Read 938 times)
Hero Member
Offline Offline

Activity: 549
Merit: 548

View Profile WWW
May 31, 2012, 05:53:03 PM
Last edit: June 01, 2012, 03:26:06 PM by Sergio_Demian_Lerner

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.
Hero Member
Offline Offline

Posts: 1603939821

View Profile Personal Message (Offline)

Reply with quote  #2

Report to moderator
Full Member
Offline Offline

Activity: 126
Merit: 100

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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!