Bitcoin Forum
May 27, 2024, 12:18:52 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Possible use for the double hash in blocks  (Read 973 times)
Sergio_Demian_Lerner (OP)
Hero Member
*****
expert
Offline Offline

Activity: 554
Merit: 632


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

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,
S
dinox
Full Member
***
Offline Offline

Activity: 126
Merit: 100


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

I would say it's latency, and not the size of the block header, that matters.

blockchain.info/fb/1dinox - 1Dinox3mFw8yykpAZXFGEKeH4VX1Mzbcxe
Active trader on #bitcoin-otc - See here - Proof that my nick is dinox here
Pages: [1]
  Print  
 
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!