默克尔树

Ralph C. Merkle (not pictured above), born 1952, is one of the founding fathers of Public Key Cryptography. Throughout his career he has developed and contributed to a list of monumental cryptographic systems, some of which are embedded in the backbone of the online protocols and applications we rely on in daily life. In this post we will look at his work on Merkle Trees, how they function, and why and how they are growing in use.

拉尔夫·默克尔(Ralph C. Merkle)(上图中画)出生于1952年,是公钥密码学的创始人之一。 在他的整个职业生涯中,他已经开发并贡献了一系列重要的密码系统,其中一些嵌入了我们日常生活所依赖的在线协议和应用程序的主干中。 在这篇文章中,我们将研究他在Merkle Trees上的工作,它们的功能以及使用原因和增长方式。

Image for post

默克尔_What_ (Merkle _What_)

The overall structure of a Merkle Tree is quite simple and is very familiar to computer scientists: a tree data structure. Data trees have one root node (the main file or piece of data) which is then divided or branched out into child nodes — in this case exactly one or two. By branching out again, these children then become parent nodes to subsequent children and so on. The final child node of any branch is called a leaf node. In reverse, each leaf node in combination with its sibling node (should it have one) yields its parent node and so on, until the original root node is reconstructed.

Merkle树的整体结构非常简单,计算机科学家对此非常熟悉: 树数据结构 。 数据树具有一个根节点 (主文件或数据段),然后将其划分或分支为子节点 -在这种情况下,恰好是一个或两个。 通过再次分支,这些子项将成为后续子项的父节点 ,依此类推。 任何分支的最后一个子节点称为叶节点 。 相反,每个叶节点与其同级节点 (应该有一个)结合在一起,产生其父节点,依此类推,直到重建原始根节点为止。

Merkle Trees differ from traditional data trees in one simple way: they use cryptographic hashes of each piece of data rather than the data itself. From leaf nodes up to the root, the process works as such:

默克尔树与传统数据树的区别仅在于一种简单的方式:它们使用每个数据的加密哈希而不是数据本身。 从叶节点到根,该过程的工作方式如下:

  1. Each leaf node is hashed
    每个叶节点都经过哈希处理
  2. Moving up the tree towards the root, each leaf or child hash is XOR’d (cryptographically combined) with the hash of its sibling node

    将树向上移到根,每个叶子或子哈希与它的同级节点的哈希进行或(加密组合)

  3. Finally, the hash of the the top parent nodes are XOR’d into the root node which precisely equals the aggregate hash of the original piece of data

    最后,将顶级父节点的哈希值与根节点进行XOR运算,该根节点恰好等于原始数据的总哈希值

Image for post

默克尔_为什么_ (Merkle _Why_)

For many years Merkle Trees were little more than a cryptographic magic trick. But as is common with mathematical and computational breakthroughs, years later it began to play a critical roll in various protocols and software projects. Merkle Trees are mainly used for two reasons:

多年以来,默克尔树只不过是一种加密魔术。 但是,与数学和计算突破一样,几年之后,它开始在各种协议和软件项目中发挥关键作用。 使用默克尔树主要有两个原因:

  1. They allow a client or server to efficiently validate the contents of large files/data
    它们允许客户端或服务器有效地验证大文件/数据的内容
  2. They allow a client or server to validate any segment or sub-segment of the file/data without possessing any other segments
    它们允许客户端或服务器验证文件/数据的任何段或子段,而无需拥有任何其他段

To understand why Merkle Trees have these properties, it is important to know a little bit about Cryptographic Hash Functions. Hash functions are easy to compute in one direction but extraordinarily hard to compute in the opposite direction. For example, the industry standard SHA-256 can be hashed in milliseconds but would theoretically take about 3.85 × 10²⁹ years to reverse, according to computer scientist Luke Dash Jr.

要了解Merkle树为何具有这些属性,重要的一点是要了解一些密码散列函数。 哈希函数易于在一个方向上计算,但在相反方向上却很难计算。 例如,根据计算机科学家Luke Dash Jr的说法,行业标准SHA-256可以以毫秒为单位进行哈希处理,但是从理论上讲,反向转换大约需要3.85×10²⁹年。

In the case of Merkle Trees, the hash function is used to calculate the hash of each segment of data which becomes the leaf nodes, then XOR each leaf node with sibling leaf/child nodes into parent nodes and so on, all the way up to the root node or Merkle Root. If each segment of the data is in tact and unchanged, the Merkle Root is exactly equal to the aggregate hash of the entire file or piece of data. If even one bit of information is changed in any segment, the hash is completely different which propagates up the tree, resulting in an entirely different Merkle Root. This root can then be compared with the actual/desired root and thus any inconsistency is detected.

对于Merkle树,哈希函数用于计算成为叶节点的每个数据段的哈希,然后将每个叶节点与同级叶/子节点异或为父节点,依此类推,直到根节点或Merkle Root 。 如果数据的每个段均完整无缺,则默克根(Merkle Root)完全等于整个文件或数据片段的总哈希值。 如果在任何段中甚至改变了一点信息,散列就完全不同,并沿树传播,从而导致完全不同的Merkle根。 然后可以将此根与实际/所需的根进行比较,从而检测到任何不一致之处。

“These numbers have nothing to do with the technology of the devices, they are the maximums that thermodynamics will allow. They strongly imply that brute-force attacks against 256-bit keys will be infeasible until computers are built from something other than matter and occupy something other than space.”

这些数字与设备的技术无关,它们是热力学允许的最大值。 他们强烈暗示,对256位密钥进行强力攻击将是不可行的,除非计算机是用物质以外的东西建造的并且占用空间以外的东西。”

— Bruce Schneier, Cryptographer

—密码学家Bruce Schneier

Image for post

默克尔_How_ (Merkle _How_)

One important use of Merkle Trees is in downloading files. If a user/client attempts to download a large file all at once and something goes wrong, the entire file can be corrupted and the full download process would need to be restarted. Using Merkle Trees, the user can download a smaller segment of the data and hash it. By combining this hash with the hashes of each other segment (trivially small to download/check compared to the data itself), they can check to see if any data was corrupted during the download process. These steps continue for each segment such that if the Merkle Root doesn’t match up at any step during the download process, they know which segment of the data was corrupted. It is important to note that this process takes place automatically in the background and does not require any action from the actual user.

Merkle树的一项重要用途是下载文件。 如果用户/客户端尝试一次全部下载一个大文件而出现问题,则整个文件可能会损坏,并且需要重新启动完整的下载过程。 使用Merkle树,用户可以下载较小部分的数据并对其进行哈希处理。 通过将此哈希与其他每个段的哈希值组合在一起(与数据本身相比,下载/检查的哈希值很小),他们可以检查以查看在下载过程中是否有数据损坏。 这些步骤针对每个段继续进行,这样,如果Merkle根在下载过程中的任何步骤都不匹配,则它们知道数据的哪个段已损坏。 重要的是要注意,此过程在后台自动进行,不需要实际用户采取任何措施。

Another place we see Merkle Trees being used is in the Distributed Version Control System Git. Git maintains and reconciles many different versions of a piece of software as it is built, changed and updated simultaneously by many contributors. Git is both fast and secure because instead of storing and comparing every instance of the actual software, it instead stores and compares the hashes of each segment and version in the form of a Merkle Tree. Git’s implementation is slightly more complicated as it XOR’s some additional nonces along the way, but the overall structure is that of a Merkle Tree.

我们看到使用Merkle树的另一个地方是分布式版本控制系统Git中 。 当许多贡献者同时构建,更改和更新软件时,Git维护并协调该软件的许多不同版本。 Git既快速又安全,因为它没有存储和比较实际软件的每个实例,而是以Merkle树的形式存储和比较每个段和版本的哈希。 Git的实现稍微复杂一些,因为它在此过程中对XOR进行了一些附加的随机数运算,但是总体结构是Merkle Tree的结构。

Finally, Merkle Trees play a key roll in the construction of the Bitcoin blockchain. When a Bitcoin node broadcasts a transaction to the rest of the peer-to-peer network and is included in a block by a mining node, the miner hashes that Transaction ID along with every other Transaction ID in that block. Those hashes are then put into pairs and XOR’d into a new hash and so forth in the form of a tree, all the way up to the Merkle Root. The root is then XOR’d once more with some additional data pertaining to the block itself and the hash of the preceding block (forming the chain), which finally results in a new block hash. While it is impossible to infer the details any particular transaction from it, the details of all transactions in the block are needed to compute the final block hash.

最后,默克尔树(Merkle Trees)在比特币区块链的构建中发挥了关键作用。 当比特币节点将交易广播到对等网络的其余部分并被挖掘节点包含在一个区块中时,矿工会将该交易ID以及该区块中的所有其他交易ID进行哈希处理。 然后将这些哈希成对放置,并以树的形式异或为一个新的哈希,以此类推,直到Merkle Root。 然后,将根与该块本身以及前一个块的哈希(形成链)有关的一些其他数据再次进行异或运算,最终导致新的块哈希。 虽然不可能从中推断出任何特定交易的细节,但是需要块中所有交易的细节来计算最终的块哈希。

Image for post

默克尔(Merkle) (Merkle _Root_)

In conclusion, Merkle Trees are a very clever way to maintain and verify databases and large files across networks of users/devices. When checked against the original Merkle Root, every piece of data must remain completely unchanged, else the roots will not align. As we live in a continuously more digital age and distributed systems gain popularity, it is likely we will start to see more Merkle Trees sprouting up in new and exciting places.

总之,Merkle树是在用户/设备网络之间维护和验证数据库和大文件的非常聪明的方法。 当对照原始的Merkle根进行检查时,每条数据都必须完全保持不变,否则根将无法对齐。 随着我们生活在一个数字化时代,分布式系统越来越受欢迎,我们很可能会开始在新的令人兴奋的地方看到更多的Merkle树。

翻译自: https://medium.com/@EricB10/merkle-trees-growing-in-usage-a7cc1ed7b2ac

默克尔树

http://www.taodudu.cc/news/show-3169487.html

相关文章:

  • 稀疏默克尔树(Sparse Merkle Tree)
  • java merkle树,11个默克尔树开源项目
  • 默克尔树在区块链中的应用
  • 默克尔树 Merkle Tree
  • 以太坊解析:默克尔树、世界状态、交易及其他
  • web3默克尔树MerleTree白名单校验
  • 区块链--默克尔树(Merkle Tree)
  • GO语言和区块链开发准备阶段-默克尔树
  • 密码学系列 - 默克尔路径
  • 6.tendermint默克尔树
  • 默克尔树
  • 基于Python实现的默克尔树
  • 默克尔树课设
  • 默克尔树(Merkle Tree)总结
  • 【区块链 | 默克尔树】使用默克尔(Merkle)树实现NFT白名单
  • HP电脑恢复系统(一键还原)
  • 小米电脑恢复系统
  • 惠普服务器删除系统还原,惠普电脑系统还原的详细操作步骤
  • 重启计算机怎么一键还原系统还原,怎么还原电脑系统,教您电脑怎么一键还原系统...
  • 台式电脑系统还原具体操作方法
  • 计算机系统的还原及备份,怎么给电脑系统备份以及还原
  • 戴尔win10计算机在哪里看,戴尔win10电脑恢复系统该如何设置?
  • 还原系统无法重启计算机的快捷键,电脑怎么从bios还原系统
  • 如何使用电脑还原点还原系统
  • 计算机重启恢复系统怎么操作,电脑问题不求人!教你如何使用恢复还原系统绝技...
  • 还原计算机系统,图文详解怎么一键还原电脑系统
  • 计算机系统恢复原始状态,电脑系统还原到最初状态步骤方法
  • 戴尔电脑恢复系统后,D盘被加密Bitlocker,要求输入48位密钥,才能打开D盘---解决过程
  • 计算机为什么无法使用高级恢复,电脑怎么还原系统,win7电脑还原系统高级恢复方法-...
  • 恢复系统设置或计算机无法点击进入,怎么还原电脑系统设置(电脑还原系统设置操作步骤)...

默克尔树_默克尔树:正在使用中相关推荐

  1. 耐克人脸识别_耐克的新鞋七八成没人买,他们为什么还要设计?

    演讲:萧兆琳,埃森哲战略大中华区董事总经理 | 编辑:吴蓓宏 "数字化转型要扎扎实实来做,不仅仅是搞一个人脸识别.开个线上店而已." 抬头看天,埋头做事.每个人.每个企业都是时代洪 ...

  2. 创建父需求子需求构建需求树_还不知道B+树 ?看完,别再问我什么是B+树 了

    前言 每当我们执行某个 SQL 发现很慢时,都会下意识地反应是否加了索引,那么大家是否有想过加了索引为啥会使数据查找更快呢,索引的底层一般又是用什么结构存储的呢,相信大家看了标题已经有答案了,没错!B ...

  3. python梯度提升回归树_梯度提升回归树(GBDT)

    梯度提升回归树(GBDT) 发布时间:2018-08-30 13:22, 浏览次数:1024 , 标签: GBDT 一.从Boosting思想开始 1.梯度提升回归树是一种从它的错误中进行学习的技术. ...

  4. 黑苹果英特尔网卡_英特尔如何失明和失去苹果业务

    黑苹果英特尔网卡 重点 (Top highlight) After 14 years of collaboration, Apple announced last month that it will ...

  5. 语言 泰克示波器程序_泰克Tektronix 任意波函数发生器AFG2000系列AFG2021

    一.概述 通常,生成多种信号需要投资购买高端的信号发生器.AFG2021 任意波形/函数发生器具有 20 MHz 的带宽,14 位分辨率和 250 MS/s 采样率,可创建简单和复杂波形. 最令人印象 ...

  6. 维瓦尔第_维瓦尔第:歌剧的精神继任者

    维瓦尔第 Ladies and gentlemen, we have a new browser. Yes another one. Vivaldi has been released as a te ...

  7. 默纳克调试说明书_默纳克_NICE3000调试说明书(修改版).doc

    . . NICE 3000 调 试 说 明 书 V 1.00 目 录 调试工具使用说明---------------------4 1.1调试工具--------------------------- ...

  8. 默纳克调试说明书_默纳克NICE3000调试使用说明(修改版)

    NICE 3000 调试说明书 V 1.00 目录 1. 调试工具使用说明 ⋯⋯⋯⋯⋯⋯⋯ ⋯⋯⋯ ⋯⋯⋯⋯⋯⋯ ⋯⋯⋯ ⋯⋯ 4 1.1 调试工具 ⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯ ...

  9. 默纳克调试说明书_默纳克NICE调试说明书修改版

    NICE  3000 调 试 说 明 书 V 1.00 目 录 1. 调 试 工 具 使 用 说 明 - - - - - - - - - - - - - - - - - - - - - 4 1.1 调 ...

最新文章

  1. C#面向集合的扩展(讨论)
  2. 多线程:线程安全?如何实现?
  3. 一个5位数,判断它是不是回文数。即12321是回文数,个位与万位相同,十位与千位相同。...
  4. 【攻防世界006】secret-galaxy-300
  5. 蓝桥杯-合并石子(java)
  6. centos6.5下使用yum完美搭建LNMP环境(php5.6)
  7. Serverless 实战 —— Funcraft + OSS + ROS 进行 CI/CD
  8. [Leedcode][JAVA][第209题][长度最小的子数组][滑动窗口][前缀和][二分查找][双指针]
  9. MaxCompute Tunnel上传典型问题场景
  10. 如何解决linux标准输出中带颜色的字符
  11. 【LA3487】最小割-经典模型 两种方法
  12. 【《zw版·Halcon与delphi系列原创教程》 zw_halcon人脸识别
  13. ApiPost自动化测试基础之:接口参数依赖的情景处理...
  14. 数据库实战:SQL Server系列网络课程资料集
  15. 【数字信号】基于matlab GUI DTMF双音多频电话拨号仿真【含Matlab源码 805期】
  16. 自研DCI网络路由交换协议DCIP-白牌交换机时代的企业网络
  17. apache 二级域名设置完整步骤
  18. 共阴极数码管,学号显示实验
  19. php网页ico更改,favicon.ico图片该如何修改
  20. 实验:跨域VPN-OptionC方式-方案一

热门文章

  1. 你到底能用Python做什么?下面是Python的三个主要应用程序。
  2. HTML5定稿了,终于有一种编程语言开发的程序可以在Android和IOS两种设备上运行了
  3. Java(网络编程)
  4. python加密方式-AES加密ECB模式
  5. 2021年黄石三中高考成绩查询,2021年黄石中考各学校录取分数线,历年黄石中考分数线汇总...
  6. Vue+springboot集成PageOffice实现在线编辑Word、excel文档
  7. [附源码]SSM计算机毕业设计高铁售票管理系统JAVA
  8. 基于python的报修系统_基于JSP的学生公寓报修管理系统.doc
  9. 提高微信小程序搜索排名的一些技巧
  10. linux 安装apache发布网站