在长度为 N 的 PoW(工作量证明)区块链中,修改第 (N-2) 个区块有多难?
In a PoW(Proof-of-Work) blockchain of length N, how difficult is to modify the (N-2)th block?
所以我浏览了一些关于如何实现 PoW Blockchain
的资源 (link),然后重新阅读:
If the data in block 44 is changed from “DESERT” to “STREET”, all
hashes of the consecutive blocks must be changed. This is because the
hash of the block depends on the value of the previousHash (among
other things).
This is an especially important property when proof-of-work is
introduced. The deeper the block is in the blockchain, the harder it
is to modify it, since it would require modifications to every
consecutive block.
那么,考虑一个长度为 7 的私有区块链,有人修改 第 5 个区块 会有多困难?
取决于您所说的 "difficult" 是什么意思。从技术上讲,一点也不难,您需要做的就是重新计算修改后的所有元素。这简单明了且成本低廉(如果您曾经使用过 git,这正是您使用 5 次提交进行变基时发生的情况)。
当然,这会给你五个新的哈希值,所以每个人都会立即注意到有人操纵了区块链。 "bad guys" 试图做的是操纵区块链 但保持哈希不变 。使用良好的散列算法,that 以一种为您提供相同散列 and 的方式进行是非常困难且计算成本高的,更改在某种程度上是有意义的(即对他们有利)。
更新:
如果你能为一个散列做到这一点,你就可以操纵整个链,因为后代只依赖于那个散列。因此,无论您想篡改哪个元素,都需要付出同样的努力。 (但这可能取决于实现)。
所以我浏览了一些关于如何实现 PoW Blockchain
的资源 (link),然后重新阅读:
If the data in block 44 is changed from “DESERT” to “STREET”, all hashes of the consecutive blocks must be changed. This is because the hash of the block depends on the value of the previousHash (among other things).
This is an especially important property when proof-of-work is introduced. The deeper the block is in the blockchain, the harder it is to modify it, since it would require modifications to every consecutive block.
那么,考虑一个长度为 7 的私有区块链,有人修改 第 5 个区块 会有多困难?
取决于您所说的 "difficult" 是什么意思。从技术上讲,一点也不难,您需要做的就是重新计算修改后的所有元素。这简单明了且成本低廉(如果您曾经使用过 git,这正是您使用 5 次提交进行变基时发生的情况)。
当然,这会给你五个新的哈希值,所以每个人都会立即注意到有人操纵了区块链。 "bad guys" 试图做的是操纵区块链 但保持哈希不变 。使用良好的散列算法,that 以一种为您提供相同散列 and 的方式进行是非常困难且计算成本高的,更改在某种程度上是有意义的(即对他们有利)。
更新: 如果你能为一个散列做到这一点,你就可以操纵整个链,因为后代只依赖于那个散列。因此,无论您想篡改哪个元素,都需要付出同样的努力。 (但这可能取决于实现)。