本文介绍了区块链如何安全?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我读到了一篇有关区块链的文章,据此,区块链是非常安全的吗?我不明白它的安全性吗?区块链如何使数据安全,即使普通人也可以使用?

Yesterday I read about an article on Blockchain and according to it, blockchain are very secured? I am not able to understand how it is secure?How blockchain makes data secure even it is available to normal people?

推荐答案

@saurabh提供了很好的解释,这是一个复杂的主题,需要详细的解释,请阅读有关不同共识和工作量证明算法的更多信息,以实际了解区块链的美丽.互联网上有很多不错的博客供您浏览.让我尝试为您提供我的分布式账本知识有限的简短摘要.

@saurabh provided a very good explanation,Its a complex topic and require a detailed explanation, please read more about different consensus and proof of work algorithms to actually figure out the beauty of blockchains. There are tons of good blogs present on internet for you to explore. Let me try to provide you a brief summary with my limited knowledge of distributed ledgers.

从理论上讲,区块链实际上是防篡改的(有人仍然可以对区块链进行51%的攻击,但这需要巨大的计算能力)

Blockchain is actually theoretically tamperproof (Someone can still make a 51% attack on blockchain, but that would require huge computational power)

为什么会这样?两个原因:

Why is it so? Two reasons :

每个区块唯一的加密指纹

A cryptographic fingerprint unique to each block

共识协议,网络中的节点就共享历史达成共识的过程.

consensus protocol, the process by which the nodes in the network agree on a shared history.

指纹(称为哈希)最初需要花费大量的计算时间和精力(此时间和精力的增加或减少取决于矿工的总计算能力).因此,这可以证明将区块添加到区块链中的矿工完成了计算工作,从而获得了比特币奖励(因此,据说比特币使用了工作量证明"协议).此哈希只是此块中包含的所有交易的Merkle哈希.它也可以用作一种密封,因为更改该块将需要生成一个新的哈希.但是,验证散列是否匹配其块很容易,并且一旦节点这样做,节点便会使用新块更新其各自的区块链副本.这是共识协议.

The fingerprint, called a hash, takes a lot of computing time and energy to generate initially(This time and energy increases or decreases depending upon the total computing power present with the miners). It thus serves as a proof that the miner who added the block to the blockchain did the computational work to earn a bitcoin reward (for this reason, Bitcoin is said to use a "proof-of-work" protocol). This hash is just a merkle hash of all the transactions included in this block. It also serves as a kind of seal, since altering the block would require generating a new hash. Verifying whether or not the hash matches its block, however, is easy, and once the nodes have done so they update their respective copies of the blockchain with the new block. This is the consensus protocol.

最后一个安全因素是,散列还充当区块链中的链接:每个区块都包含前一个区块的唯一哈希.因此,如果您想追溯性地更改分类账中的条目,则不仅要为其所在的区块,还要为随后的每个区块计算一个新的哈希值.而且您必须比其他节点向链中添加新块的速度更快(平均每10分钟添加一个新块).因此,除非您拥有比其余节点组合的功能更强大的计算机(即使这样,也不能保证成功),所有更改都需要在10分钟的时间内完成,否则您添加的任何块都会与现有的块冲突,其他节点将自动拒绝您的更改.这就是使区块链不受篡改或不可变"的原因.

The final security element is that the hashes also serve as the links in the blockchain: each block includes the previous block’s unique hash. So if you want to change an entry in the ledger retroactively, you have to calculate a new hash not only for the block it’s in but also for every subsequent block. And you have to do this faster than the other nodes can add new blocks to the chain (On an average a new block is added every 10 minutes). So unless you have computers that are more powerful than the rest of the nodes combined (and even then, success isn’t guaranteed), all the alterations needs to be done in 10 minutes window, any blocks you add will conflict with existing ones, and the other nodes will automatically reject your alterations. This is what makes the blockchain tamperproof, or "immutable."

如果您使用工作证明来部署自己的区块链会发生什么?这实际上取决于您的区块链上已经存在多少块以及工作量证明算法的难度.如果复杂度较低,并且几乎没有矿工在争夺下一个区块,那么将所有矿工加在一起拥有更高计算能力的任何人都可以制定自己的有效分叉,并进行适合其需求的交易.

What would happen if you deploy your own blockchain with proof of work?It really depends how many blocks are already present on your blockchain and difficulty of your proof of work algorithm. If complexity is low and few miners are competing for the next block, anybody with more computational power with all the miners combined can make their own valid fork, with transactions suited to their needs.

我想在第n-10个区块处处理交易吗?

让我们说,截至目前,比特币区块链中的区块数量为n,而您想在第n-10个区块处更改交易,即回溯10个区块.

lets say the number of blocks in Bitcoin blockchain as of this instant is n, and you want to alter a transaction at n-10th block, thats is 10 blocks back in time.

矿工将竞争把下一个区块放在第n + 1个区块上,时间段大约为10分钟,您也可以竞争,但是要赢得胜利,与矿工相比,您必须具有计算能力,约为51200544泰铢/s.概率上讲,如果您具有1TH/s的挖掘能力,则解决一个区块的机会是1/51200544,比方说,计算1TH/s成本大约为1000美元的硬件,只需计算一下成本就可以了.

Miners will compete to put the next block n+1 th block, the time frame for which is approximately 10 minutes, you can also compete but for you to win you must have computational power as compared to miners which is around 51200544 TH/s.Probabilistically speaking if you have 1TH/s mining power, your chance of solving a block is 1/ 51200544, Lets say the hardware to calculate 1TH/s costs around 1000$, just calculate the cost to have an idea .

如前所述,每个区块的标头中都包含一个Merkle哈希值,而该哈希值又取决于区块中所包含的每个事务以及需要解决的困难(矿工计算). merkle根包含在下一个块的标题中.

As already mentioned, Every block has a merkle hash included in the header which is turn depends upon every transaction included in the block and a difficulty which needs to be solved (The stuff miners calculate). This merkle root is included in the header of next block.

因此,如果要在第n-10个区块更改一个或多个事务,则需要对第n-10个区块做两件事.1.随着交易发生变化,再次计算merkle根.2.解决困难.

so if you want to change a transaction or multiple transactions at n-10th block, You need to do two things for n-10th block.1. Calculate the merkle root again as transactions have changed.2. Solve the difficulty.

由于merkle根已更改,因此需要解决此块之后的每个块的困难,直到此时此刻,才能使其成为有效分支.

Since the merkle root has changed, you need to solve the difficulty of every block following this block till this very time instant, to make it a valid branch.

完成所有这些操作的时间只有10分钟,因为在接下来的10分钟内,矿工将在链中推下另一个障碍.

The time frame to do all this is just 10 minutes, because in next 10 minutes , another block will be pushed by miners in the chain.

这篇关于区块链如何安全?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 11:33