《精通区块链开发技术》笔记

资讯 2024-06-18 阅读:89 评论:0
第一章:区块链(内容简介:分布式系统的理论基础——比特币的前身:电子现金、哈希现金——区块链技术)Chapter I: Block chains (Introduction: theoretical basis of distribute...
美化布局示例

欧易(OKX)最新版本

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

APP下载   全球官网 大陆官网

币安(Binance)最新版本

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

APP下载   官网地址

火币HTX最新版本

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

APP下载   官网地址

第一章:区块链(内容简介:分布式系统的理论基础——比特币的前身:电子现金、哈希现金——区块链技术)

Chapter I: Block chains (Introduction: theoretical basis of distributed system — Bitcoin predecessor: electronic cash, cash in Hash — block chain technology)

1.1分布式系统

1.1 Distributed system

1、区块链的核心是一个【去中心化的分布式系统】

1. At the core of the block chain is a [decentralized distribution system]

2、分布式系统中的节点可以相互交换信息

2. Nodes in distributed systems can exchange information with each other

3、节点分为可信节点、缺陷节点、恶意节点。一个有任意行为的节点被称为拜占庭节点,网路上某个出现任何意外行为的节点都可归类于拜占庭节点

3. Nodes are divided into credible nodes, defective nodes, and malignant nodes.

4、分布式系统的主要挑战:节点与【容错】的协调,即一个节点的失效不影响整个系统的运行。

4. The main challenge for distributed systems: coordination of nodes with [missing], i.e. the failure of one node does not affect the operation of the entire system.

 

1.1.1 CAP定理:任意分布式系统不能同时拥有一致性,可用性,分区容错性(但区块链可以实现三种属性)

1.1.1 CAP Theories: Distributive systems cannot simultaneously have consistency, usability, partition tolerance (but block chains can achieve three attributes)

(一致性:任意节点拥有最新数据副本;可用性:系统在使用期间可以被访问,必要时做出回应;分区容错性:一组节点的失效不影响系统的运行)

(consistency: any node has a copy of the latest data; usability: the system is accessible during its use and responds when necessary; partition tolerance: the failure of a set of nodes does not affect the system's functioning)

 

1.1.2 一致性问题前身——拜占庭将军问题

1.1.2 Prior to the issue of coherence — General Byzantine

我方将军通过信使希望就进攻或撤退达成一致,问题是存在若干会传递错误信息叛徒将军(拜占庭节点),现在我们希望找到一种可信机制,让将军们成功达成一致决定。——解决方案【Proof of Work:PoW】

Our General hopes, through the messenger, to agree on an attack or a withdrawal. The problem is the existence of a number of traitors who will send the wrong message (the Byzantine node), and now we hope to find a credible mechanism for the generals to reach a successful consensus decision.

 

1.1.3 分布式一致性问题

1.1.3 Distributive consistency issues

1、一致性机制:达成一致性的步骤

1. Coherence mechanisms: consensual steps

2、一致性机制需求:

2. Need for a coherence mechanism:

      协议:所有可信节点指定同一值

& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; protocol: all credible nodes specify the same value

      有效性:所有可信节点的商定值必须至少与一个节点提供的初始值相同

& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; Validity: The agreed value of all credible nodes must be at least the same as the initial value provided by one node

      容错性

& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; tolerance

      完整性:任意节点只可决策一次

& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; Complete: Any node can be decided only once

3、一致性机制类型:

3. Type of coherence mechanism:

      基于拜占庭式的容错:无计算密集型操作(如部分哈希反射),依赖于简单的发布签名的节点方案,当签名到达一定数量时达成协议

& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; Error based on Byzantine tolerance: no calculation-intensive operations (e.g. partial Hashi reflection), relying on a node formula for simple publication of signatures, agreement reached when the signature reached a certain number

      基于领导的一致性机制:节点实现领导的选举机制,当选的节点提供结果值

& nbsp; & nbsp; & nbsp; & nbsp; & nbsp; & nbsp; leadership-based coherence mechanisms: nodes to achieve leadership electoral mechanisms, elected nodes to provide outcome values

 

1.2 区块链历史

1.2 Block chain history

Hashcash控制垃圾邮件原理:生成hash是一个计算密集型过程,非法用户发送大量垃圾邮件要消耗大量计算资源

Hashcash control spam principle: generating hash is a computing-intensive process, and illegal users send large amounts of spam at the expense of a significant amount of computing resources

 

1.3 区块链简介

1.3 Brief description of the block chain

区块链的核心是一个点对点的分布式账本,该账本具有加密安全性,只能在对等身份成员间达成协议时追加,且不能更改

At the core of the block chain is a distributed account with a point-to-point secure account, which can only be added to an agreement between the members of the peer status and cannot be changed

区块链网络视图:互联网——P2P网络——交易——区块——共识——状态机——区块链应用(智能合约)——用户(节点)

Block chain network view: Internet — P2P network — trade — blocks — consensus — status machine — block chain application (smart contract) — user (node)

 

1.3.1 区块链技术的各种定义

1.3.1 Various definitions of block chain technology

区块链是一种去中心化的协商一致机制。在区块链中,所有对等点最终会达成关于交易状态的协议。

The block chain is a decentralised consensus mechanism. In the block chain, all peer points eventually agree on the state of the transaction.

区块链是一个分布式共享账本,可以看作共享的唯一的交易总账。

The block chain is a distributed shared ledger, which can be considered as the only shared general ledger of transactions.

作为一个数据结构,区块链是hash链表,成员基本包括指向前一个区块的hash指针、nonce、交易。

As a data structure, the block chain is the hash chain, and its members consist essentially of the hash pointers, nence, transactions that point to the front block.

 

1.3.2区块链的一般元素

1.3.2 General elements of the block chain

1、地址:表示事务中收件人和发件人的唯一标识符。建议在每个事务中用新生成的地址,防止用所有者的地址,避免身份识别。

1. Address: the only identifier for the addressee and the sender in the transaction. It is recommended that the newly generated address be used in each transaction to prevent the owner's address and avoid identification.

2、事务:基本单元,表示地址间的值传输。

2. Services: Basic units, which represent the transfer of values between addresses.

3、区块:hash指针+nonce+时间戳+若干事务。

3. Blocks: hash pointers + nence + time stamp + a number of matters.

4、状态机:状态转换机制,一个区块链可以看作一个状态转换机制。

4. Status machines: a status conversion mechanism, a block chain that can be considered as a status conversion mechanism.

5、智能合约:智能合约运行于区块链之上,在满足某些条件时封装业务。区块链并不支持智能合约。

Smart contracts: Smart contracts run above the block chain and encapsulate operations when certain conditions are met.

 

1.3.3 区块链特性

1.3.3 Block chain characteristics

1、分布式一致性:在确实中心信任机制授权的情况下,各方就结果达成一致。

Consistency in distribution: where the central trust mechanism is indeed mandated, the parties agree on the outcome.

2、事务验证:节点上发布的任何事务经过验证后,其有效事务将包含在区块中。

2. Certification of services: When any matter published on a node is certified, its validity will be included in the blocks.

3、智能合约平台:区块链定义为一个平台,程序运行其上。

3. Smart contract platform: The block chain is defined as a platform on which the program operates.

4、对等点间传输值:区块链允许对等点通过令牌传递值,令牌是值的载体。

4. The value of the peer transfer: The block chain allows the peer to pass the value through the token, which is the carrier of the value.

5、生产加密货币:可选项,为的是激励矿商。

5. Production of encrypted currency: an option to stimulate miners.

6、智能属性:使区块链内的资产,任何人都无权占有、完全由个人控制、不可重复使用。(该特性对于数字版权管理(DRM)和电子现金系统有着深远的影响)

Intellectual property: No one has the right to take possession of the assets in the block chain, is entirely personally controlled and cannot be reused. (This feature has far-reaching implications for digital copyright management (DRM) and e-cash systems.)

7、不变性:已经添加的记录是不可变的。如果想要改变,则需要重新计算已经添加的所有区块,而这几乎是不可能的。

7. Non-variability: The records that have been added are immutable. If you want to change, all blocks that have been added need to be recalculated, which is almost impossible.

8、唯一性:每个事务都是唯一的。在加密货币中,想要发现并避免双重支出,唯一性是关键因素。

8. Monopoly: Every business is the only one. In encrypted currency, the only factor that is critical is to discover and avoid double spending.

9、智能合约:区块链提供了一个有智能合约特性的平台,可视为区块链上的自主程序,可以封装业务逻辑和代码,以便下一步所需。智能合约同时实现了灵活性、可编程性、对于特定业务执行的特定操作,区块链用户可对此加以控制。

Smart contracts: The block chain provides a platform with the characteristics of a smart contract that can be seen as an autonomous process on the block chain and can encapsulate business logic and codes that are needed for the next step. Smart contracts simultaneously achieve flexibility, programability, and specific operations for a given operation, which can be controlled by the block chain user.

 

1.3.4 创建区块的一般方案、区块的生成方式、区块与事务的关系

1.3.4 General programme for creating blocks, how blocks are generated, relationship of blocks to affairs

节点通过私钥签名启动事务——多个对等点通过Gossip协议验证传播事务,该协议通过里预置标准验证事务——验证成功,创建新区块,确认旧事务(一次确认)——传播至网络、加入账本(链入区块链(二次确认))

Node start-up service through private key signature — multiple peer validation of communication service through Gossip protocol, through preset standard authentication service — successful validation, creation of new blocks, confirmation of old service (one confirmation) — to the network, to the account book (link to block chain (second confirmation))

 

 

第二章 去中心化

Chapter two, go to the centre.

 

2.1基于区块链的去中心化

2.1 Decentralization based on block chains

1、用户通过【共识机制】,在不需要信任的第三方的情况下达成一致。最常用的就是【工作量证明PoW】。

1. Users agree through the [consensus mechanism], without the need to trust third parties.

2、中央式、分布式系统都存在控制整个系统的单一权威控制机构,所以其都是中心化的。去中心化系统不存在单一权威控制机构,它把权力层层下放,就像公司管理系统一样,这也是它的创新之处。

The central, distributed system has a single authority to control the system, so it is centralized. The decentralized system does not have a single authority to control, and it decentralizes the layers of authority, just like the corporate management system, which is its innovation.

并行系统和分布式系统的差别:并行系统中,计算由所以节点同步执行;而在分布式系统中,数据仅可在单一聚合系统上复制,计算不是并行计算。

Differences between parallel and distributed systems: in parallel systems, the calculation is executed simultaneously by the so-called nodes; in distributed systems, the data can be reproduced only on a single polymeric system, and the calculation is not a parallel calculation.

 

2.2去中心化方法

2.2 Method of decentralisation

1、非中介化:绕过中介,地址对地址。

Non-intermediated: bypassing intermediaries, address to address.

2、中介竞争:智能合约在服务提供者间选择。

2. Intermediary competition: Smart contracts are selected among service providers.

 

2.3去中心化流程

2.3 Decentralization process

评估去中心化需求的框架:

Framework for assessing decentralised needs:

1、去中心化的含义:什么是去中心化系统,去中心化系统可以是任意系统,如认证系统或交易系统。

1. The meaning of decentralisation: what constitutes a decentralised system can be any system, such as a certification system or a trading system.

2、去中心化所需的级别:完全去中心化、部分去中心化。

2. Levels required for decentralisation: complete decentralisation, partial decentralisation.

3、选择哪一种区块链:比特币区块链、以太坊区块链。

3. Which block chain is chosen: the Bitcoin block chain, the Etheria block chain.

4、选择哪一种安全性机制:机制可以是原子性的,即事务全部执行或全部不执行,这可以确保完整性。声誉机制,支持系统中不同的受信程度。

4. Which security mechanism should be chosen: the mechanism may be atomic, i.e. the whole or total non-execution of the matter, which ensures integrity. A reputational mechanism supports different levels of acceptance in the system.

 

 

2.4区块链和完整的生态圈去中心化操作

2.4 Block chain and complete circulatory decentralisation

为了实现完整的去中心化系统,需要对区块链周围环境也执行去中心化操作。

In order to achieve a complete decentralization system, decentralised operations would also be required for the environment around the block chain.

 

储存、通信、计算(计算的去中心化是通过区块链技术实现的,如以太坊。其中,包含业务逻辑的智能合约可以允许于该网上。)

Storage, communication, computation (decentralization of calculations is done through block chain technology, e.g., Ether.

 

去中心化的生态系统概览:

A decentralised overview of ecosystems:

通信(因特网、网格网络)——储存(IPFS、BigChainDB 文件系统、数据库)——区块链(以太坊、超级账本)——身份、财富

Communications (Internet, grid network) - storage (IPFS, Big ChainDB file system, database) - block chain (in Taiyo, superbook) - identity, wealth

 

美化布局示例

欧易(OKX)最新版本

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

APP下载   全球官网 大陆官网

币安(Binance)最新版本

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

APP下载   官网地址

火币HTX最新版本

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

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

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

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

分享:

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

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

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 支付領域投下震撼彈!美國數位銀行Chime疑與GuardPay 神盾支付合作!

    支付領域投下震撼彈!美國數位銀行Chime疑與GuardPay 神盾支付合作!
    2020年,新冠肺炎(COVID-19)疫情加速數位貨幣進展。例如:2019年4月,國際清算銀行(BIS)的調查顯示,在全球66家中央銀行中,沒有一家計畫發行跨境支付的數位貨幣。惟到了2020年10月,BIS支付委員會主席康利夫(Jon Cunliffe)指出,肺炎疫情拉高民眾對無現金支付的需求,迫使各國加快數位貨幣的研發進程日本與韓國於2021年進入數位貨幣試驗階段。直到2019年12月,美國聯邦準備理事會(Fed)都尚無數位貨幣規劃,惟到了2020年2月,Fed已開始研擬...
  • 区块链:交易系统开发指南

    区块链:交易系统开发指南
    播报编辑《区块链:交易系统开发指南》使用通俗易懂的语言,从技术的角度详细介绍了区块链交易系统应有的功能架构及工作原理,让人们能够张开双臂轻松地拥抱区块链技术,享受区块链交易系统带来的惊喜与成就感。《区块链:交易系统开发指南》共分 7 章,第 1~2 章主要介绍区块链及数字货币的基本概念,以及各种公有链的 API 接口;第3~5 章主要介绍区块链交易系统的分类架构及功能; 6 章主要介绍区块链交易系统面临的问题及演进方向;第 7 章对全书做了总结。《区块链:交易系统开发指南》是...
  • 5.14加密货币价格:BTC突破6.2万美元以太坊和山寨币反映市场情绪

    5.14加密货币价格:BTC突破6.2万美元以太坊和山寨币反映市场情绪
    今天,随着比特币(BTC)的价格突破62 000美元的门槛,顶级加密货币的价格反弹了。 此外,以铁大幅上涨,维持在2 900美元的水平。 此外,其他顶尖山硬币,如索拉纳(SOL )、XRP、卡达诺(ADA )也大幅上涨。    今天密钥加密货币价格 1. 比特币价格    在5月14日星期二撰写本文时,比特币价格上升了2.57%,达到62 487.50美元。 另一方面,在过去24小时内,交易量从65.26 % 急剧上升至277亿美元。 与此同时,加密货币的市场价值为...
  • OKEx回应用户质疑:合约交易非期货 平台无机器人

    OKEx回应用户质疑:合约交易非期货 平台无机器人
       热点点 自选股份 数据中心 数据中心 研究和资料中心 资金流动 模拟交易 客户客户 具体来说,OKEx回答用户的问题:合同交易不是期货,平台不是机器人。 金融同步化,3月22日。    昨天下午,OKEx公司就维护先前用户线下的权利问题对同步财务公司作出了回应,指出OKEx公司提供的合同交易不是期货交易,在旗下的业务中没有正式的机器人。 同时,OKEX称,它不会以非法为由对任何投资损失索赔作出答复。 答复全文如下: 同步你的财务! 近日来,...
  • 0.00006694个比特币等于多少人民币/美金

    0.00006694个比特币等于多少人民币/美金
    0.00006694比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00006694比特币等于4.53424784美元/32.5436 16人民币。比特币(BTC)美元(USDT)人民币(CNY)0.000066944.53424784【比特币密码】32.82795436 16比特币对人民币的最新汇率为:490408.64 CNY(1比特币=490408.64人民币)(1美元=7.24人民币)(0.00006694USDT=0.0004846456 CNY)汇率更新时...
标签列表