Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: RangerK on March 27, 2014, 11:08:35 AM



Title: Question about 'Height' certainty
Post by: RangerK on March 27, 2014, 11:08:35 AM
I assume that faking the blockchain 'height' is not a serious threat to the bitcoin protocol.  It isn't on the list of vulnerabilities: https://en.bitcoin.it/wiki/Common_Vulnerabilities_and_Exposures

I'm trying to better understand the process by which it is prevented.  Any references are appreciated.  Thanks!

edit:  I think what I may be asking for is the background workings of the API call 'getblockcount' -- https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list


Title: Re: Question about 'Height' certainty
Post by: kjj on March 27, 2014, 11:32:52 AM
Blocks come in discrete lumps.  You always know how many of them you have.


Title: Re: Question about 'Height' certainty
Post by: smolen on March 31, 2014, 03:13:03 AM
I assume that faking the blockchain 'height' is not a serious threat to the bitcoin protocol.  It isn't on the list of vulnerabilities: https://en.bitcoin.it/wiki/Common_Vulnerabilities_and_Exposures

I'm trying to better understand the process by which it is prevented.  Any references are appreciated.  Thanks!

edit:  I think what I may be asking for is the background workings of the API call 'getblockcount' -- https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list
Hashing process could be optimized by mining for blocks with only one constant coinbase transaction - so no other transactions will fit in the block. BIP 0034 prevents it.


Title: Re: Question about 'Height' certainty
Post by: kjj on March 31, 2014, 11:47:32 AM
Hashing process could be optimized by mining for blocks with only one constant coinbase transaction - so no other transactions will fit in the block. BIP 0034 prevents it.

No, BIP 34 prevents duplicate transactions because they were an ugly corner case.

It was heavily discussed, so searching these forums for it will provide enlightenment on the matter.  The short version is that allowing duplicate generate transactions was surprising, but realizing that they could be spent and then mined again was even more surprising.  In theory, whole strings of transactions with identical IDs could be made that way.


Title: Re: Question about 'Height' certainty
Post by: smolen on April 03, 2014, 02:24:30 AM
Hashing process could be optimized by mining for blocks with only one constant coinbase transaction - so no other transactions will fit in the block. BIP 0034 prevents it.

No, BIP 34 prevents duplicate transactions because they were an ugly corner case.

It was heavily discussed, so searching these forums for it will provide enlightenment on the matter.  The short version is that allowing duplicate generate transactions was surprising, but realizing that they could be spent and then mined again was even more surprising.  In theory, whole strings of transactions with identical IDs could be made that way.

That's a part of Bitcoin history I've missed :) Looks like easier mining of empty blocks with duplicate coinbase transactions was not considered as a possible attack, but developers sticked to their clever hack of using transaction hash as an key. Anyway, the mining advantage would be small, something like 2% and this vulnerability was fixed without being discovered :)