比特币知识解析:比特币底层区块链技术到底是什么?

资讯 2024-07-14 阅读:47 评论:0
比特币底层区块链技术到底是什么?最近几年,各种技术不断涌现,大数据、云计算、人工智能等相关技术异常火热,而比特币的大热也是引起了人们的纷纷侧目,由此,也让别人对比特币的底层技术——区块链技术兴趣大增。2015年被称为区块链技术的元年,如今...
美化布局示例

欧易(OKX)最新版本

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

APP下载   全球官网 大陆官网

币安(Binance)最新版本

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

APP下载   官网地址

火币HTX最新版本

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

APP下载   官网地址

比特币底层区块链技术到底是什么?最近几年,各种技术不断涌现,大数据、云计算、人工智能等相关技术异常火热,而比特币的大热也是引起了人们的纷纷侧目,由此,也让别人对比特币的底层技术——区块链技术兴趣大增。2015年被称为区块链技术的元年,如今距离比特币大热已经过去了两年多,人们对区块链技术的热情依然没有消退,那么,比特币底层区块链技术到底是什么?

What is the bottom sector chain technology of Bitcoin? In recent years, technologies have been emerging, big data, cloud computing, artificial intelligence, etc., and the heat of Bitcoin has caused a heated crowding of people, which has also given rise to increased interest in the bottom sector chain technology of Bitcoin. What is the bottom sector chain technology of Bitcoin, which is known as the year of block chain technology in 2015, more than two years after it has been hot, and the enthusiasm for block chain technology has not faded?

比特币知识解析:比特币底层区块链技术到底是什么?

一、区块链技术

block chain technology

1.什么是区块链?

1. What is a block chain?

区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。所谓共识机制是区块链系统中实现不同节点之间建立信任、获取权益的数学算法,区块链(Blockchain)是比特币的一个重要概念,它本质上是一个去中心化的数据库,同时作为比特币的底层技术。区块链是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一次比特币网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。

Block chains are new applications of computer technology, such as distributed data storage, point-to-point transmission, consensus mechanisms, and encryption algorithms. Consensus mechanisms are mathematical algorithms for building trust and equity between nodes in block chain systems. Block chains are an important concept of Bitcoin, which is essentially a decentralized database, and serve as a bottom-of-the-line technology for bitcoins. Block chains are a series of data blocks that are associated with cryptography, each containing information on a Bitcoin network transaction to verify the validity of its information (falterability) and generate the next block.

2.区块链基本原理

2. Fundamentals of the block chain

如果把区块链作为一个状态机,则每次交易就是试图改变一次状态,而每次共识生成的区块,就是参与者对于区块中所有交易内容导致状态改变的结果进行确认。

If the block chain is used as a status machine, each transaction is an attempt to change the state, and each consensual block is the participant's confirmation of the result of a change in the state of all transaction elements in the block.

交易(Transaction):一次操作,导致账本状态的一次改变,如添加一条记录

Transaction: One operation leading to a change in the account's status, such as the addition of a record

区块(Block):记录一段时间内发生的交易和状态结果,是对当前账本状态的一次共识

Block (Block): Recording the results of transactions and status over time is a common understanding of the current account status

链(Chain):由一个个区块按照发生顺序串联而成,是整个状态变化的日志记录。

Chain (Chain): A block is linked in order of occurrence and is a log of the entire state change.

3.区块链要解决的问题

3. Problems to be addressed in the block chain

如何去中心化地共享数据?如何确保账户不被冒用?如何确保账户余额足够?如何确保交易记录不被篡改?谁负责记账?怎么保障记账者的可信?怎么保障记账者的积极性?

How to centralize data sharing? How to ensure that accounts are not misused? How to ensure that account balances are sufficient? How to ensure that transaction records are not tampered with? Who is responsible for bookkeeping? How to guarantee the credibility of bookkeepers?

4.区块链特征

4. Features of the block chain

去中心化

Let's go to the center.

由于使用分布式核算和存储,不存在中心化的硬件或管理机构,任意节点的权利和义务都是均等的,系统中的数据块由整个系统中具有维护功能的节点来共同维护。

As a result of the use of distributed accounting and storage, there is no centralized hardware or regulatory body, rights and obligations are equal at any node, and data blocks in the system are jointly maintained by nodes with maintenance functions throughout the system.

得益于区块链的去中心化特征,比特币也拥有去中心化的特征 .

Bitcoin also has decentralised features because of the decentralisation of the block chain.

开放性

Openness

系统是开放的,除了交易各方的私有信息被加密外,区块链的数据对所有人公开,任何人都可以通过公开的接口查询区块链数据和开发相关应用,因此整个系统信息高度透明。

The system is open and, with the exception of the encryption of private information by the parties to the transaction, the data in the block chain are made available to all, and anyone can access the block chain data and develop relevant applications through open interfaces, thus providing a high degree of transparency of information throughout the system.

自治性

Autonomy

区块链采用基于协商一致的规范和协议(比如一套公开透明的算法)使得整个系统中的所有节点能够在去信任的环境自由安全的交换数据,使得对"人"的信任改成了对机器的信任,任何人为的干预不起作用。

The use of consensus-based norms and agreements in the block chain (e.g. an open and transparent algorithm) allows all nodes of the system to exchange freely and secure data in a trusted environment, transforming trust into trust in the machine, and no one's intervention works.

信息不可篡改

Information cannot be tampered with.

一旦信息经过验证并添加至区块链,就会永久的存储起来,除非能够同时控制住系统中超过51%的节点,否则单个节点上对数据库的修改是无效的,因此区块链的数据稳定性和可靠性极高。

Once the information is validated and added to the block chain, it is permanently stored, and unless more than 51 per cent of the nodes in the system can be controlled simultaneously, changes to the database at a single node are invalid and therefore the data stability and reliability of the block chain are extremely high.

匿名性

Anonymous

由于节点之间的交换遵循固定的算法,其数据交互是无需信任的(区块链中的程序规则会自行判断活动是否有效),因此交易对手无须通过公开身份的方式让对方对自己产生信任,对信用的累积非常有帮助。

Since exchange between nodes follows a fixed algorithm, the interaction of data is untrustworthy (the rules of procedure in the block chain determine the validity of the activity) and it is therefore not necessary for the counterparty to create confidence in itself through an open identity, which is very helpful for credit accumulation.

二、P2P网络及通信技术(分布式计算网络)

II. P2P network and communication technology (distributed computing network)

1.自动发现

1. Auto-discovery

通过种子文件,获取初始节点(地址及端口),连接初始节点,获取初始节点知道的Peer,把自己的地址及端口广播给各个Peer,接收各个Peer广播的地址信息,构建出网络的全貌或片段。

From the torrent file, get the initial node (address and port), connect the initial node, get the Peer known to the initial node, broadcast its address and port to the Peer, receive the address information of each Peer broadcast, and construct the full picture or segment of the network.

2. 技术领域

2. In the area of technology

分布式存储、分布式计算、分布式协同

Distributed storage, distributed computing, distributed synergy

组播

_Other Organiser

流媒体

Streaming

搜索引擎

Search Engine

3.通信协议

3. Communications agreement

napster 、Gnutella、eDonkey、 Bittorrent(文件分发协议)

Napster, Gnutella, eDonkey, Bittorrent

XMPP、Jabber(即时通信协议)

XMPP, Jabber (immediate communication protocol)

Paxos 、Gossip(分布式系统状态同步协议)

Paxos, Gossip (distributed system state synchronization protocol)

JXTA

4.使用HASH算法及非对称加密及签名技术

4. Use of HASH algorithms and asymmetric encryption and signature techniques

每个节点、每个人有唯一的一对公钥及私钥

Every node, everyone has one pair of public and private keys.

公钥同时也是每个节点、个人的地址和账号

The public key is also the address and account number of each node, individual.

私钥是证明"我就是我"的唯一手段

The private key is proof of &quat; I'm the only way to do it.

HASH算法对数据进行规整

HASH algorithms regulate data

5.算法

5. Algorithms

RSA、Elgamal、D-H、ECC

SHA256、 RIMPED160

6.通常使用椭圆曲线算法生成密钥对

6. Elliptical curve algorithms are usually used to generate key pairs

比特币密钥长度:256位

Bitcoin Key Length: 256

公钥哈希值=RIMPED160(SHA256(公钥))

Public Key HQ = RISMED160 (SHA256)

比特币地址=1+Base58(0+公钥哈希值+校验码)

Bitcoin address = 1 + Base58 (0 + Public Key Harsh + Validation Code)

校验码=前四字节(SHA256(SHA256(0+公钥哈希值)))

Checksum = first four bytes (SHA256 (THA256 (0+ public key)))

7. 加密

7. Encryption

发送方使用接收方的公钥加密数据

Sender encrypts data using the recipient's public key

接收方使用本方的私钥解密数据

The recipient uses its own private key decryption data

通常使用本方面交换对称加密的Key

Usually use this to exchange symmetrically encrypted Keys

8.签名

Signature

发送方使用HASH算法计算数据的HASH值

Sender calculates the HASH value of the data using the HASH algorithm

发送方使用本方的私钥加密HASH值,得到签名

Sender encrypt HASH values with its own private key to get signature

接收方使用HASH算法计算数据的HASH值

The recipient uses the HASH algorithm to calculate the HASH value of the data

接收方使用发送方的公钥解密签名得到发送的HASH值

The recipient uses the sender's public key decryption to send the HASH value

比较两个HASH值的一致性

Compares the consistency of the two HASH values

9.参考

9. References

ElGamal算法,是一种较为常见的加密算法,它是基于1984年提出的公钥密码体制和椭圆曲线加密体系。既能用于数据加密也能用于数字签名,其安全性依赖于计算有限域上离散对数这一难题。在加密过程中,生成的密文长度是明文的两倍,且每次加密后都会在密文中生成一个随机数K,在密码中主要应用离散对数问题的几个性质:求解离散对数(可能)是困难的,而其逆运算指数运算可以应用平方-乘的方法有效地计算。也就是说,在适当的群G中,指数函数是单向函数。

The ElGamal algorithm, which is a more common encryption algorithm, is based on the public key cryptographic system introduced in 1984 and the elliptical encryption system. It can be used both for data encryption and for digital signatures, and its security depends on the difficulty of calculating discrete logarithms in a limited area. In encryption, the message is generated twice as long as it is specified, and each time it is encrypted, a random number of K is generated in the code, in which several features of the discrete logarithm problem are used: it is difficult to solve the discrete logarithm (possibly) and its counter-transaction index calculation is effectively calculated using a square-multiplier method. In other words, in the appropriate group G, the index function is a one-way function.

椭圆曲线密码体制是目前已知的公钥体制中,对每比特所提供加密强度最高的一种体制。解椭圆曲线上的离散对数问题的最好算法是Pollard rho方法,其时间复杂度为,是完全指数阶的。其中n为等式(2)中m的二进制表示的位数。当n=234, 约为2117,需要1.6*1023 MIPS 年的时间。而我们熟知的RSA所利用的是大整数分解的困难问题,目前对于一般情况下的因数分解的最好算法的时间复杂度是子指数阶的,当n=2048时,需要2x1020MIPS年的时间。也就是说当RSA的密钥使用2048位时,ECC的密钥使用234位所获得的安全强度还高出许多。它们之间的密钥长度却相差达9倍,当ECC的密钥更大时它们之间差距将更大。更ECC密钥短的优点是非常明显的,随加密强度的提高,密钥长度变化不大。

An elliptical cryptographic system is one of the currently known public key systems with the highest encryption intensity for each bit. The best calculation of dissociated logarithm problems on the ellipse curve is the Pollard rho method, which is time-complicated and fully indexed. n is the number of digits expressed in binary versions of medium (2) m. When n=234, about 217, it takes 1.6*1023 years. And the familiar RSA uses the difficulty of large integer decomposition, and the difference between them is even greater when the number of factors is larger. n=2048, it takes 2x1020 MIPS. That is, when RSA keys are in 204 digits, the ECC keys are in 234 digits of security.

DH Diffie-Hellman算法(D-H算法),密钥一致协议,是由公开密钥密码体制的奠基人Diffie和Hellman所提出的一种思想。简单的说就是允许两名用户在公开媒体上交换信息以生成"一致"的、可以共享的密钥。换句话说,就是由甲方产出一对密钥(公钥、私钥),乙方依照甲方公钥产生乙方密钥对(公钥、私钥)。以此为基线,作为数据传输保密基础,同时双方使用同一种对称加密算法构建本地密钥(SecretKey)对数据加密。这样,在互通了本地密钥(SecretKey)算法后,甲乙双方公开自己的公钥,使用对方的公钥和刚才产生的私钥加密数据,同时可以使用对方的公钥和自己的私钥对数据解密。不单单是甲乙双方两方,可以扩展为多方共享数据通讯,这样就完成了网络交互数据的安全通讯!该算法源于中国的同余定理--中国馀数定理。

DH Diffie-Hellman algorithm (D-H algorithm), a key-consensual agreement, is an idea put forward by Diffie and Hellman, the founder of the open key cryptography system. Simply put, two users are allowed to exchange information in the open media to generate &quat; consistent &quat; and shared keys. In other words, it is a public key (public key, private key) that is produced by the first party, that is, that the second party produces a beta key pair (public key, private key) in accordance with the first public key. As a baseline, the other party's public key and its private key are used as a basis for data transmission confidentiality, while the other party uses a symmetric encryption algorithm to create local key (SecretKey) encryption for data. In this way, after sharing the local key (SecretKey) algorithm, the second party has made public its own key, using the other party's public key and the private key encryption data that it has just produced.

三、区块链化数据库

III. Block Linking Database

1.典型特征

1. Typical features

去中心化的、分布式的、区块化存储的数据库

Centralized, distributed, block-based databases

区块(Header + Body)

Block (Header + Body)

Chains

随机数

Random number

时间戳

Time stamp

包含父区块创建之后、本区块创建之前的全部交易;

Include all transactions after the creation of the parent block and before the creation of this block;

满足某个条件的区块HASH;

Block HASH that meets a condition;

a) SHA256(SHA256(version + prev_hash + merkle_root + ntime + nbits + x ))

b) Target值由动态的难度系数确定,Target越小,难度越高;

(b) The Target value is determined by a dynamic difficulty factor, and the smaller the Target, the more difficult it is;

2. 参考

References

默克尔树是一种二叉树,由一组叶节点、一组中间节点和一个根节点构成。最下面的大量的叶节点包含基础数据,每个中间节点是它的两个子节点的哈希,根节点也是由它的两个子节点的哈希,代表了默克尔树的顶部。默克尔树的目的是允许区块的数据可以零散地传送:节点可以从一个源下载区块头,从另外的源下载与其有关的树的其它部分,而依然能够确认所有的数据都是正确的。

The Merkel tree is a two-fork tree, made up of a set of leaves, a set of intermediate nodes and a root node. The bottom large number of leaves contains basic data, each of which is the Haschi of its two sub-nodes and the root nodes of its two sub-nodes, representing the top of the Merkel tree. The Merkel tree is designed to allow block data to be transmitted in a piecemeal manner: node can be downloaded from one source from the other part of the tree to which it relates, and it can still confirm that all data are correct.

默克尔树协议对比特币的长期持续性可以说是至关重要的。在2014年4月,比特币网络中的一个全节点-存储和处理所有区块的全部数据的节点-需要占用15GB的内存空间,而且还以每个月超过1GB的速度增长。简化支付确认(SPV)协议允许另一种节点存在,这样的节点被成为"轻节点",它下载区块头,使用区块头确认工作量证明,然后只下载与其交易相关的默克尔树"分支".这使得轻节点只要下载整个区块链的一小部分,就可以安全地确定任何一笔比特币交易的状态和账户的当前余额。

In April 2014, a full node in the Bitcoin network - the node for the storage and processing of all data on all blocks - needed to occupy 15 GB memory space and grow at a rate greater than 1 GB per month. Simplified payment confirmation (SPV) agreements allowed another node to exist, which became &quat; light node & quot; it downloaded block head, using block head to confirm workload proof, and then downloaded only the Merkel tree &quat, branch & quot;... so that light node could safely determine the current balance of any bitcoin transaction as long as it downloaded a fraction of the entire block chain.

四、记账权竞争及奖励制度(挖矿)

iv. Rights of account competition and incentive systems (mining)

1.概述

1. General

为防止可预期的记账节点被控制或攻击,导致错误记账行为,区块链技术采用竞争记账权的做法:

In order to prevent the control or attack of the foreseeable nodes of the accounts leading to erroneous accounting behaviour, block chain technology uses competitive rights to record:

任何一个节点均可以参与记账,因而记账节点无法预期,也就不容易被控

Any node can be involved in the recording of accounts, so the node cannot be anticipated and cannot easily be charged

竞争的过程就是看谁最先计算出满足条件的HASH值

The process of competition is to see who first calculates the HASH values that satisfy the requirements.

每次计算必须以最后1个有效的区块为起点,必须消耗大量的计算机CPU,增加伪造记账数据的成本

Each calculation must start with the last valid block and must consume a significant amount of computer CPUs and increase the cost of false recording of data

计算的结果必须得到大部分节点的认可(共识算法),才会成为新的区块。实际算法中,如果该区块位于最长的区块链上,则为正式被认可的区块,也即大部分节点认可计算结果,并愿意在该结果下继续计算

The result of the calculation must be endorsed by most nodes (consensus algorithms) in order to become a new block. In the actual algorithm, if the block is located on the longest chain of blocks, the officially accepted block, that is, most nodes, endorses the calculation and is willing to continue with the calculation under that result.

这个过程被称为挖矿,或工作量证明(POW)。参与挖矿的节点称为矿工,协同挖矿的矿工联合体称为矿池

This process is referred to as mining or workload certification (POW). The nodes involved in mining are referred to as miners, and the co-mining miners' complex is referred to as a pond.

a ) 以前1区块为起点,计算满足条件的HASH值;

a) The previous block is the starting point for the calculation of the HASH value that meets the conditions;

b ) 将计算的结果广播给其他节点;

b) broadcast the results of the calculations to other nodes;

c ) 其他节点验证计算结果无误时,认可该结果,并以该结果为起点重新进行计算;

c) if other nodes verify that the calculation results are correct, endorse the result and recalculate the result from the starting point;

d ) 单位时间内达到共识认可要求时,该区块成为正式认可的区块。

d) The block becomes an officially recognized block when the requirements for consensus endorsement have been met within the time of the unit.

这个过程被称系统为鼓励挖矿的积极性,给予竞争成功的记账节点奖励

This process has been described as a system that encourages mining and rewards successful accounting nodes for competition.

a ) 给予每个区块挖矿者直接的"现金"奖励。例如,比特币网络给予25个比特币,以太坊给予5个以太币;

a) & quot; cash & quot; rewards for each block diggers. For example, the Bitcoin network grants 25 bitcoins and the Tails 5 taels;

b ) 以太坊:纳入该区块的交易的手续费,由发起节点和记账节点分成(发起75%,记账25%)。

b) Etheria: the transaction fee for inclusion in the block is divided between the launch node and the account node (75 per cent initiation, 25 per cent recording).

2. 参考

References

比特币使用的SHA256算法,会有2^256种输出,如果我们进行2^256+1次输入,那么必然会产生一次碰撞;甚至从概率的角度看,进行2^130次输入就会有99%的可能发生一次碰撞。不过我们可以计算一下,假设一台计算机以每秒10000次的速度进行哈希运算,要经过10^27年才能完成2^128次哈希!这时要考虑一种情况:如果同时有两个矿工各自得到一个正确答案,并各自生成了一个区块广播出去会发生什么呢?这时候在区块链上同一个位置就有了两个区块,所谓的"分叉"就出现了。分叉是绝对不允许的,所以当矿工发现区块链分叉之后,会选择最长的一条继续计算,短的那条区块链会被丢弃。这里的长短,不是简单意义上的长短,而是工作量证明合计值最大的那个链。

The SHA256 algorithm used in Bitcoin has 2,256 outputs, and if two miners each get a correct answer and each produces a block broadcast, there will inevitably be a collision; even from a probabilistic point of view, there will be a probability of a collision of 99%. But we can calculate that assuming that a computer performs Hashi at a rate of 10,000 per second, it will take 10,128 Hashis after 27 years to complete.

美化布局示例

欧易(OKX)最新版本

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

APP下载   全球官网 大陆官网

币安(Binance)最新版本

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

APP下载   官网地址

火币HTX最新版本

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

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

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

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

分享:

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

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

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • DDO在新加坡上市真假,欧意交易所能交易数字期权吗?

    DDO在新加坡上市真假,欧意交易所能交易数字期权吗?
    然而,对于DDO在新加坡的列名是否真实存在争议。 据报道,有人质疑DDO的数字选项是否真的上市,其背景是否经过了彻底调查。 首先,有报告说,DDO数字选项清单仅仅是一种宣传手段,没有找到DDO交易的平台,这就对DDO的真正清单提出了疑问。 其次,一些媒体调查了DDO数字选项的背景。 报告显示DDO数字选项发行人声称其数字选项是国家赞助的,但实际上,根据中国人民银行,虚拟货币相关业务是非法金融活动。 此外,DDO数字选项在视频号码等平台上广为传播,吸引了许多信徒的注意,然...
  • Griffin Gaming Partners计划为其第三支基金筹集5亿美元

    Griffin Gaming Partners计划为其第三支基金筹集5亿美元
    Pitchbook引用的6月8日《快链头条新闻》作为监管文件, 指出游戏风险投资公司Griffin赌博伙伴计划为其第三个旗舰基金筹集5亿美元, 比第二个基金少33%。 2021年,格里芬赌博伙伴从Web3游戏开发者Forte获得A回合资金1.85亿美元,并于2022年筹集了第二个旗舰基金,金额达7.5亿美元,此时风险资本家对Web3和加密游戏的热情达到顶峰。...
  • 加密货币之王重回王位:比特币飙升至 71,000 美元,还能再涨多少?

    加密货币之王重回王位:比特币飙升至 71,000 美元,还能再涨多少?
    比特币是市场上最大的加密货币,它再次打破了重要的7万美元门槛。 在短短的四舍五入(67,000美元到69,000美元之间)之后,价格在这一水平上遇到了强烈的抵制。 然而,势头的不断增强表明,比特币可能形成一个超过70 000美元的板块,为重新测试下一个抵抗阵地71 300美元和3月份可能攀升到历史最高点73 700美元铺平了道路。 问题仍然是:比特币能否维持预期的上升趋势并继续大幅上升?    分析家预计比特币价格将上升到74,400美元。 加密货币分析师Ali M...
  • 比过山车还狠!比特币价格再次暴跌

    比过山车还狠!比特币价格再次暴跌
      上周日,比特币的价格创造了3000美元的历史新高,随后就开始各种高台跳水了。Last Sunday, the price of Bitcoin created a record high of $3,000, and then began to dive on all the high platforms.   据外媒报道,本周一,比特币价格一度下跌到2526.4美元,最高跌幅高达14.5%,这创造了2015年1月以来最大跌幅。According to external...
  • 几张图看懂区块链技术到底是什么?https://www.cnblogs.com/behindman/p/8873191.html

    几张图看懂区块链技术到底是什么?https://www.cnblogs.com/behindman/p/8873191.html
    “区块链”的概念可以说是异常火爆,好像互联网金融峰会上没人谈一谈区块链技术就out了,BAT以及各大银行还有什么金融机构都在开始自己的区块链研究工作,就连IBM最近也成立了自己的区块链研究实验室,但其实区块链到底是什么?大家或许并不清楚,停留在雾里看花的状态。从今天开始,就让我们一起走进区块链,揭开区块链的神秘面纱吧!The concept of a block chain can be described as an unusually hot one, as if no...
标签列表