原始文献 / 论坛帖 / Re: How to overthrow the GPU Oligarchs
Re: How to overthrow the GPU Oligarchs
Bitcointalk · 2010-10-03 21:30:04 UTC
引用自 theymos(2010 年 10 月 2 日 06:11:11 AM)(https://bitcointalk.org/index.php?topic=1332.msg14966#msg14966):引用自 lzsaver(2010 年 10 月 2 日 05:49:47 AM)(https://bitcointalk.org/index.php?topic=1332.msg14960#msg14960):能多讲讲这个吗:
「他们不得不用 extraNonce 做些奇怪的事情,这会增大区块头的大小」。
当你挖矿时,你计算的是区块头的哈希。哈希更多的数据比哈希更少的数据要慢,所以对所有人来说,区块头的大小至关重要且固定,只有一个例外。这正是困惑所在。extraNonce 不是区块头的一部分,它是第一笔交易的一部分。它不会拖慢你的哈希速度,也不会改变区块头的大小。
我们要保持警惕,把“区块内容会拖慢哈希速度”这类误解扼杀在萌芽里。不会。
extraNonce 永远不需要很大。如果我们愿意,可以每当时间变化(每秒)就重置它。最坏的情况下,如果你不想费心维护它的递增,extraNonce 可以是 4 个随机字节,因碰撞而浪费时间的概率可以忽略不计。
不同的机器自动不会发生碰撞,因为它们在第一笔交易里的生成公钥不同。每个线程也一样。
英文原文
Quote from: theymos on October 02, 2010, 06:11:11 AM(https://bitcointalk.org/index.php?topic=1332.msg14966#msg14966)Quote from: lzsaver on October 02, 2010, 05:49:47 AM(https://bitcointalk.org/index.php?topic=1332.msg14960#msg14960)Can you tell more about it:
"they have to do weird things with extraNonce, which increases the size of the block header".
When you generate, you calculate hashes of the block header. Hashing more data is slower than hashing less data, so the block header is critically of a fixed size for everyone, with one exception.This is the point of confusion. extraNonce is not part of the block header, it is part of the first transaction. It does not slow down your hashing. It does not change the size of the header.
We need to be vigilant and nip in the bud any misconception that the contents of your block slows down your hash speed. It doesn't.
extraNonce never needs to be very big. We could reset it every second whenever the time changes if we wanted. Worst case, if you didn't want to keep track of incrementing it, extraNonce could be 4 random bytes and the chance of wasting time from collision would be negligible.
Separate machines are automatically collision proof because they have different generated public keys in the first transaction. That also goes for each thread too.
