报告分享 | 区块链技术介绍和学术研究

资讯 2024-07-13 阅读:63 评论:0
这篇报告主要以本人视角回顾从 2016 年接触区块链至今的...
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

这篇报告主要以本人视角回顾从 2016 年接触区块链至今的科研经历,介绍区块链技术原理和梳理区块链学术研究,为所在项目团队做相关知识补充,也为感兴趣的研究者提供少许思路。

The report reviews from my own perspective the scientific experience from the 2016 contact block chain to the present xff0c; presents the technical principles of the block chain and the academic study of collating blocks xff0c; complements the relevant knowledge of the project team xff0c; and provides a few ideas for interested researchers.

根据 Wikipedia 的定义:“A blockchain is a distributed ledger with growing lists of records (blocks) that are securely linked together via cryptographic hashes.”

& #xff1a; : “A crackchain is a defined driver with growing Lists of records that are safely linked to both via cryptographic hashes.

区块链是一种分布式账本,其中包含不断增长的记录,用区块来进行表示。这些区块通过密码学哈希安全地链接在一起,每个区块都包含前一个区块的哈希值,因此有效地形成一条链。

The block chain is a distributed account book & #xff0c; it contains a growing record & #xff0c; it is represented by blocks. These blocks are safely linked to xff0c via cryptography; each block contains the Hashi value of the previous block xff0c; thus an effective chain is formed.

图片来源:https://www.exchen.net/bitcoin-blockchain.html

 photo sourcexff1a; https://www.exchen.net/bitcoin-blockchain.html

图片来源:https://www.exchen.net/bitcoin-blockchain.html
  • 输出来看,区块链类似于数据结构中的链表。稍有不同的是,区块链中的指针不是内存地址,而是数据的哈希值。由于哈希函数单向不可逆,区块只能追加,无法插入。

    From output xff0c; block chains are similar to those in the data structure. A slight difference is xff0c; the pointer in the block chain is not the memory address xff0c; it is the Hashi value of the data. Because the Hashi function is one-way irreversible xff0c; blocks can only add xff0c; cannot be inserted.

  • 构造来看,区块链并非仅由单个程序产生。它涉及多个有相同行为且独立运行的程序,一般被称作节点。节点之间通过网络连接,以对等的角色相互通信。节点同步本地视图里的数据,各自执行预先定义的协议,最终生成全局唯一的区块链。

    From construction xff0c; block chains are not generated by a single program. It involves multiple programs that behave in the same way and operate independently xff0c; generally referred to as nodes. Nodes communicate with each other through network connections xff0c; with reciprocal roles. Node synchronizes the data in the local view xff0c; each executes the predefined protocol xff0c; eventually generates the only block chain in the global context.

图片来源:https://www.nahan.org/3700.html

 Photo sourcexff1a; https://www.nahan.org/3700.html

图片来源:https://www.nahan.org/3700.html

这也是为什么早期在解释区块链概念的时候,经常将其类比为分布式数据库系统:用户发送的事务请求,通过执行共识算法,存储在多个节点中,以保持一致性。

This is why early on when interpreting the block chain concept xff0c; often comparing it to distributed database systems xff1a; requests for services sent by users xff0c; implementation of consensus algorithms xff0c; storage in multiple nodes xff0c; for consistency.

不同的是,数据库提供 CRUD 操作(即创建、读取、更新和删除),关注结果;对比而言,区块链仅支持 CR 操作(即创建和读取),记录过程。尽管两者在行为上十分接近,但是区块链这个概念更能区分不同。

The difference is xff0c; databases provide CRUD operations xff08; i.e. create, read, update and delete xff09; xff0c; concern results xff1b; xff0c; by contrast, block chains only support CR operations xff08; i.e. create and read xff09; xff0c; record process. Although the two are very close to xff0c; the concept of block chains is more different.

由此看来,区块链并没有创造什么新的技术,而是将现有的各种技术组合在一起,设计了一个有特殊属性的系统框架。基本地,以密码学作为安全支撑,以分布式作为架构模板,以链结构作为组织形式,更多的技术可以整合进来以设计新的系统。

So xff0c; block chains do not create any new technology xff0c; instead, they combine existing technologies xff0c; design a system framework with special attributes. Basic xff0c; use cryptography as security support xff0c; use distribution as an architecture template xff0c; use chain structure as an organization #xff0c; more technologies can be integrated to design new systems.

这样的基本设计带来了三个关键的特性:

This basic design brings with it three key characteristics xff1a;

  • 公开(public):区块数据是公开可访问的,透明的概念也源于此,因其共识算法需要对区块数据达成一致,节点也是开放加入的。
  • 去中心(decentralized):不依赖第三方或者某个中心节点进行管理,缺失部分节点系统仍然可正常运行。
  • 不可篡改(immutable):一旦写入到区块链上的信息,无法进行修改和删除。

至于匿名性、去信任、自治性等概念,都可以与上述特性关联或者延申。随着技术的发展,根据业务的需求,研究者对区块链进行了部分改造,在其特性上做出了多种尝试,丰富了区块链的技术内容。

As for the concepts of anonymity, de-trust, autonomy, etc. xff0c; all of which can be associated with or delayed. As technology develops xff0c; xff0c, depending on business needs xff0c; the researchers have partially modified the block chain xff0c; various attempts have been made on its properties xff0c; and the technical content of the block chain has been enriched.

公开特性上,约束对节点的开放范围,区块链被划分为三类。

xff0c on the public feature; the open range of constraints on nodes xff0c; and the block chain is divided into three categories.

  • 公有链(public blockchain):任何用户无需授权即可加入成为节点,参与维护区块链,执行共识算法。
  • 联盟链(consortium blockchain):被授权的用户才能成为共识节点,甚至不同角色给定的访问权限也有所不同。
  • 私有链(private blockchain):节点完全由某个机构掌握,与中心化数据库类似,一般做内部使用。

由于私有链对于区块链技术而言并没有太多的意义,现在也经常将区块链分为许可链(permission blockchain)和非许可链(permissionless blockchain),分别对应上述的联盟链和公有链。

Because private chains are not of much significance to block chain technology & #xff0c; they are also now often divided into licensing chains & #xff08; permission blockchain) non-licensed chains & #xff08; permissionles blockchain) #xff0c; corresponding to the above-mentioned union and public chains respectively.

去中心特性上,节点的身份由某个可信中心机构认证(例如公钥基础设施PKI),或设计多个中心以加强系统的权威性和可控性。

xff0c on the characteristics of ; identity of node is certified by a credible central institution xff08; e.g. PKI) xff0c; or multiple centres are designed to enhance the authority and control of the system.

不可篡改特性上,曾有应用变色龙哈希(Chameleon Hash),或者调整区块结构的部分字段,设计可编辑区块链(Redactable Blockchain)的方案。

xff0c on which cannot be tampered with ; which has been applied to the transvestite Harbour & #xff08; Chameleon Hash& #xff09; xff0c; or some field to adjust block structure & #xff0c; which is designed to edit block chains xff08; Redactable Blockchai)

区块链技术起源于2008年11月,一个化名为中本聪的人,在网络上发表了一篇论文(非会议、非期刊、也不是预印本),题目为《Bitcoin: A peer-to-peer electronic cash system》,即比特币系统的原型。

The technical origins of the block chain originated in November 2008 & #xff0c; a person with a name & #xff0c; a paper published on the web & #xff08; non-conferences, non-periodics, and non-preprints & #xff09; & #xff0c; entitled Bitcoin: A Peer-to-peer electronic cash system & #xff0c; or the prototype of the Bitcon system.

2009年1月,比特币网络正式开始运行,一直到现在。自此之后,关于区块链项目和研究呈爆发式增长。截止2024年1月底,在Github上以为主题的开源项目多达2.7万多个,在谷歌学术上搜索关键字可找到60多万篇相关学术论文。

xff0c; Bitcoin network officially started operating xff0c; up to now. Since then xff0c; there has been an outbreak of growth in block chain projects and research. xff0c by the end of January 2024; more than 27,000 xff0c of open-source projects thought to be the subject on Github; and more than 600,000 related academic papers can be found in Google for key words.

Github仓库

Github Repository

Github仓库

谷歌学术搜索

Google Academic Search

谷歌学术搜索

区块链作为一项底层技术,有效解决的是信任问题。可以应用的领域非常广,包括金融、物流、医疗、物联网、供应链、数字版权、数据共享、存证防伪等等。

Block chains are a bottom-up technology & #xff0c; trust issues are effectively addressed. Areas that can be used are very wide & #xff0c; including finance, logistics, medical, material networking, supply chains, digital copyright, data sharing, security against forgery, etc.

然而,区块链技术的实际落地相当困难,目前在金融和政务上的落地占大头。尤其在金融领域,稳定币的出现,将虚拟货币与传统货币挂钩。我国更是推出了自己的数字货币,同样也使用了区块链技术。

However, xff0c; the physical location of block chain technology is quite difficult xff0c; the financial and political fields are now dominated. Especially in the area of finance xff0c; the emergence of stable currencies xff0c; the linking of virtual currencies to traditional currencies. We have introduced our own digital currency xff0c; and we have also used block chain technology.

关于区块链技术落地的难点可类似于:本地vs云(需要解决通信性能),人工设计vs大模型生成(需要解决目标对齐)。区块链的应用要有明确切实的需求!

The difficulties associated with the technical landing of block chains can be similar to those of xff1a; local vs clouds xff08; need to address communication performance xff09; xff0c; manual design vs large model generation xff08; need to address target alignment xff09; application of block chains with clear and practical needs xff01;

在比特币的原始论文中,对交易、时间戳、工作量证明、网络、激励、验证都有分模块描述,但是比较粗糙。本报告按照《Mastering Bitcoin》这本经典书籍的思路,展开技术原理介绍。

In Bitcoin's original paper & #xff0c; a modular description of transactions, time stampes, workload certificates, networks, incentives, certifications & #xff0c; but rough. This report follows the thinking of Mastering Bitcoin, a classic book & #xff0c; an introduction to technical principles.

中文版书籍链接如下:
https://github.com/inoutcode/bitcoin_book_2nd

The Chinese version of the book is linked to xff1a;

数字货币的出现与密码学发展息息相关,挑战在于如何让数字拥有价值。比特币系统要解决的问题:

The emergence of digital money is closely linked to cryptography development #xff0c; the challenge is how to make the numbers value. The problem to be solved by the Bitcoin system & #xff1a;

  • 相信这笔钱是真实可信,而不是伪造的。
  • 确定这笔钱是属于我的,而不是别人的。

比特币系统主要构成模块:

The Bitcoin system consists mainly of module xff1a;

  • 一个去中心化的点对点网络(比特币协议)
  • 一个公共的交易账本(区块链)
  • 一个去中心一个去中心化的数学的和确定性的货币发行(分布式挖矿)
  • 一个去中心化的交易验证机制(交易脚本)

比特币系统由用户、交易和矿工组成。用户通过密钥控制钱包,交易被广播到比特币网络,矿工通过竞争计算生成区块。比特币官方地址为https://bitcoin.org

The Bitcoin system consists of users, traders, and miners. Users control wallets xff0c by key; transactions are broadcast to the Bitcoin network xff0c; miners compute blocks. Bitcoin's official address is .

交易就是要告知全网:比特币的持有者已经授权把比特币转账给其他人。新的持有者能够再次授权,产生另一笔交易来做相同的事情,即进行消费。

The deal is to inform the whole network of xff1a; the holder of Bitcoin has authorized the transfer of bitcoin to another person. The new holder can reauthorize xff0c; produce another transaction to do the same thing xff0c; i.e., consume.

交易包含一个或多个输入,即比特币的来源;同时,交易还包含一个或多个输出,即比特币的去处;输出与输入之间的差额,作为矿工打包交易的辛苦费。

The transaction included one or more inputs xff0c; i.e. the origin of Bitcoin xff1b; xff0c; the transaction also contained one or more outputs xff0c; i.e. the location of Bitcoin xff1b; the difference between the output and the input xff0c; and the cost of packing the transaction as a miner.

一个简单实例

下图展示了买咖啡的完整实例。Alice从Joe那里用现金换了点比特币,Alice支付Bob比特币用来买咖啡,形成一条钱转移的交易链。

The following graph shows the full examples of coffee purchases. Alice traded a bit of bitcoin for cash from Joe & #xff0c; Alice paid Bobbitco for coffee & #xff0c; and formed a chain of transactions for money transfers.

这笔交易见:http://bit.ly/1u0FIGs

see xff1a; http://bit.ly/10u0FIGs

这笔交易见:http://bit.ly/1u0FIGs

被广播到全网的交易等待矿工打包加入到区块中,通过竞争挖矿不久Alice的交易就在区块链里能被查询到记录,包含在第277316号区块中。
区块增长示例

The transactions that are broadcast to the whole network are waiting for miners to pack into blocks & #xff0c; soon after the mining competition, Alice's transactions can be traced to the records & #xff0c; included in block 277316.
 example of block growth

区块增长示例

几分钟后,第277,317号新区块诞生在另一个挖矿节点中,它的出现增加了Alice交易的可信度。基于这个区块每产生一个新区块,对于交易来说就增加了一次确认。当区块一个个堆上来时,交易会变得指数级越来越难被推翻,即得到了更多的信任。

A few minutes later xff0c; new block 277,317 was born in another mining node xff0c; its appearance increases the credibility of Alice's transactions. Based on each new block that produces a new block xff0c; an additional confirmation is added to the transactions. When a block is piled up xff0c; transactions become exponentially difficult to overturn xff0c; that is, more trust is gained.

可以通过一些区块链数据查询网站获取详细信息:

Detailed information can be obtained through a number of block chain data query websites:

密钥、地址、钱包

比特币采用基于椭圆曲线的公钥密码系统,私钥即一个随机数k,通过椭圆曲线乘法操作产生公钥K(椭圆曲线上的坐标点),再利用哈希函数结合其他操作生成简短地址A。比特币私钥、公钥和地址之间的关系

Bitcoin uses a public key password system based on elliptical curves & #xff0c; private key is a random number k, public key K( is generated by an elliptical multiplicity operation; coordinates on elliptical curves & #xff09; , again using the Hashi function to generate a short address A in combination with other operations. bitkey private key, public key and address relationship

比特币私钥、公钥和地址之间的关系

对公钥进行哈希函数后,做Base58Check编码得到比特币地址,其中还加入了各种版本信息和校验计算,方便区分、解析、识别。具体的编码算法,以及格式压缩,详见书第4章。

xff0c for public keys; Base58eck coded bitcoin xff0c; various versions of information and validation calculations xff0c; easy to distinguish, parsing, identifying. Specific encoding algorithms xff0c; and format compression xff0c; see chapter 4 of the book for details.

比特币公钥到地址的编码过程

bitcoin key to address encoding process

比特币公钥到地址的编码过程

钱包即私钥的容器,其中的私钥可以是随机非确定的,也可以是利用种子计算派生函数生成。

Wallet is the private key's container xff0c; the private key can be randomly undetermined xff0c; or it can be generated by calculating the derivative function using a feed.

非确定性钱包

indeterminate wallet

非确定性钱包
![分层确定性钱包](https://img-blog.csdnimg.cn/img_convert/3d612b4e1e8f59bf2c403db6538c14a3.png#pic_center)
分层确定性钱包

交易

一笔比特币交易是包含多个输入和输出的数据结构,其内容与账号或者身份信息无关,应当把它们理解成一种被特定秘密信息锁定的一定数量的比特币。

A bitcoin transaction is a data structure containing multiple inputs and outputs xff0c; its contents are not related to account numbers or identity information xff0c; they should be understood as a certain amount of bitcoin that is locked in a particular secret information.

比特币交易结构

Bitcoin trading structure

大小字段描述
4字节版本明确这笔交易参照的规则
1-9字节输入数量被包含的输入的数量
不定输入一个或多个交易输入
1-9字节输出数量被包含的输出的数量
不定输出一个或多个交易输出
4字节时钟时间一个UNIX时间戳或区块号

比特币的交易输出包含两个部分,它指定要转移的比特币数量,以及给定一个锁定脚本,即给花费这笔钱设置了一个障碍,需要满足某些条件。

The Bitcoin transaction output consists of two parts & #xff0c; it specifies the number of bitcoins & #xff0c to be transferred; and it assigns a locked script & #xff0c; that is, it creates a barrier to the cost of this money & #xff0c; certain conditions need to be met.

比特币交易输出结构

Bitcoin transaction output structure

尺寸字段说明
8个字节总量用聪表示的比特币值(10-8比特币)
1–9个字节(可变整数)锁定脚本尺寸用字节表示的后面的锁定脚本长度
变长锁定脚本一个定义了支付输出所需条件的脚本

未被花费的输出被简称为UTXO(unspent transaction output),它是不能再分割、被所有者锁住或记录于区块链中的并被整个网络识别成货币单位的一定量的比特币。

The unspent output is called UTXO& #xff08; unspent translation output) xff0c; it is a certain amount of bitcoins that can no longer be separated, locked or recorded by the owner in the block chain and recognized as monetary units by the network as a whole.

比特币的交易输入是指向UTXO的指针,表示其想花费被锁定的比特币,因此需要包含一个对应的解锁脚本,用来证明有针对该UTXO的所有权。

Bitcoin's trade entry is the pointer to UTXO xff0c; it indicates that it wants to spend the locked bitcoin xff0c; it therefore needs to include a corresponding unlocked script xff0c; it is used to prove ownership of the UTXO.

比特币交易输入结构

Bitcoin transaction input structure

尺寸字段说明
32个字节交易指向交易包含的被花费的UTXO的哈希指针
4个字节输出索引被花费的UTXO的索引号,第一个是0
1–9个字节(可变整数)解锁脚本尺寸用字节表示的后面的解锁脚本长度
变长解锁脚本一个达到UTXO锁定脚本中的条件的脚本
4个字节序列号目前未被使用的交易替换功能,设成0xFFFFFFFF

交易费 = 求和(所有输入) - 求和(所有输出),用户一般在输出中给自己找零。

Transaction fees & #61; & #xff08; All Inputs & #xff09; - & #xff08; All Output & #xff09; & #xff0c; Users generally find their own zeroes in the output.

交易脚本

较为简单的,令交易输出指定某个公钥地址,交易输入给出对应的私钥的签名,即可完成一笔交易。而比特币设计了一种脚本语言,让该过程更加灵活且可扩展,一个常用的交易脚本组合如下。

Simpler xff0c; making the transaction output specify a public key address xff0c; entering a signature giving the corresponding private key xff0c; and completing a transaction. Bitcoin has designed a script language xff0c; making the process more flexible and scalable xff0c; a common transaction script combination is as follows.

比特币交易脚本示例

Examples of Bitcoin Transactions

比特币交易脚本示例

这是一种基于堆栈的执行语言,执行完后栈顶推出TRUE则表示脚本匹配。交易脚本的执行流程大致如下所示。

This is a stack-based execution language & #xff0c; the TRUE roll-out after execution means that the script matches. The transaction script execution process is summarized below.

比特币定义了5种类型的标准交易,分别是P2PKH、P2PK、MS、P2SH和OP_Return。上述例子就是Pay-to-Public-Key-Hash脚本,详见书第6章。

Bitcoin defines five types of standard transactions xff0c; P2PKH, P2PK, MS, P2SH, and OP_Return. The above examples are Pay-to-Public-Key-Hash scripts xff0c; see chapter 6 of the book for details.

比特币网络

网络采用Peer-to-Peer对等架构,节点既是客户端,也是服务端,类似于BitTorrent内容分发系统。节点的四个功能:钱包、矿工、完整区块链、网络路由节点。通过组合这四个功能,产生不同类型的节点。

The network uses the Peer-to-Peer peer matching architecture xff0c; node is both a client xff0c; service end xff0c; similar to the BitTorrent content distribution system. The four functions of the node xff1a; wallet, miner, complete block chain, network route node. By combining the four functions xff0c; creating different types of node.

比特币节点类型

bitcoin node type

比特币节点类型

当新节点启动后,它发现至少一个节点并建立连接,并且随机地与其他节点连接。每个节点保持一定数量的邻居,通过心跳机制保证连通。比特币网络也包括了主网络、测试网络等,不再赘述。

When the new node starts xff0c; it finds at least one node and creates a connection xff0c; and randomly connects to other nodes. Each node maintains a certain number of neighbors xff0c; ensures connectivity through heartbeat mechanisms. The Bitcoin network also includes the main network, test networks, etc. xff0c; no further elaboration.

比特币网络

bitcoinnet

比特币网络

区块链

区块是一种被包含在公开账本里的聚合了交易信息的容器数据结构。

Blocks are a container data structure that is included in a publicly available account book that aggregates the transaction information.

比特币区块结构

Bitcoin block structure

大小字段描述
4字节区块大小用字节表示的该字段之后的区块大小
80字节区块头组成区块头的几个字段
1–9(可变整数)交易计数器交易的数量
可变的交易记录在区块里的交易信息

区块头是构建链结构的关键,其中的父区块哈希即链指针;难度、时间戳、Nonce值与挖矿竞争相关;Merkle根用来有效总结区块内的所有交易。

Blockheads are the key to building the chain structure xff0c; the parent block Hashi is the chain pointer xff1b; the difficulty, the time stamp, the Nonce value in relation to the mining competition xff1b; and Merkle root is used to effectively summarize all transactions within the block.

比特币区块头结构

Bitcoin block structure

大小字段描述
4字节版本版本号,用于跟踪软件/协议的更新
32字节父区块哈希值引用区块链中父区块的哈希值
32字节Merkle根该区块中交易的merkle树根的哈希值
4字节时间戳该区块产生的近似时间(精确到秒的Unix时间戳)
4字节难度目标该区块工作量证明算法的难度目标
4字节Nonce用于工作量证明算法的计数器

Merkle树是一种哈希二叉树,它可以用作快速归纳和校验大规模数据完整性的数据结构。叶子节点表示原始的分块的数据,然后从下往上两两拼接进行哈希计算,直到产生根哈希值。

The Merkle tree is a Hashi two-fork tree & #xff0c; it can be used to quickly summarize and verify the data structure of large-scale data integrity. The leaf dots represent the original fragments & #xff0c; then compute #xff0c from the bottom two to the top; until the root Hashi values are generated.

比特币交易哈希树示例

Examples of Bitcoin Trading Hashi Tree

比特币交易哈希树示例

如图所示,HA代表交易A的哈希值,以此类推。节点能够通过一条哈希路径来证明某个交易的存在。例如,证明交易K包含在区块中,给定HL、HIJ、HMNOP和HABCDEFGH4个哈希值,计算是否能匹配到根哈希。

xff0c, as shown in the figure; HA represents the Hashi value of trade A xff0c; so on. Node can prove the existence of a transaction through a Hashi path. For example, xff0c; xff0c, which proves that the transaction K is contained in a block; xff0c, which assigns HL, HiJ, HMNOP and HABCDEFGH to 4 Hashi xff0c; calculates whether or not it matches to Ghenhashi.

挖矿与共识

挖矿是增加比特币供应的过程,保护比特币系统的安全,防止欺诈交易,避免双重支付。矿工们验证每笔新的交易并记录在总账本上,约每10分钟就有一个新区块被挖掘出来,这个区块包含着从上一个区块产生到目前这段时间内发生的交易。

Mining is the process of increasing Bitcoin supply xff0c; protecting the bitcoin system xff0c; preventing fraudulent transactions xff0c; and avoiding double payment. Miners verify each new transaction and record it on the ledger xff0c; a new block is excavated xff0c every 10 minutes; this block contains transactions that occurred between the generation of the previous block and the present period.

  • 每挖掘出一个区块,会有一笔奖励给矿工。
    初始奖励为50个比特币,每开采210,000个区块,约4年时间奖励砍半,直到挖掘出将近2,100万比特币后,发行完毕。(一款通货紧缩货币)

比特币供应量趋势

bitcoinsupply trends

比特币供应量趋势
  • 矿工在挖掘区块时,会生成一笔特殊的创币交易,被称为Coinbase交易。
    Coinbase交易只有包含1个输入,是区块里的第一笔交易。也就是说,一个区块至少包含一个交易,该输入不包含解锁脚本,比特币凭空产生。

Coinbase交易输入结构

Coinbase transaction input structure

长度字段描述
32 字节交易哈希不引用任何一个交易,值全部为0
4 字节交易输出索引值全部为1
1-9 字节Coinbase数据长度coinbase数据长度
(VarInt) 可变长度Coinbase数据在v2版本的区块中,除了需要以区块高度开始外,其他数据可以任意填写,用于extra nonce和挖矿标签
4 bytes顺序号值全部为1,0xFFFFFFFF

在创世区块中,中本聪在Coinbase数据中写入了 “The Times 03/Jan/ 2009 Chancellor on brink of second bailout for banks”。

#xff0c in the Genesis block; Ben-Sung wrote in Coinbase data “The Times 03/Jan/2009 Challengellor on Brink of second bailout for banks”.

矿工挖掘区块得到的奖励,一部分来自于凭空产生的比特币,另一部分来自于在该区块中输入总额减去输出总额得到的交易费。

Incentives for miners to excavate blocks xff0c; partly from empty-generated bitcoin xff0c; and partly from total input in the block less transaction costs from total output.

矿工挖掘区块的过程,就是在计算区块头的哈希值的过程。矿工会尝试不同的Nonce值,填充到区块头的对应字段中,直到该区块头对应的哈希值小于某个目标值。

The process by which the miners dig blocks & #xff0c; is the process by which the Hashi values are calculated for the block head. The unions try different Nonce values & #xff0c; the corresponding fields filled to the block head & #xff0c; until the corresponding Hashi values for the block head are less than a target value.

 

比特币中的工作量证明采用SHA256函数,即哈希值有256位。难度通常是要求哈希值前面有多少个0,其计算公示为:target = coefficient * 2^(8 * (exponent – 3))。在区块277,316中,难度值为0x1903a30c。这个标记的值被存为系数/指数格式,0x19为幂,而0x03a30c为系数。

The workload in Bitcoin confirms the use of the SHA256 function & #xff0c; i.e. the Hashi value is 256. The difficulty is usually to ask how many 0xff0cs are in front of the Hashi value; it is calculated as xff1a; target & #61; caefficient * 2 (8* (exponent – 3)). In block 277,316 xff0c; the difficulty value is 0x1903a30c. The value of this mark is stored as a coefficient/index format xff0c; 0x19 is xff0c; and 0x03a30c is the coefficient.

 

比特币令每10分钟产生一个区块,挖矿难度会随着算力进行调整,调整周期为2016个区块。

Bitcoin produces a block & #xff0c every 10 minutes; the difficulty of mining is adjusted to xff0c; the adjustment cycle is 2016 blocks.

 

挖矿是同时且在不同节点上独自进行的,由于网络延迟区块链可能会产生分叉,工作量证明机制要求矿工选择最长链来解决分叉导致的差异,因而有了竞争挖矿。

Mining is carried out at the same time and on its own at different nodes xff0c; there is competition for mining due to network delay of block chains that may result in a fork xff0c; workload certification mechanisms require miners to choose the longest chain to address the differences resulting from the fork xff0c;

分叉之前

before split

分叉之前

同时发现两个区块

two blocks were also discovered

同时发现两个区块

两个区块的传播将网络分裂

The distribution of the two blocks divides the network

两个区块的传播将网络分裂

新区块延长分支

New Block Extension Branch

新区块延长分支

全网在最长链上重新共识

Reconsensus on the longest chain

全网在最长链上重新共识

竞争币

比特币是一个开源项目(https://github.com/bitcoin/bitcoin),其源代码也作为其他一些区块链项目的基础,由此衍生出各种竞争币。

Bitcoin is an open source project xff08; ) xff0c; its source code also serves as the basis for a number of other block chain projects xff0c; as a result, various competition currencies are derived.

  • 在比特币的区块链上层来扩展比特币协议的,如彩色币、万事达币、合约币。
  • 克隆或借鉴区块链模型开发的具有货币属性的,
    • 调整了造币参数的:莱特币、狗狗币、Freicoin
    • 一致性机制创新的:peercoin、Myriad、Blackcoin、vericoin、NXT
    • 多目的挖矿创新的:Primecoin、Curecoin、Gridcoin
    • 致力于匿名属性的:CryptoNote、Bytecoin、Monero、Zerocash/Zerocoin、Darkcoin
  • 非货币型竞争的区块链系统,如域名币、Bitmessage、以太坊。

2013年底,年轻程序员和比特币爱好者Vitalik Buterin考虑进一步扩展比特币,他分享了一份题目为《A next-generation smart contract and decentralized application platform》的白皮书,描述了以太坊背后的想法:一个图灵完备的可编程和通用区块链。

At the end of 2013 xff0c; Vitalik Buterin, a young programmer and Bitcoin lover, considered further expansion of Bitcoin xff0c; he shared a white paper entitled " A next-generation smart contract and decentralized application platform ", xff0c; described the idea behind the Taiku xff1a; and a graphically complete programmable and generic block chain.

Gavin Wood博士是第一批接触Vitalik并提供帮助提供C ++编程技能的人员之一。Gavin成为了以太坊的联合创始人,联合设计师和CTO。从2013年12月开始,Vitalik和Gavin完善并发展了这个想法,共同构建了形成以太坊的协议层。2015年7月30日,以太坊区块链正式运行。

Dr. Gavin Wood was one of the first people to come in contact with Vitalik and help provide C & #43; & #43; programming skills. Gavin became a co-founder of Etheria & #xff0c; Joint Designer and CTO. Starting in December 2013 & #xff0c; Vitalik and Gavin refined and developed the idea & #xff0c; and worked together to build an agreement layer for the formation of Etheria.

以太坊的核心在于,突破比特币交易脚本的限制,将其变为可编程的语言,以支持各种各样的应用。本报告按照《Mastering Ethereum》这本经典书籍的思路,同时参考了一些相关博客,展开技术原理介绍。

The center of Etheria is xff0c; breaking the restrictions on bitcoin trading scripts xff0c; turning it into a programmable language xff0c; and supporting a variety of applications. This report follows the thinking of Mastering Etheium, a classic book xff0c; also refers to a number of related blogs xff0c; and an introduction to technology.

中文版书籍链接如下:
https://github.com/inoutcode/ethereum_book

The Chinese version of the book is linked to xff1a;

以太坊设计了一个EVM虚拟机,它模拟计算机来运行程序,允许编写代码去执行动作。相较于比特币的标准脚本类型,以太坊能支持更多支付逻辑,其程序代码被称为智能合约。

An EVM virtual machine & #xff0c was designed in Taipan; it simulated the computer to run the program & #xff0c; it allowed code writing to perform the action. Compared to the standard bitcoin script type & #xff0c; it supported more payment logic & #xff0c; its program code was called smart contracts.

于是,在以太坊中存在两个实体:

xff0c; there are two entities in Etheria xff1a;

  • 外部账户(Externally Owned Accounts,EOAs):即以太坊的实际用户,与比特币的用户一样,通过私钥控制对资金的转移权限,同时还有对合约的访问权限。
  • 合约(Contracts):即以太坊的程序用户,类似于操作系统的进程句柄,可通过该账户控制程序代码的行为逻辑和执行流程。

合约有一个地址,也可以发送和接收ether,当交易目的地是合约地址时,它会导致该合约在EVM中运行,并将交易作为其输入。区别在于:人们通过EOA做出决定,而软件通过合约做出决定。

The contract has an address xff0c; it can also send and receive each other xff0c; xff0c when the destination of the transaction is the address of the contract; it will cause the contract to run xff0c in the EVM; and enter the transaction into it. The difference is xff1a; people make decisions through the EOA xff0c; and software makes decisions through the contract.

在以太坊虚拟机提供的底层EVM字节码基础之上,可以设计高级语言来更方便的编写智能合约。Gavin Wood创建了Solidity,已经成为以太坊及以太坊外最广泛使用的语言。

On the basis of the bottom EVM byte code provided by the Taiwan virtual machine, xff0c; advanced language can be designed to make it easier to write smart contracts. Gavin Wood has created the Solidity, it has become the most widely used language in Ether and Ether.

一个简单实例

给定一个经典的faucet合约代码示例:它给任何地址发放ether,并且可以定期补充ether到合约中。

Gives an example of a classic faucet contract code & #xff1a; distributes it to either & #xff0c at any address; and regularly supplements it to the contract.

 

该代码声明了一个Faucet的合约对象,withdraw()函数将合约里的ether转给发送者,()为回调函数,当交易不包含数据或没有调用已声明的函数时触发,用于向合约转账。

The code states that a Faucet contract object & #xff0c; the withdraw() function transfers the other of the contract to the sender & #xff0c; (a) returns function & #xff0c; triggers xff0c when the transaction does not contain data or does not call the stated function; and is used to transfer to the contract.

密钥、地址、钱包

与比特币类似,以太坊同样采用椭圆曲线来生成公私密钥。

xff0c similar to Bitcoin; Ether also uses elliptical curves to generate public and private keys.

不同地,以太坊使用Keccak-256哈希函数来将公钥转换成地址,并且使用互换客户端地址协议(Inter Exchange Client Address Protocol,ICAP)对地址进行编码。

xff0c, in different places; using the Keccak-256 Hashi function to convert the public key to an address xff0c; and using the swap client address protocol xff08; Inter Exchange Secret Address Protocol, ICAP) encode the address.

以太坊也使用钱包来存储私钥,但官方更鼓励使用确定性种子钱包,私钥通过密钥扩展算法派生,利用助记词进行备份和恢复。

Ether also uses wallets to store private keys & #xff0c; however, the official encourages the use of determinative seed wallets & #xff0c; the private key is derived from key extension algorithms & #xff0c; and backups and restorations are done using synonyms.

(主要对比以太坊与比特币的异同,详见书第5和6章)

& #xff08; major contrasts with Bitcoin & & #xff0c; for details see chapters 5 and 6 of the book & #xff09;

交易

由外部所有帐户发起的签名消息,由以太坊网络传输,并在以太坊区块链上进行记录(挖掘)。

Signing messages xff0c initiated by all external accounts; transmission of xff0c via the Etheria network; and recording xff08; excavation xff09;

交易是以太坊与比特币在设计上区别最大的地方,比特币中的交易记录过程,以太坊中的交易是唯一可触发状态变更,或导致合约在EVM中执行的事件,也可以说以太坊保留着结果。也因为交易的结构,以太坊不像比特币那样推荐密钥只使用一次就丢弃。

The transaction is xff0c, which is the place where the most distinction is made between Taiyo and Bitcoin; the transaction recording process in Bitcoin xff0c; the transaction in Taiga is the only event that triggers a change of status xff0c; or the event that led to the contract being executed in EVM xff0c; or the result is retained in Taiga. It is also because of the structure of the transaction xff0c; it is recommended that the key be discarded at a time, unlike Bitcoin.

以太坊交易结构

with Taiyo trading structure

字段描述
nonce由始发EOA(外部所有账户)发出的序列号,用于防止消息重播。
gas price发起人愿意支付的gas价格(以wei为单位)。
start gas发起人愿意支付的最大gas量。
to目标以太坊地址。
value发送到目标地址的ether数量。
data变长二进制数据。
v,r,s始发EOA的ECDSA签名的三个组成部分。

以太坊引入了gas的概念,它是作用于以太坊内部的虚拟货币。合约代码在EVM中以字节码的形式执行,每条代码的执行都映射一定量的gas消耗。以太坊依靠这一机制来限定合约执行的时间或步数,因为开放式(图灵完备的)计算模型需要某种形式的计量,以避免拒绝服务攻击或无意中的资源吞噬交易。

It introduces the Gas concept & #xff0c; it functions as a virtual currency within the Taiwan. The contract code implements & #xff0c in the EVM by bytes; each code is executed to map a certain amount of gas consumption. It relies on this mechanism to limit the time or pace of the contract implementation & #xff0c; because xff08 is open; xff09 is complete; the calculation model requires some form of measurement xff0c; it avoids denial of service attacks or the unintended draining of resources.

此外,gas设计与ether分离,以保护系统免受随着ether价值快速变化而产生的波动。gas与ether之间存在一个汇率,在交易中通过gasPrice来体现。如果一笔交易触发了合约的执行,但是gas在合约还未执行完之前就消耗完了,那么该执行回退,交易失败。gasPrice的设置也被矿工用来排序交易优先级,是矿工收入的来源之一,作为交易手续费。

In addition, xff0c; gas design separated from each other xff0c; protection of the system from fluctuations arising from rapid changes in the value of each other. Gas and else have an exchange rate xff0c; it is represented in transactions through GasPrice. If a transaction triggers the execution of the contract xff0c; but Gas consumes xff0c; then the execution returns xff0c; the transaction fails. GasPrice set-up is also used by miners to sort transaction priorities xff0c; it is one of the sources of mineral income xff0c; it is a transaction fee.

交易的载荷主要包含在两个字段value和data。value的值形成支付payment动作,data的值形成调用invocation动作,如果既没有value也没有data,那么该交易只是浪费gas,但依然合法。

The load of the transaction is mainly contained in two fields value and data. The value of the value is a pay-for-payment action & #xff0c; the value of data is a call for involcation action & #xff0c; if there is neither value nor data& #xff0c; then the transaction is a waste of gas& #xff0c; but it is still legal.

  • 将value传递给EOA和合约

如果to字段是EOA地址,那么value的值表示转账的金额;如果to字段是合约地址,那么value的值是锁定到合约的ether数量。

If the toe field is the EOA address & #xff0c; then the value of the value represents the amount transferred & #xff1b; if the toe field is the contract address & #xff0c; then the value of the value is the number of others locked in the contract.

  • 将data传输到EOA或合约

如果to字段是EOA地址,那么data的值相当于转账备注;如果to字段是合约地址,那么data的值为调用合约函数的参数。

If the to-field is an EOA address & #xff0c; then the value of the data corresponds to the transfer note & #xff1b; if the to-do is the contract address & #xff0c; then the value of the data is the parameter for calling the contract function.

  • 特殊交易:合约注册

如果有data,没有value,且to字段为0x0零地址,该交易创建一个合约,data是合约的字节码。

If there is a data & #xff0c; there is no value & #xff0c; and to field is 0x00 address & #xff0c; the transaction creates a contract & #xff0c; Data is the byte number of the contract.

智能合约

EOA与合约账户通过用户的一笔特殊交易产生关联,合约地址根据创建者的地址(sender)及其发送过的交易数量(nonce)来计算确定,进行RLP编码并计算Keccak-256哈希值。

EOA is associated with the contract account through a special transaction by the user xff0c; the contract address is based on the founder's address xff08; senderxff09; and the number of transactions it has sent xff08; nencexff09; to calculate the determination xff0c; to encode the RLP and calculate the Kelccak-256 Hashi value.

智能合约由密码学家Nick Szabo于二十世纪九十年代提出的,定义为“一组以数字形式规定的承诺,包括各方在其他承诺中履行的协议”。在以太坊中,智能合约是一段程序代码,在虚拟环境中确定性的运行,虚拟机指令详见第14章。

Smart contracts are proposed by the cryptographer Nick Szabo in the 1990s xff0c; they are defined as “a set of commitments in digital form xff0c; including agreements between the parties in other commitments”. In the Etheria xff0c; smart contracts are a program code xff0c; determinative operations xff0c in a virtual environment; and virtual machine instructions are detailed in chapter 14.

合约由EOA发起的交易创建,可以由交易调用,也可以被另一个合约调用。同时,交易是原子性的,成功的交易会改变原有的状态,错误的交易会将所有中间状态回滚,就好像交易从未运行过一样。(如何用solidity构建智能合约详见第8章)

A transaction initiated by the EOA creates xff0c; it can be called xff0c by the transaction; or it can be called by another contract. Also xff0c; the transaction is atomic xff0c; a successful transaction changes the old state xff0c; an erroneous transaction returns all the middle state xff0c; as if the transaction had never run. xff08; how a smart contract can be constructed with solidity is detailed in Chapter 8 xff09;

以太坊网络

与比特币一样,采用点对点的扁平式网络架构。存在的以太坊网络有:Ethereum,Ethereum Classic,Ella,Expanse,Ubiq,Musicoin等等。

Like Bitcoin xff0c; flat network architecture with point-to-points. The existing Ethernom networks are xff1a; Etheium, Etheum Classic, Ella, Expanse, Ubiq, Musicoin etc.

不同语言编写的以太坊协议主要实现:Go(Geth),Rust(parity),C++(cpp-ethereum),Python(pyethereum),Scala(mantis)和Java(harmony)。

xff1a; Go&Xff08; Geth) xff0c; Rust( paraity) xff0c; C+ xff08; cpp-etheum) xff0c; python( pyetheum) xff0c; Scala( mantis) and Javaxff08; harmony&#ff09;

流行的以太坊浏览器钱包有

There's a popular Ether Browser wallet.

区块链

显然,以太坊的区块结构相较于比特币要复杂的多,包含更多关键信息。

Obviously xff0c; more xff0c than Bitcoin; contains more key information.

以太坊区块头结构关键字段

with a key field for the

字段描述
ParentHash父块的哈希值
Number块编号
Timestamp块产生的时间戳
GasUsed交易消耗的Gas
GasLimitGas限制
DifficultyPoW的难度值
Beneficiary块打包手续费的受益人,也称矿工
Nonce一个随机数,使得块头哈希满足PoW要求

相较于比特币,以太坊在区块头中除了存储交易树根哈希,还存储着收据树根和状态树根哈希。(叔父区块树根哈希也在区块头中)

Compared to Bitcoin & #xff0c; Etheria in the block, in addition to the stocking of transactional root #xff0c; and the receipt root and state root #xff08; and the uncle #xff09 also in the block #xff09;

图片来源:https://zhuanlan.zhihu.com/p/30922425

 Photo sourcexff1a; https://zhuanlan.zhihu.com/p/30922425

图片来源:https://zhuanlan.zhihu.com/p/30922425

以太坊是基于状态的区块链,它由多个账户的状态共同组成了全局状态。

Etheria is a state-based block chain & #xff0c; it combines the state of multiple accounts.

以太坊账户数据结构

with Taiyo account data structure

字段描述
Balance该账号拥有的ether数量
Nonce该账号发送出去的交易数量,每做一笔交易自增1
CodeHash对于合约账户,是此账户存储EVM代码的哈希值。对于EOA账户,此处留空。
StorageRoot该账户的存储内容组成Merkle树后求得的根哈希值

收据树与交易树一样,都是采用Merkle树组织,记录日志和结算信息。状态树则采用MPT(Merkle Patricia Trie)树组织,方便存储内容的更新。

The receipt tree is the same as the transaction tree xff0c; all use Merkle Tree xff0c; record logs and clearing information. The status tree uses MPT( Merkle Patricia Trie) tree xff0c; easy storage updates.

图片来源:https://learnblockchain.cn/article/472

 Photo sourcexff1a; https://learnblockchain.cn/article/472

图片来源:https://learnblockchain.cn/article/472

账户存储树是保存与账户相关联数据的结构。该项只有合约账户才有,而在EOA中, storageRoot留空、codeHash则是一串空字符串的哈希值。

The account storage tree is the structure to store the data associated with the account. Only the contracted account has xff0c; while in the EUA xff0c; storeRoot is empty, codeHash is the Hashi value of an empty string.

挖矿与共识

以太坊除了在区块结构设计上有变动,对共识算法也进行很多改进。比特币设计的工作量证明PoW共识对电力的消耗巨大,而且由于比特币有利可图,出现了专业矿机提高哈希计算速度,造成了节点中心化,面临51%攻击风险。

In addition to the changes in block structure xff0c; there have been many improvements in consensus algorithms. Bitcoin has been designed to show that the PoW consensus consumes huge amounts of electricity xff0c; and because Bitcoin is profitable xff0c; there is a specialist miner that increases the rate of Hashi xff0c; that has caused node centralization xff0c; and that is exposed to 51% of the risk of attack.

以太坊中存在三种共识算法:

There are three consensus algorithms in Etheria & #xff1a;

  • Ethash:以太坊1.0的工作量证明PoW算法,实现了对抗矿机计算加速的特性。
  • PoA:权威证明算法,服务于测试网、私有链、联盟链等。
  • Casper:以太坊2.0的股权证明PoS算法,更高效更简洁。

以太坊的长期目标是将共识算法从PoW切换到PoS,在原有共识方案上都做了工程优化。下图是以太坊PoW共识算法ETHash的计算流程

The long-term goal is to switch consensus algorithms from PoW to PoS, the original consensus formula has been optimized. The chart below is based on the calculation process for ETHash for the Taepan Consensus algorithm.

图片来源:https://learnblockchain.cn/books/geth/part2/consensus/ethash.html

 Photo sourcexff1a; https://learnblockchain.cn/books/geth/part2/consensus/ethash.html

图片来源:https://learnblockchain.cn/books/geth/part2/consensus/ethash.html

PoW(Proof of Work):通过节点竞争去寻找基于哈希函数的困难解,奖励发现谜题答案的参与者,验证交易并创建新区块。

PoW( Proof of Work) xff1a; difficulties in finding solutions based on the Hashi function by node competition xff0c; rewards participants for finding answers to puzzles xff0c; authenticating transactions and creating new blocks.

PoA(Proof of Authority):交易的有效性由一组经批准的链上账户确定,也即授权节点来达成账本共识。

PoA( Proof of Authority) xff1a; validity of the transaction is determined by a group of approved chain accounts xff0c; i.e. authorized nodes to reach agreement on the ledger.

PoS(Proof of Stake):依赖验证者在网络中的经济利益,任何持有ether可以通过发现一种特殊交易锁定其ether称为验证者。

PoS( Proof of Stake) & #xff1a; Reliance on the financial interest of the certificationer in the networkxff0c; any holder can lock its other as a certificationer by discovering a special transaction.

此外,以太坊还在链结构上做了一些优化,应用了一种名为GHOST协议的算法,全称为The Greedy Heaviest-Observed Sub-Tree(贪婪最重可观测子树算法)。相比于比特币的最长链原则,可以认为以太坊采用的是最重链原则。

In addition, xff0c; Etheria has also done some optimization xff0c on the chain structure; applied an algorithm called the GHOST protocol xff0c; all known as The Greedy Health-Observed Sub-Tree. The longest-chain principle compared to Bitcoin xff0c; it can be considered to be the most chain-based principle.

图片来源:https://blog.csdn.net/qq_50665031/article/details/123943430

 Photo sourcexff1a; https://blog.csdn.net/qq_50665031/article/details/12394330

图片来源:https://blog.csdn.net/qq_50665031/article/details/123943430

叔父区块与交易一样存储在区块体中,并通过Merkle哈希树进行组织,其树根存储在区块头中。

The uncle block is stored in the block xff0c as in the transaction; it is organized through the Merkle Hashi tree xff0c; its roots are stored in the block.

web3.0

以太坊的设计将比特币核心的区块链升级为了可编程的平台,超级账本Fabric项目更进一步,直接舍弃了货币属性,还有更多的智能合约平台,EOS、Moonbeam、Cardano等。

Designed to upgrade the bitcoin core block chain to a programmable platform & #xff0c; super-account Fabric project further & #xff0c; directly discarding currency properties & #xff0c; more smart contract platforms & #xff0c; EOS, Moonbeam, Cardano, etc.

热门智能合约平台列表可见网站:
https://www.coinlore.com/zh/smart-contract-platforms

The list of popular smart contract platforms is available at https://#xff1a;

更多的,当提及区块链智能合约给互联网带来的改变,为了理解将互联网的发展划分了三个阶段(参考博客:https://ethereum.org/zh/web3)。

More xff0c; refer to changes to the Internet brought about by block-chain smart contracts xff0c; divide the development of the Internet into three phases xff08 for understanding; refer to blog xff1a;

  • web1.0(1990-2004)。特点是只读,各个公司拥有静态网站,采用服务器/客户端模式,与用户的互动基本为零。
  • web2.0(2004-至今)。特点是能读能写,社交媒体的出现,用户交互更多了,用户既是内容生产者,也是内容消费者。
  • web3.0(2014-将来)。特点是能读能写能拥有,用户可以制定交互的规则,实现数据所有权、社区自我治理等目标。

自区块链诞生以来,其去中心化构建的信任环境吸引了广泛的关注,工业界和学术界都做了大量的研究。根据其研究内容,可以大致划分为如下三个层面:

Since the birth of the block chain xff0c; its decentralised confidence environment has attracted a wide range of attention xff0c; industry and academia have done a great deal of research. Based on its research content xff0c; it can be broadly divided into three levels xff1a, as follows;

  • 应用的:将区块链技术在金融领域扩展,以及延申到其他领域,利用区块链的公开、去中心化、不可篡改的特性以保障应用安全。
  • 技术的:在区块链现有结构和框架下,引入或者结合其他密码学技术、协议、算法等,以获得新的功能,产生更有趣的技术。
  • 算法的:以核心共识算法为主,改变底层区块链结构和影响区块链节点行为的方案,这是一类最为基础的研究方向。

在本报告中,列举上述三个层面部分典型案例,目标对区块链研究进程有一个宏观的了解。

In this report xff0c; a typical sample of the above-mentioned three levels xff0c; and a macro-level understanding of the block chain research process for the target.

2013年,染色币(colored coin)诞生和尝试,它利用比特币的特点,把空余字段定义成特殊的数据格式,用以代表所持有的其他资产,使得比特币支持更广泛的应用。

2013 xff0c; dyed currency xff08; colored coin) birth and attempted xff0c; it uses Bitcoin characteristics xff0c; defines empty fields as special data formats xff0c; represents other assets held xff0c; allows Bitcoin to support wider applications.

此后,各种山寨币相继出现,绝大多数山寨币来自于比特币源码克隆修改了部分参数之后成为新的币种。

Since then, xff0c; various bounties appear xff0c; most of them come from bitcoin source cloning, which changes some of the parameters and becomes a new currency.

2021年,非同质化代币(Non-fungible token,NFT)出现,利用区块链打造数字藏品。

2021 xff0c; non-homogenous tokens xff08; Non-fungible token, NFT) emergence xff0c; building digital collections using block chains.

各大企业入局区块链领域,提供区块链服务平台。

Large enterprises enter block chain areas & #xff0c; provide block chain service platforms.

在供应链金融、溯源、电信、司法存证等场景都做了大量应用尝试,信通院在区块链应用场景方面都发过相关白皮书。

A large number of application attempts have been made in the context of supply chain finance, traceability, telecommunications and judicial documentation; the Institute has published white papers on the application of block chains.

闪电网络

闪电网络(Lightning Network)基于比特币的交易脚本和时间锁定的特性,结合密码学承诺方案,构建了一个在线的支付通道,让Alice和Bob交易双方能够将交易的许多细节移动至链外,而只需将交易的初始状态和最重状态记录在链上。

Lightning Network & #xff08; Lighting Network) Characteristics for Bitcoin-based transaction scripts and time locking xff0c; Combining cryptography Commitment xff0c; Constructing an online payment channel xff0c; allowing Alice and Bob to move many details of the transaction out of the chain xff0c; and simply recording the initial and maximum state of the transaction on the chain.

Alice和Bob支付一笔押金到一个特殊的锁定脚本,然后各自生成一笔承诺交易,并获得对方的签名。公开锁定脚本所在交易开启支付通道。一旦某一方关闭该支付通道,另一方可以取出协商中剩余的属于自己的余额。

Alice and Bob pay a deposit to a special lock-in script xff0c; each generates a promise transaction xff0c; and obtains the other party’s signature. Open lock-in of the transaction opens the payment channel. Once one party closes the payment channel xff0c; the other party can extract the balance remaining from the consultation.

闪电网络承诺交易示意图

Model of Trade Commitments for Lightning Networks

闪电网络承诺交易示意图

基于此,可通过扩散承诺的参与者,将支付通道延申成闪电网络。

Based on this #xff0c; participants who can commit to proliferation & #xff0c; extending the payment route to a lightning network.

闪电网络承诺传递示意图

Molniya Network Commitment Maps

闪电网络承诺传递示意图

闪电网络方案的原始论文:
https://lightning.network/lightning-network-paper.pdf

Original thesis for the Lightning Network programme & #xff1a;

技术细节可参考这篇博客:
https://zhuanlan.zhihu.com/p/611633729

Technical details can be found in this blog & #xff1a;

跨链技术

跨链是一种将A链上的数据安全可信地转移到B链上并产生预期效果的一种技术。通常,跨链利用哈希锁定技术,类似于闪电网络,使得冻结在A链上的资产等值创建在B链上。目标是做一个多个链之间的hub。

Cross-chains are a technique that can safely and credibly transfer data from chain A to chain B with the desired effect. Usually & #xff0c; cross-chains use Hashi locking technology & #xff0c; similar to lightning network & #xff0c; creates asset equivalents from frozen chain A on chain B. The goal is to make a hub between multiple chains.

热门的跨链项目:

The popular cross-chain project xff1a;

致力于匿名性的区块链

这一研究方向尝试构建具备一定隐私能力的公开货币。

This research direction attempts to build open currency with certain privacy capabilities.

  • Darkcoin方案通过一个名为DarkSend的混淆协议来实现匿名,在逻辑上切断交易之间的链接关系。

Darkcoin匿名池混淆

Darkcoin anonymous pool

Darkcoin匿名池混淆

Darkcoin方案的原始论文:
https://cryptochainuni.com/wp-content/uploads/Darkcoin-Whitepaper.pdf

xff1a;

  • CryptoNote方案利用环签名技术实现了身份匿名,即一笔交易的签名可以由所构造环上的任意公钥验证。Bytecoin和Monero都是这种方案的实例。

CryptoNote环签名匿名

CryptoNote signatures anonymous

CryptoNote环签名匿名

CryptoNote方案的原始论文:
https://www.getmonero.org/ru/resources/research-lab/pubs/whitepaper_annotated.pdf

xff1a;

字节币Bytecoin,官方网站:https://www.bytecoin.org,项目地址:https://github.com/bcndev/bytecoin

Bytes Bytecoin, official website xff1a; , project addressxff1a;

门罗币Monero,官方网站:https://www.getmonero.org,项目地址:https://github.com/monero-project/monero

Menro & #xff0c; official website xff1a; , project address xff1a;

  • Zerocoin方案将需要匿名的比特币通过承诺方案转换成零币,并形成一个匿名池,构造经典零知识证明协议,向接收者证明转账金额来源于某个零币,从而切换比特币之间的连接关系。

Zerocoin零知识匿名

Zerocoin zero knowledge anonymous

Zerocoin零知识匿名

Zerocoin方案的原始论文:
https://doi.org/10.1109/SP.2013.34

xff1a;

  • Zerocash方案设计了一种交易电路,使用zk-SNARKs通用零知识证明技术,将交易过程中的身份甚至是金额都隐藏。

Zerocash零知识匿名

Zerocash Zero Knowledge Anonymous

Zerocash零知识匿名

Zerocash方案的原始论文:
https://doi.org/10.1109/SP.2014.36

xff1a;

更多区块链隐私保护相关的研究,可参考博客:
https://zhuanlan.zhihu.com/p/501364521

More research on privacy protection in block chains & #xff0c; refer to blog :

基于区块链的隐蔽通信

由于区块链的公开特性,将区块链网络作为信道可实现隐蔽通信,做到内容和行为双重隐藏。例如,将消息隐藏在交易地址、可变字段、时间戳、随机数等等。

Because of the open nature of the block chain & #xff0c; by using the block chain network as a channel to achieve covert communication & #xff0c; by hiding both content and behaviour. For example & #xff0c; by hiding messages in a transaction address, variable fields, time stamp, random numbers, etc.

区块链隐蔽通信模型

block chain covert communication model

区块链隐蔽通信模型

Chen等人对该方向的研究做了调研和整理《Blockchain Meets Covert Communication: A Survey》,原始论文:
https://doi.org/10.1109/COMST.2022.3204281

Chen et al. studied and collated the study of this direction in Blockchai Meets Corporation: A Survey & #xff0c; original paper & #xff1a;

基于区块链的去中心存储

这一研究方向尝试利用区块链的去中心特性构建更可靠的存储

This research direction attempts to build a more reliable storage using the decentralised characteristics of the block chain.

  • Permacoin方案将大文件拆分成数据块,构建Merkle哈希树,并将文件的路径证明嵌入到工作量证明中,从而实现了全局的文件存储。

Permacoin方案的原始论文:
https://doi.org/10.1109/SP.2014.37

xff1a;

  • Filecoin方案受存储证明启发,设计了一个存储交易平台。用户发起存储订单,节点提供存储服务。

Filecoin存储市场机制

Filecoin Storage Market Mechanism

Filecoin存储市场机制

Filecoin方案的原始论文:
https://filecoin.io/filecoin.pdf

Original paper from Filecoin & #xff1a;

  • Yin等人(嘻嘻,就是我自己)也提出了PoCW(Proof of Continuous Work)方案,实现了数据的自动分配、检索和多节点存储。

PoCW方案存储分配机制

PoCW Program Storage Allocation Mechanism

PoCW方案存储分配机制

PoCW方案的原始论文:
https://doi.org/10.1109/JIOT.2021.3115568

The original paper from the PoCW programme xff1a;

结合拜占庭容错

基于PoX(Proof of Everything)机制的区块链在性能上依然难以满足业务需求,一些研究考虑将传统的拜占庭容错算法引入到区块链共识算法中。这里列举几个比较经典的方案。

Based on PoX( Proof of Everything) the mechanism's block chain is still difficult to meet operational needs in terms of performance & #xff0c; some studies consider introducing the traditional Byzantine tolerance error algorithm into the block chain consensus algorithm. Here are some of the more classic options.

  • Byzcoin利用移动窗口的思想来选定参与共识的节点集合,挖到新区块的节点成为本轮共识组成员中的leader,执行PBFT协议完成共识。

Byzcoin方案滑动窗口决定共识组成员

Byzcoin Slide Window Decision Consensus Group members

Byzcoin方案滑动窗口决定共识组成员

Byzcoin方案的原始论文:
https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/kogias

The original paper from the Byzcoin programme & #xff1a;

  • Algorand采用一种密码学的选举机制,节点计算某个哈希值,命中则被选择成为共识组成员,然后执行PBFT协议决定区块。

Algorand方案选举机制确定公示组成员

Algorand Programme Election Mechanism Determination Group Member

Algorand方案选举机制确定公示组成员

Algorand方案的原始论文:
https://doi.org/10.1145/3132747.3132757

xff1a;

分片技术伸缩性

分片技术将整个区块链网络分成不同的分片,由各分片的节点负责处理所在分片的事务以及存储分片的状态,通过并行验证事务,整个区块链的吞吐率近似线性地提升。

Fragmentation technology divides the entire block chain network into different fragments & #xff0c; the nodes of the fragments are responsible for handling the affairs of the fragments and the status of the fragments & #xff0c; through parallel authentication services & #xff0c; and the whole block chain has a near linear upscaling rate.

  • Elastico是最为经典的方案,它令所有节点计算一个哈希值,哈希值的后面几位代表该节点所在的分片组,每个分片独自执行PBFT协议完成局部共识,最后由特定分片汇总产生全局共识。

Elastico方案将网络节点分片

Elastico has network nodes

Elastico方案将网络节点分片

Elastico方案的原始论文:
https://doi.org/10.1145/2976749.2978389

Original paper from the Elastico programme:

更多区块链分片技术方向研究,可参考博客:
https://zanez.top/2022/05/17/220517-sharding-blockchain

More technical direction of block chains & #xff0c; refer to blog :

嵌入拜占庭容错

除了结合拜占庭容错算法,还有一种直接将拜占庭容错算法的协议执行阶段与区块链的区块生成过程更紧密适配的研究。

In addition to combining the Byzantine tolerance error algorithm & #xff0c; there is a study that directly matches the implementation phase of the Byzantine error algorithm with the block generation process of the block chain.

  • Hotstuff方案巧妙地将PBFT三阶段与区块链结构融合在了一起,形成了流水线式的共识操作,进一步优化了性能。

Hotstuff方案流水线协议执行

Hotstuff Program Waterline Implementation

Hotstuff方案流水线协议执行

Hotstuff方案的原始论文:
https://doi.org/10.1145/3293611.3331591

Original thesis from the Hottuff programme & #xff1a;

  • HCA方案(嘻嘻,也是我写的)在Hotstuff的基础上,引入了改票操作,允许临时分叉,通过轮换leader简化了协议流程。

HCA方案临时分叉回退

HCA temporary retreat

HCA方案临时分叉回退

HCA方案的原始论文:
https://doi.org/10.1109/TDSC.2023.3262283

The original HCA programme paper & #xff1a;

基于有向无环图

单链结构十分限制区块链系统的性能,就连以太坊都采用GHOST协议来提高吞吐率,这一类研究即引入有向无环图,重构了区块链的底层结构,实现更高的吞吐率和性能。

The single-chain structure limits the performance of block chain systems & #xff0c; even the Etheria uses the GHOST protocol to increase the rate of vomiting & #xff0c; this type of study introduces a ringless map & #xff0c; reconstructs the bottom structure of the block chain & #xff0c; and achieves a higher rate of vomiting and performance.

  • Hashgraph方案采用八卦协议构造缠绕式的图结构,基于PBFT输出共识结果。

Hashgraph方案引用关系划分轮

Hashgraph Program Reference Lined

Hashgraph方案引用关系划分轮

Hashgraph方案的原始论文:
https://www.swirlds.com/wp-content/uploads/2016/06/2016-05-31-Swirlds-Consensus-Algorithm-TR-2016-01.pdf

xff1a;

Conflux方案自适应分配权重

Conflux scheme self-adaptation weights

Conflux方案自适应分配权重

Conflux方案的原始论文:
https://www.usenix.org/system/files/atc20-li-chenxing.pdf

xff1a;
https://www.usenix.org/systems/atc20-li-chenxing.pdf

  • Phantom方案使用聚集函数在图中划分出最大聚集子集作为共识结果。

Phantom方案递归算法排序

Phantom Retrometry Sorting

Phantom方案递归算法排序

Phantom方案的原始论文:
https://doi.org/10.1145/3479722.3480990

xff1a;

推荐阅读这一篇综述论文,了解图结构区块链的更多有趣方案:
https://doi.org/10.48550/arXiv.2012.06128

It is recommended to read this overview paper & #xff0c; more interesting options for understanding the structure block chain & #xff1a;

交易排序公平性

现有区块链共识算法忽略的一个问题,即区块打包交易时的排序公平性。其中,涉及到一个名为Condorcet Paradox,即社会选择理论中的孔多塞悖论,交易的排序引用会形成哈密顿回路。

An issue that the existing block chain consensus algorithm ignores & #xff0c; i.e., the sorting fairness of block wrapping transactions. & #xff0c; concerns a condorcet Paradox, i.e., the codox paradox in the social selection theory & #xff0c; the sorting reference to the transaction will form the Hamidon circuit.

以三个投票者为例

投票者第一选择第二选择第三选择
1号ABC
2号BCA
3号CAB

汇总三个投票者的排序偏好,得到如下图所示结果。

A summary of the three voters' ranking preferences xff0c; the results are shown in the figure below.

图片来源:https://en.wikipedia.org/wiki/Condorcet_paradox

 Photo sourcexff1a; https://en.wikipedia.org/wiki/Condorcet_paradox

图片来源:https://en.wikipedia.org/wiki/Condorcet_paradox

Themis方案提出了一种延迟排序的算法,交易通过区块按批划分保持排序结果,确定顺序的交易在当前区块中输出,剩余交易等待后续区块的交易排序更新信息。

Themis programme proposes a delayed sorting algorithm & #xff0c; transactions maintain sorting results & #xff0c by lot through blocks; sequenced transactions produce & #xff0c in the current block; and the remaining transactions await updated information on the sorting of transactions in subsequent blocks.

Themis方案对交易延迟排序

Themis Program Sorting Delays in Transactions

Themis方案对交易延迟排序

Themis方案的原始论文:
https://doi.org/10.1145/3576915.3616658

Themis programme's original paper xff1a;

  • 介绍了区块链是什么以及它的特性
  • 介绍了比特币的基本原理
  • 介绍了以太坊的基本原理
  • 介绍了以区块链为核心延申的各类相关研究

个人理解,区块链本质上是一个处于基础网络架构和应用业务系统之间的技术,它更偏向于搭建平台和生态,优化管理和服务等,难以设计实际可观的现象级应用,因而在各类场景落地稍有逊色。当协同需求和网络环境足够成熟时,该技术会有它的用武之地。

Personal comprehension & #xff0c; block chains are essentially a technology & #xff0c between basic network architectures and application business systems; it is more oriented towards building platforms and ecology & #xff0c; optimize management and services & #xff0c; it is difficult to design real and impressive phenomenon-level applications & #xff0c; it is therefore less appropriate in various contexts. When the needs are matched and the network environment is sufficiently mature & #xff0c; the technology will have its use.

美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明

分享:

扫一扫在手机阅读、分享本文

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 0.00015693个比特币等于多少人民币/美金

    0.00015693个比特币等于多少人民币/美金
    0.000 15693比特币等于多少人民币?根据比特币对人民币的最新汇率,0.000 15693比特币等于10.6 1678529美元/76.86554996人民币。比特币(BTC)【比特币价格翻倍】美元(USDT)人民币(CNY)0.000/克洛克-0/5693【数字货币矿机】10.6 167852976.8655254996比特币对人民币的最新汇率为:489,807.72 CNY(1比特币= 489,807.72人民币)(1美元=7.24人民币)(0.00015693 U...
  • 0.00003374个比特币等于多少人民币/美金

    0.00003374个比特币等于多少人民币/美金
    0.00003374比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00003374比特币等于2.2826 1222美元/16.5261124728人民币。比特币(BTC)美元(USDT)人民币(CNY)0.00003374克洛克-0/22216.5261124728比特币对人民币的最新汇率为:489807.72 CNY(1比特币=489807.72人民币)(1美元=7.24人民币)(0.00003374USDT=0.0002442776 CNY)。汇率更新于2024...
  • 2000年美国GDP占世界的304%,中国GDP仅占35%,现在呢?

    2000年美国GDP占世界的304%,中国GDP仅占35%,现在呢?
    GDP作为全球公认的实力基准,就像是一个大国实力的代言人,它是布雷顿森林体系下全球团结的声音。它不仅仅是数字的累积,更是大国综合实力的人格化,默默诉说着每个国家的辉煌与荣耀。虽然GDP不是衡量一个国家综合实力的唯一标准,但无疑是最关键的指标之一。作为一面镜子,它反映了国家的经济实力和发展水平,是国家综合实力的重要体现,不容忽视。2000年,中国GDP迈过/克洛克-0/万亿美元的重要门槛,达到/克洛克-0/。2/克洛克-0/万亿美元(折合人民币7。7万亿元)。然而,在全球经济的...
  • A股利好!证监会连开三场座谈会!五部门发文 事关元宇宙…周末影响一周市场的十大消息(新股+点评)

    A股利好!证监会连开三场座谈会!五部门发文 事关元宇宙…周末影响一周市场的十大消息(新股+点评)
    1   证监会连开三场座谈会!将研究出台更多务实、管用的政策举措 The SEC will hold three talks! More practical and practical policy initiatives will be developed.   近日,中国证监会就活跃资本市场、提振投资者信心召开三场座谈会,分别听取专家学者和投资者意...
  • 1929经济大萧条或许即将重演?

    1929经济大萧条或许即将重演?
    人类似乎陷入了一个历史悖论,即我们总是重复同样的错误,无法真正从过去的错误中吸取教训。近年来,我们对世界各地接连不断的挑战和危机深感不安。20 19年突如其来的疫情,乌克兰的战火硝烟,欧洲的天然气供应危机以及全球少数国家的饥荒,所有这些问题都像洪水一样,一个接一个地涌来。如果你今天感到心情沉重,不要失去希望,因为明天可能会带来更严峻的挑战。首先,让我们深入讨论名为1929大萧条的时期。这场大萧条实际上是指从1929到1933的一场影响深远的经济危机。这场危机首先起源于美国,然...
标签列表