BUIP061: Demonstration of Phase in Full Network Upgrade Activated by Miners
Proposer: LIN Zheming
Submitted on: 2017-06-13
Status: draft
本方法并不是来源于个人,而是中文比特币社区中集体智慧的结果。
This idea was not created by an individual but is a product of
collaboration in the Chinese bitcoin community between different
interest groups.
这是一种在协议升级时,对全网挖矿和非挖矿节点进行保护和激励的方法,避免不参与挖矿的节点没有升级的动力而受到损失。
This method is put forth to incentivize and to protect mining nodes and
non-mining nodes during protocol upgrading. With this incentive
mechanism, the non-mining nodes will not suffer monetary loss from chain
splitting.
发信号的多数矿工在达到激活条件后第一个宽限期(一个难度周期)后设置新区块版本号,孤立未升级矿工的低版本号的块。通过最初的中本聪共识,在第一个宽限期结束后,所有矿工将升级至最新版本或使用最新版本。在第二个宽限期(一个难度周期)后,矿工将仅接受新版本的交易,未升级的客户端发送的旧版本交易将无法得到新节点的转播也无法进入新版本区块。这将在保护用户资产的同时,提醒不挖矿的钱包节点升级。并在升级代码中加入对协议进行改动的部分。钱包升级后将由挖矿节点投票实施该项改动,以达成协议改动的广泛部署。
After the activation condition is met, majority miners will set a new
block versionbits after the first grace period(a difficulty change of
2016 blocks). The blocks with lower versionbits will be orphaned. In
terms of the Nakamoto Consensus, the end of the first grace period will
force all mining nodes upgraded to signal a new version of consensus.
After the second grace period ( a difficulty change of 2016 blocks),
mining nodes will only accept transactions with new versionbits.
Transactions from nodes not upgrading will not be relayed nor included
in blocks with new versionbits. This will protect funds of non-mining
nodes from utilizing replay attack and will function as a notification
for them to upgrade. Codes dealing with protocol upgrade could be
included in the upgrade. After the non-mining node upgrades, mining
nodes will vote to activate the protocol upgrade and this will achieve
the broad/widespread deployment of the protocol upgrade.
在该项改动广泛部署至客户端之后,依然由其激活条件控制。
The protocol upgrade depends on its activate condition independently
even after the change deployed among nodes.
鉴于最初的比特币协议并未考虑不参与挖矿的钱包节点,导致这些钱包节点的协议升级是被动的,懒惰的。当在升级方向上出现分歧时,矿工也不愿意在错误的链上挖矿,但矿工又没有任何方法可以确保正在延长的链是被钱包节点广泛接受的链。这将影响钱包节点的安全。
In view of the fact that the original Bitcoin consensus did not consider
the non-mining wallet nodes(as mentioned above), the result is that
upgrading the consensus of these wallet nodes is passive and lazy. When
there is disagreement in the direction of the upgrade, the miners have
no mechanism to ensure that the chain being extended is the chain widely
accepted by the wallet nodes. This also adversely affects the security
of the wallet nodes.
使用该方法可以在保证钱包节点资产安全的情况下,且通过增加激励让钱包节点升级协议。一旦钱包节点升级协议,保证矿工节点不仅工作在算力最长链上,还工作在比特币生态环境中其他钱包节点所使用的最长链上。在中本聪共识下不会出现分叉,以实现渐进式的协议升级。
Apart from ensuring the asset security of wallet nodes, this method can
be used to provide additional incentives to upgrade the protocol for the
wallet nodes. Once the wallet nodes upgrade their protocol, the miners’
nodes can be guaranteed to work - not only on the longest chain, but
also on the longest chain used by other wallet nodes in the broader
bitcoin sphere. Under the Nakamoto Consensus, there will be no
persistent forks as protocol upgrades can be phased in.
1. 挖矿节点将使用 versionbits 版本位来定义支持信号。BUIP
生效时,所有区块需要使用制定的 nVersion 来发送信号
2. 挖矿节点将使用 tx version 来定义当前的交易版本。当前的 tx version 是
1,将允许 tx version 为 2 的交易,并在第二个宽限期之后,使 tx version 为
1 的交易非法。
3. 在可选的第四阶段时,可以重新允许 tx version 是 1 的交易。
协议升级,将分成三步逐步实施。并有一个可选的第四步来集成协议升级代码。
Protocol upgrading will phase in over three stages. We can have an
optional fourth stage to integrate codes of protocol upgrade.
(可选的)协议升级。在第三阶段中包含有第四阶段的升级代码。当我们确保钱包节点升级到支持新版本交易后,必然包含了第四阶段的升级代码。则此时可以通过矿工节点投票的方式完成全网络的协议升级。
1. Signal stage: Mining nodes signal using BIP9. The next stage will be
activated after 55% (1109) of 2016 blocks has the signal.
2. Mining nodes upgrade stage: After a first grace period of 2016 blocks
and total signalling blocks passed 2218 of 4032 blocks, miners
broadcasting blocks with new versionbits in block headers will orphan
blocks with old versionbits. At this stage all nodes can send
transactions with new versionbits, and transactions with old versionbits
will be compatible.
3. Non-mining nodes upgrade stage: after 4032 continuous blocks with new
versionbits, mining nodes will start to refuse transactions with old
versionbits. Only transactions with new versionbits can be relayed and
included in blocks. Transactions with old versionbits can be safely
purged from memory pools.
4. (Optional)Protocol Upgrade stage: The codes dealing with protocol
upgrade can be integrated in the third stage. After the non-mining nodes
upgrades to support newer version of transactions, the codes with
protocol upgrade must be included and now we can use miner vote to
activate and finish this upgrade.
至此,协议升级完成。
At this point, the protocol upgrade have phased in.
1. 仅需要多数的矿工发信号后即可激活。在中本聪的比特币论文中,99.9%
的可能性下,55% 的矿工将在 340
个区块后确保成为最长链。这将最大可能减小通过控制少数算力而拖延网络升级的可能性。我们可以预见到在算力信号超过
51% 后,挖矿节点将迅速的在第一个宽限期内进行升级。
2. 在两个宽限期内,钱包节点交易不受影响,有足够的时间升级钱包软件。
3. 版本信息包含在 block header 中,并不影响 SPV
挖矿过程。(看起来是?)
4.
在两个宽限期后,钱包节点将必须升级钱包,否则因没有算力支持将无法发送交易,也无法确认。相对于在节点间重新达成新的共识,这种状况并没有更糟糕。
5.
钱包节点的账本将得到尊重和保护。使用链下钱包的用户将需要在钱包服务提供商的声明之后决定提至链上钱包或跟随。
6.
将来的协议升级,可以在升级客户端版本同时绑定协议升级代码并进行独立的激活投票。这将预留足够的时间让节点升级软件以支持新的协议。即使矿工投票激活失败也不影响现状。
1.
算力的波动会影响最长链的结果。因此越高的激活比例要求将减少短时间分叉的危险。
2.
矿工可能发假信号来避免被孤立,但在钱包节点看来无法区分是否是假信号,只能升级。而钱包节点升级之后,矿工也将跟随。
3.
钱包节点可能发假信号来仅升级版本号而不支持绑定的协议升级代码,但钱包节点数量无法判别,严肃的真实节点应当跟随可证实的矿工投票结果。
4.
存在少部分矿工和钱包节点共谋,在新协议升级激活后依然使用老协议挖矿的可能。这种可能随时发生无法杜绝,但通过让沉默的大多数钱包节点升级的方式可以降低这种行为带来的利益。
___TBD___