基于Java开发一套完整的区块链系统(附源码)

资讯 2024-07-12 阅读:17 评论:0
美化布局示例

欧易(OKX)最新版本

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

APP下载   全球官网 大陆官网

币安(Binance)最新版本

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

APP下载   官网地址

火币HTX最新版本

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

APP下载   官网地址

近几年区块链概念越来越火,特别是区块链技术被纳入国家基础设施建设名单后,各大企业也开始招兵买马,对区块链技术进行研究,从各大招聘网站的区块链职位来看,薪资待遇都很不错,月薪30K到80K的都有,这对于我们程序员来说也是一种机遇,说明学习区块链技术刻不容缓。

xff0c; in particular

我个人从2016年就开始在做区块链系统开发的相关工作,最近身边很多朋友都在找我,想让我给他们讲讲区块链技术开发的相关知识,介于此,索性我就手撸了一套简单的java区块链系统,并写了一份详细的开发教程,发布到博客,希望能够对热爱区块链技术的小伙伴学习入门有所帮助。

Personally, I have been working on block chain development since 2016 xff0c; a lot of friends have been looking for me recently xff0c; want me to share with them knowledge about block chain technology development xff0c; between xff0c; soy I've got a simple Java block chain system xff0c; and wrote a detailed development curriculum xff0c; published it to the blog xff0c; and hoped it would help to learn about the entry of small partners who love block chain technology.

这套区块链系统代码非常简洁清晰,对于新手来说非常好理解,旨在告诉大家其实区块链技术并没有那么高深复杂。系统中除了springboot框架外,其他基本都是纯原生开发,就连P2P网络也是用的java socket来实现的。

This block chain system code is very simple and clear xff0c; it's very well understood for newcomers xff0c; it's designed to tell you that block chain technology is not so deep and complex. The system, except for the Springboot framework xff0c; it's basically pure development xff0c; even the P2P network is made possible by java socket.

文末有本文完整源码链接。

There is a full source link to this text at the end of the text.

1、基本概念

(1)区块链

从技术层面来看,区块链是由包含交易信息的区块按照时间顺序从后向前有序链接起来的数据结构。

At the technical level xff0c; the block chain is a data structure from which blocks containing transactional information are linked in chronological order from the point forward.

从应用层面来说,区块链是一个分布式的共享账本和数据库,具有去中心化、不可篡改、全程留痕、集体维护、公开透明等特点。基于这些特点,区块链技术可以开发出自带信任体系特征的系统,实现多个主体之间的协作信任与一致行动。

At the application level, xff0c; block chains are a distributed shared account book and , have decentralized, non-alterable, full-range traces, collective maintenance, transparency features. Based on these characteristics xff0c; block chain technology can develop systems with the characteristics of trust systems xff0c; and achieve collaborative trust and concerted action among multiple subjects.

区块是区块链中的最小组成单位,主要有包含元数据的区块头和存放一条或者多条交易信息的区块体两部分组成,每个区块都记录着当前区块的哈希和上一个区块的哈希,通过两个哈希值的关联,让所有的区块以链式结构串起来,就形成了一个完整的区块链。

Blocks are the smallest constituent unit of the block chain xff0c; they consist mainly of blocks with metadata and two parts of blocks containing one or more transactional information xff0c; each of the blocks records Hashi xff0c of the current block and the previous block xff0c; they link xff0c with two Hashi values; they bind all blocks into a chain structure xff0c; and they form a complete block chain.

区块链中的第一个区块被称作为创世区块,无需关联上一个区块。以BTC网络为例,每个区块主要包含如下信息字段:

The first block in the block chain is referred to as the original block & #xff0c; no connection to the previous block is required. Take the BTC network as an example xff0c; each block contains, inter alia, the following information field xff1a;

  • 区块大小:用字节表示的区块数据大小
  • 区块头:组成区块头的包括以下几个字段: 1. 区块头hash值 2. 父区块头hash值 3. 时间戳:区块产生的近似时间 4. Merkle根:该区块中交易的merkle树根的哈希值 5. 难度目标:该区块工作量证明算法的难度目标 6. Nonce:用于工作量证明算法的计数器
  • 交易计数器:交易的数量
  • 交易:记录在区块里的交易信息

区块链结构的简易模型,如下图所示:

A simple model of the structure of the block chain xff0c; xff1a as shown in the figure below;

区块中的交易集合记录的是一些特定的信息,在BTC网络中主要记录的是交易信息,在其他区块链网络中可以按照业务逻辑来保存相应的业务数据,如审计信息、版权信息、票据信息等,这也是区块链经常用来当做共享账本的原因。

Transactions in blocks are recorded in a pool of specific information xff0c; transactional information xff0c is recorded mainly in the BTC network; corresponding operational data xff0c can be stored in other block chain networks along business logic xff0c; e.g. audit information, copyright information, paper information, etc. xff0c; this is also why block chains are often used as shared accounts.

打个比方,可以把区块链当做一个用来记账的笔记本,一个区块就相当于一页纸,上面记录了某一时间段內所有的账务信息,从第一页到最后一页,按照页码顺序排列起来就是一个完整的账本。

An analogy xff0c; the block chain can be used as a notebook for accounting xff0c; a block is equivalent to a page xff0c; it records all account information xff0c from the first to the last page xff0c; it is a complete account book in the order of the page number.

(2)区块链网络

实际的区块链系统由多个区块链节点组成,每个节点都运行着相同一套区块链主干网络的副本,且各个节点间通过P2P网络进行交互,并最终形成一个完整的区块链网络系统。

The actual block chain system consists of multiple block chain nodes xff0c; each node runs a copy of the main block chain network xff0c; each node interacts through the P2P network xff0c; and ultimately forms a complete block chain network system.

P2P网络具有可靠性、去中心化,以及开放性,各个节点之间交互运作、协同处理,每个节点在对外提供服务的同时也使用网络中其他节点所提供的服务。当某一个区块链节点产生新的区块时,会通过广播的方式告诉其他节点,其他节点通过网络接收到该区块信息时,会对这个区块信息进行验证,当有一定数量的节点都验证通过后,各个节点会把该区块更新到各自现有的区块链上,最终使得整个区块链网络中的各个节点信息保持一致,这也是区块链去中心化、可信任特性的体现。

The P2P network is reliable, decentralized xff0c; and open xff0c; interacts between nodes, co-processing xff0c; each node provides external services while using the services provided by other nodes of the network. xff0c when a block chain nodes produce new blocks xff0c; other nodes are informed by broadcast xff0c; other nodes receive information on the block xff0c through the network; this is validated xff0c; a number of nodes are validated after adoption xff0c; the nodes are updated to their existing nodes xff0c; ultimately, the node information in the entire block chain network is aligned xff0c; this is also a reflection of the centralization and trustable characteristics of the block chain.

区块链网络简易模型,如下图所示:

A simple block chain network model xff0c; xff1a as shown in the figure below;

2、区块链分类

(1)公有链

公有区块链(Public Block Chains)是指:世界上任何个体或者团体都可以发送交易,且交易能够获得该区块链的有效确认,任何人都可以参与使用和维护该区块链,信息公开透明。公有区块链是最早的区块链,例如BTC、以太坊等虚拟数字货币均基于公有区块链。不过目前公有链实际应用价值不大,并没有产生特别合适的应用场景。

The public block chain xff08; Public Block Chains) means xff1a; any individual or group in the world can send a transaction xff0c; and the transaction can obtain effective confirmation of the block chain xff0c; anyone can participate in the use and maintenance of the block chain xff0c; information is transparent. The public block chain is the first xff0c; virtual digital currency such as BTC, in the Tails is based on a public block chain. However, the practical application of the public chain is not of much value xff0c; there is no particularly appropriate application scenario.

(2)联盟链

行业区块链(Consortium Block Chains):由某个群体内部指定多个预选的节点为记账人,每个块的生成由所有的预选节点共同决定(预选节点参与共识过程),其他接入节点可以参与交易,但有权限限制,信息受保护,如银联组织。目前联盟链是各个区块链技术团队主要研究的对象,由于联盟链拥有区块链技术的大部分特征,并且在权限管理、数据安全、监管方面更有优势,是企业优先考虑的区块链技术方案。

The industry block chain & #xff08; Consortium Block Chains & #xff1a; multiple pre-selected nodes are designated within a group as account keepers & #xff0c; each block is generated by a joint decision of all pre-selected nodes & #xff08; pre-selected nodes are involved in the consensus process & #xff09; #xff0c; other access nodes can be involved in the transaction & #xff0c; subject to limitations & #xff0c; information protected #xff0c; e.g., silver union organizations. Alliance chains are currently the main subject of research by technical teams in each block chain #xff0c; most features of the block chain technology because of the union chain #xff0c; and security data of St_ security data;

市面上也有一些比较主流的联盟链技术框架,让开发维护联盟链更加便捷。国内一些大的软件厂商也都有自己的企业区块链技术解决方案,例如蚂蚁金服区块链平台,腾讯的TrustSQL平台,东软的SaCa EchoTrust区块链应用平台以及京东区块链防伪追溯平台等等。

There are also more mainstream union chain technical frameworks & #xff0c; making it easier to develop and maintain the union chain. Some large software manufacturers in the country also have their own business block chain technical solutions & #xff0c; e.g., an ant gold band platform & #xff0c; a trustSQL platform & #xff0c; a SaCa EchoTrust block chain application platform in the soft and soft east, and a pseudo-retrospection platform in the Golden Zone.

(3)私有链

私有区块链(Private Block Chains):仅仅使用区块链的总账技术进行记账,可以是一个公司,也可以是个人,独享该区块链的写入权限,利用区块链的不易篡改特性,把区块链作为账本数据库来使用。

Private block chains & #xff08; Private Block Chains) & #xff1a; account keeping techniques using only block chains & #xff0c; can be a company & #xff0c; can be a person & #xff0c; have exclusive access to the block chain & #xff0c; use block chains for ease of alteration xff0c; use the block chain as an account database.

3、关键技术与特性

(1)共识机制

共识机制被称作为区块链系统的灵魂,是区块链系统信任体系的基础。区块链系统作为一个多节点的分布式账本系统,当有新的信息需要记录时,哪个节点来负责记账,记账奖励发放给哪个节点,哪些节点负责验证记账结果,如何让各个节点达成最终一致,将记账结果被网络中所有节点以同样的顺序复制并记录下来,就是共识机制要做的事情。

The consensus mechanism is called the soul of the block chain system xff0c; it is the basis for the block chain system trust system. The block chain system is a distributed account system xff0c as a multi-point; xff0c when new information is required to be recorded; which node is responsible for recording xff0c; which node xff0c is given as an incentive to account; which node is responsible for validating the account results xff0c; how the node is allowed to reach final agreement xff0c; copying and recording the account results in the same order of all nodes in the network xff0c; that is what the consensus mechanism is supposed to do.

而按照百度百科上的说法:

And according to the encyclopedia, #xff1a.

目前,较为主流的共识算法有PoW、PoS、DPoS、PBFT等,在实际使用时,每种算法都有各自的优点和缺点。在应用于不同场景时,区块链项目将会采用不同的共识机制和算法。

Currently xff0c; the more mainstream consensus algorithms are PoW, PoS, DPOS, PBFT, etc. xff0c; xff0c; each has its own strengths and weaknesses when applied to different scenarios. xff0c; the block chain projects will use different consensus mechanisms and algorithms.

(2)去中心化

去中心化,是互联网发展过程中形成的社会关系形态和内容产生形态,是相对于“中心化”而言的新型网络内容生产过程。在一个分布有众多节点的区块链系统中,每个节点都具有高度自治的特征。任何一个节点都可能成为阶段性的中心,但不具备强制性的中心控制功能。节点与节点之间的影响,会通过网络而形成关联关系。这种开放式、扁平化、平等性的系统现象或结构,我们称之为去中心化。

Decentralization & #xff0c; is the form of social relations and content generation & #xff0c in the context of Internet development; is the process of production of new web content relative to “centralization” & #xff0c in a block chain system with numerous nodes; each node has a highly autonomous character. Any node may become a staged centre & #xff0c; but does not have a mandatory central control function. The influence between nodes and nodes & #xff0c; links are created through the network. This open, flat, egalitarian system phenomenon or structure #xff0c; we call it decentralization.

去中心化的系统具有容错力高、抗攻击力强的特征。中心化的系统一旦中心出现问题,整个系统都会崩溃,但是区块链系统中的任何一个节点出现问题,并不会对整个区块链网络产生太大的影响。

Decentralized systems have faulty and aggressive features. Centralized systems can collapse when problems arise in the centre & #xff0c; the whole system collapses & #xff0c; but there are problems at any node in the block chain system & #xff0c; and they do not disproportionately affect the entire network of block chains.

另外,去中介化并不代表着不接受监管,“去中心化”去的是中央控制方和中介方,而不是监管方。监管节点可以方便地接入任何一个区块链网络。并且由于区块链的公开透明特性,监管机构反而可以更加方便地监控整个系统的交易数据。

Also xff0c; de-intermediated does not mean that regulation is not accepted xff0c; “decentralized” goes to the central control and intermediary xff0c; not to the regulator. Regulatory nodes provide easy access to any network of block chains. And because of the transparent nature of the block chain xff0c; instead, regulators can more easily monitor transaction data across the system.

(3)智能合约

从技术层面讲,智能合约是一段部署在在区块链上的程序代码,当满足程序设定的条件时,它便会在区块链上运行,并得到相应的结果。这种情况有点类似于微信的小程序,区块链提供虚拟机和脚本语言,用户根据脚本语言的语法开发带有一定业务逻辑的程序,部署在区块链上,当满足执行的条件时,智能合约便会被区块链虚拟机解释并运行。

Technically xff0c; smart contract is a program code xff0c deployed on the block chain; xff0c when the conditions set by the program are met; it runs xff0c on the block chain; and the corresponding results are obtained. This situation is somewhat similar to that of a micro-programme xff0c; block chain provides virtual machine and script language xff0c; user develops programs with a certain business logic based on the syntax of the script language xff0c; deployment on the block chain xff0c; xff0c when the conditions for execution are met; intelligent contracts are explained and run by the block chain virtual machine.

典型的应用便是以太坊平台的智能合约,在这个平台里可以支持用户通过简单的几行代码就能实现他们想要的合约,实现无需人为监督的、不可篡改、自动化运行的合约,买卖房子不需要再找中介、借钱不需要再找公证人……人们可以随时随地根据自身需求发起合约,它的执行不依赖某个人和组织,所有的信任完全基于以太坊区块链平台本身。

A typical application is the smart contract xff0c of the Taiwan platform, where users can be supported to achieve what they want through simple lines of code xff0c; a contract xff0c that does not require artificial supervision; a contract that cannot be tampered with, automatedly run xff0c; a house that does not need to be bought or sold by an intermediary or a notary; a contract that can be initiated at any time according to one's own needs xff0c; its implementation is not dependent on a person or organization xff0c; all trust is based solely on the platform of the Tehsi chain itself.

(4)不可篡改性

大部分人习惯称它为不可篡改性,但是从技术层面来说,我个人觉得叫做不可逆转性更贴切,既然是一个计算机系统,增删改查是基本的功能属性,只不过区块链系统删除和修改操作比较特殊一点。

Most people used to call it immutable xff0c; but at the technical level xff0c; I personally thought it was more appropriate to call it irreversible xff0c; since it was a computer system xff0c; the additions and deletions were basic functional properties xff0c; but the removal and modification of the block chain system was more unusual.

区块链是由每个区块的哈希值串连起来的链式结构,而区块的哈希值=SHA256(“当前区块内容+上一个区块的哈希值”),任何一个区块的内容发生修改,都会引起哈希值的变化,而哈希值的变化也会引起子区块哈希值发生变化,进而引起整个区块链的改变。

The block chain is a chain structure that links the Hashi value of each block xff0c; while the Hashi value of the block 61; SHA256 (“Current Block content 43; Hash value of the previous block”) xff0c; changes in the content of any block xff0c; changes in the Hashi value xff0c; changes in the Hashi value xff0c; and subsequent changes in the entire block chain.

因此任何人想要修改区块的数据几乎是不可能的,除非他把整个区块链中从创世区块到最新的区块的所有哈希值全部重新修改一遍,并且修改完之后,还得广播告诉网络中的其他所有节点,让其他所有节点接受修改。

It is therefore almost impossible for anyone to change the data on blocks xff0c; unless he re-modifies all the hash values in the entire block chain, from the original block to the latest block xff0c; and after the change has been completed xff0c; and broadcasts all the other nodes in the network xff0c; and lets all the other nodes accept the change.

不过按照目前计算机的算力,想要在短时间内从区块链头部到尾部全部修改一遍,是一件非常困难的事,并且即使修改完了,其他节点也不会接受修改,因为凭一己之力,没有能够让所有节点达成共识的条件。

However, based on the computing power of the current computer xff0c; the desire to modify all of xff0c from the head to the end of the block chain within a short period of time xff0c; a very difficult task xff0c; and the fact that other nodes would not accept the modification xff0c; because xff0c by its own means xff0c; and there were no conditions under which consensus could be reached on all nodes.

4、流行的区块链框架与应用

(1)公有链应用:BTC网络

区块链1.0产品,对于比特币,中本聪是这样定义的:是一种完全通过点对点技术实现的电子现金系统,它使得在线支付能够直接由一方发起并支付给另外一方,中间不需要通过任何的金融机构。

Block chain 1.0 product & #xff0c; in the case of Bitcoin & #xff0c; xff1a, defined as x6a; an electronic cash system fully achieved through point-to-point technology xff0c; it enables online payments to be initiated directly by one party and paid to the other xff0c; and there is no need to pass through any financial institution in the middle.

与所有的货币不同,比特币不依靠特定货币机构发行,它依据特定算法,通过大量的计算产生,比特币经济使用整个P2P网络中众多节点构成的分布式数据库来确认并记录所有的交易行为,并使用密码学的设计来确保货币流通各个环节安全性。之后人们根据比特币网络技术整理出了区块链技术体系,去解决信任的问题,而比特币网络原理也成为了区块链技术初学者的经典教材。

Unlike all currencies xff0c; Bitcoin does not rely on a specific monetary institution to issue xff0c; it is based on a specific algorithm xff0c; it produces xff0c by a large number of calculations; the Bitcoin economy uses distributed databases consisting of numerous nodes in the entire P2P network to confirm and record all transactions xff0c; and the cryptography design is used to ensure the security of the various links in the currency flow.

(2)公有链应用:以太坊网络

区块链2.0产品的代表,以太坊是一个为去中心化应用(Dapp)而生的开源区块链平台,拥有着大部分区块链技术的特征,但与其它区块链不同的是,以太坊是可编程的,开发者可以用它来构建不同的应用程序,通过其专用加密货币以太币(简称“ETH”)提供去中心化的以太虚拟机(Ethereum Virtual Machine)来处理点对点合约(就是一些脚本程序代码)。如果把比特币网络看作是一套分布式的数据库,而以太坊则更进一步,它可以看作是一台分布式的计算机:区块链是计算机的ROM,合约是程序,而以太坊的矿工们则负责计算,担任CPU的角色。

xff0c, representative of the block chain 2.0 product; xff08; xff09; xff09; xff0c; characteristic of most block chain technology; xff0c; but xff0c, unlike other block chains; xff0c, representative of the block chain 2.0 product; developer can use it to construct different applications xff0c; xff0c, via its dedicated encrypted currency, xff08; H xff09; provide decentralized technology to xff08; Etherium Virtual Machine #xff09; handle point-to-point contracts xff08; some script code xff09; if the bit currency network is considered to be a distributed database xff0c; x px x ;

以太坊的概念首次在2013至2014年间由程序员Vitalik Buterin受比特币启发后提出,大意为“下一代加密货币与去中心化应用平台”。虽然以太坊作为平台可以在其上开发新的应用,但是由于以太坊的运行和BTC网络一样,采用的是Token机制,且平台性能不足,经常出现网络拥堵的情况,平台用来学习开发与测试区块链技术还可以,用于实际生产的话不太现实。

For the first time between 2013 and 2014, Vitalik Buterin, a programmer inspired by Bitcoin, presented xff0c; to the effect that xff0c is “the next generation of encrypted currency and decentralised application platforms”. Although the portal can be used as a platform to develop new applications xff0c; but because it operates like the BTC network xff0c; the Token mechanism xff0c; the platform lacks xff0c; web congestion xff0c; the platform can also be used to learn to develop and test block chain technology xff0c; and it is not very realistic for actual production.

(3)联盟链开发框架:Hyperledger Fabric

Hyperledger Fabric 也叫超级账本,它是 IBM 贡献给 Linux 基金会的商用分布式账本,是面向企业应用的全球最大的分布式开源项目。像其他区块链技术一样,它也有一个账本,可以使用智能合约。Fabric的智能合约可以有多种架构,它可以用主流语言编程,例如Go、Java和Javascript,此外也可以使用Solidity。

Hyperledger Fabric is also called Superbook & #xff0c; it is the IBM commercial distribution book for Linux Foundation & #xff0c; it is the largest global distribution open source project for enterprise applications. Like other block chain technology & #xff0c; it also has an account book & #xff0c; it can use smart contracts. Fabric's smart contract can have multiple structures xff0c; it can be programmed in mainstream languages xff0c; for example, Go, Java and Javascript #xff0c; it can also use Solidity.

至今,Fabric已获得了阿里巴巴、AWS、Azure、百度、谷歌、华为、IBM、甲骨文、腾讯等互联网巨头的支持。许多企业的区块链平台都把Fabric作为底层框架来使用,例如甲骨文。不过由于IBM对区块链的定义强调了区块链的分布式和不可变两个元素,对共识机制进行了削弱,采用了Kafka和zookeeper的“排序服务”实现共识,因此部分业内人士也称超级账本是“伪区块链”,但是即便如此,也抵挡不了企业对超级账本的喜爱,目前Fabric 2.0版本已经正式发布。

To date, xff0c; Fabric has been supported by Internet giants such as Alibaba, AWS, Azure, Peak, Google, Hua, IBM, Oracle, Tetsu, etc. Many firms’ block-chain platforms use Fabric as a base frame for the use of xff0c; for example, Oracle. However, the IBM definition of block chains emphasizes the distribution of block chains and non-variable elements xff0c; the consensus mechanism has been weakened xff0c; the “sortization service” of Kafka and zookeper has been adopted to achieve consensus xff0c; thus, some industry members have called the super-accounts “fake chain” xff0c; even so xff0c; it does not resist the enterprise's love of super-accounts xff0c; currently version Fabric 2.0 has been officially released.

(4)小结

目前公有链在实际应用中并没有太多的业务场景落地,大部分都是以挖矿为主题或者线上宠物饲养的游戏为主,并且由于数字货币的匿名性,有些不法分子利用这一特点,将数字货币用于洗钱、暗网买卖等违法行为,是各个国家的打击对象,我国政策法规也严厉禁止,因此对于技术人员来说,公有链可以作为研究学习的对象,其他方面暂时没有太多实际意义。

At present, the public chain does not have much of a business scene in its practical application xff0c; most of the games are xff0c, which are mainly concerned with mining or on-line pet-breeding; and because of the anonymity of digital money xff0c; some outlaws use this feature xff0c; the use of digital money for offences such as money-laundering, black-net trading xff0c; the targeting of individual countries xff0c; our policy regulations also severely prohibit xff0c; thus xff0c for technicians; public chains can be the subject of study xff0c; and others are for the time being of little practical significance.

目前大部分区块链企业的研究方向主要是针对企业的联盟链和私有链,并且国家层面也在大力支持区块链技术的发展,特别是区块链底层核心技术的研发,倡导把区块链作为核心技术自主创新的重要突破口,明确主攻方向,加大投入力度,着力攻克一批关键核心技术,加快推动区块链技术和产业创新发展。不过现在市面上主流的区块链平台大部分还是以国外公司主导的为主,国内区块链底层核心技术的发展,还需要技术人员的加倍努力。

Most of the block chain enterprises are currently directed towards the alliance and private chain xff0c; and there is strong support at the national level for the development of block chain technology xff0c; in particular, the development of block chain core technology xff0c; the promotion of block chains as an important entry point for core technology-owned innovation xff0c; the clear direction of the main attack xff0c; the intensification of inputs xff0c; the focus on key core technologies xff0c; and the acceleration of technological and industrial innovation in block chains. However, most of the sector chain platforms that are now in the market are still dominated by foreign firms ff0c; the development of core technologies at the bottom of the domestic block chain #xff0c; and the need for additional efforts by technical personnel.

1、区块链技术架构

目前主流的区块链技术架构主要分为五层,数据层是最底层的技术,主要实现了数据存储、账户信息、交易信息等模块,数据存储主要基于Merkle树,通过区块的方式和链式结构实现,而账户和交易基于数字签名、哈希函数和非对称加密技术等多种密码学算法和技术,来保证区块链中数据的安全性。

The current mainstream block chain technical architecture is mainly divided into five layers xff0c; the data layer is the lowest technology xff0c; modules such as data storage, account information, transaction information, etc. xff0c are achieved; data storage is based mainly on Merkle Tree xff0c; xff0c is achieved by block approach and chain structure; and accounts and transactions are based on multiple cryptography algorithms and techniques such as digital signature, Hashi function and non-symmetric encryption technology xff0c; and data security in block chains is ensured.

网络层主要实现网络节点的连接和通讯,又称点对点技术,各个区块链节点通过网络进行通信。共识层是通过共识算法,让网络中的各个节点对全网所有的区块数据真实性正确性达成一致,防止出现拜占庭攻击、51攻击等区块链共识算法攻击。

The network level primarily achieves connection and communication of network nodes xff0c; also known as point-to-point technology xff0c; communication of block chain nodes via the network. The consensus level is through consensus algorithms xff0c; allows the network nodes to agree on the correctness of data on all blocks on the entire network xff0c; and prevents the emergence of sector node consensus algorithms such as Byzantine attacks and 51 attacks.

激励层主要是实现区块链代币的发行和分配机制,是公有链的范畴,我们不做分析。应用层一般把区块链系统作为一个平台,在平台之上实现一些去中心化的应用程序或者智能合约,平台提供运行这些应用的虚拟机。

The incentive layer is primarily the mechanism for the issuance and distribution of block chain tokens & #xff0c; the scope of the public chain & #xff0c; we do not do analysis. The application layer typically uses block chain systems as a platform & #xff0c; some decentralized applications or smart contracts on the platform & #xff0c; the platform provides virtual machines to run these applications.

接下来我们基于Java语言来开发一套小型的区块链系统,来实现数据层、网络层、共识层的一些功能,用简单的代码来直观抽象的概念,以便加深对以上区块链技术基础理论的理解。

Next, we develop a small block chain system based on Java language & #xff0c; achieve some of the functions of the data layer, network layer, consensus layer & #xff0c; visualize abstract concepts & #xff0c with simple codes; in order to deepen understanding of the underlying technical theory of the block chain above.

2、基于java的区块链开发实战

(1)开发环境

开发工具

Develop Tools

VSCode

开发语言

Development of languages

Java

JDK版本

JDK version

JDK1.8或者OpenJDK11

JDK 1.8 or OpenJDK11

开发框架

Development framework

SpringBoot2.2.1

工程管理

Engineering management

Maven3.6

测试工具

Test Tool

Postman

(2)区块链基本模型构建

区块是区块链系统的最小单元,第一步我们先实现最简单的区块结构,新建Block.java类,主要包含以下几个字段: Block.java

Blocks are the smallest unit of the block chain system xff0c; the first step is to achieve the simplest block structure xff0c; new Block.java class xff0c; mainly containing the following fields xff1a; Block.java

 

区块链是由区块按照区块哈希前后顺序串联起来的数据结构,哈希值通过散列算法对区块进行二次哈希计算而得到的数字摘要信息(不了解散列函数的,可以先百度了解一下SHA算法),用于保证区块的信息安全以及整条区块链的有效性。因此第二步我们新增计算区块Hash值的方法,采用SHA256算法,通过java实现: CryptoUtil.java

The block chain is the data structure of blocks in sequence of blocks xff0c; numerical summary information xff08 obtained by the Hashi value using the hash algorithm for the secondary Hashi calculation of blocks xff08; xff0c for the disassembly function xff09; xff0c; 100-degree knowledge of the SHA algorithm xff09; xff0c; information security of blocks and the validity of the entire chain of blocks.

 

第三步,创建一个链式结构对象,按照先后顺序来保存区块对象,从来形成一个有序的区块链表,考虑到线程安全问题,采用CopyOnWriteArrayList来实现,为了方便测试,暂且把区块链结构保存在本地缓存中,实际的区块链网络最终会实现持久层的功能,把区块链数据保存至数据库中,例如BTC核心网络采用的是K-V数据库LevelDB: BlockCache.java

Step 3 xff0c; creation of a chain structure object xff0c; preservation of block objects xff0c in order of order; generation of an orderly block chain table xff0c; consideration of linear security xff0c; implementation of xff0c using CopyOnWriteArraylist; testing xff0c; temporary preservation of block chain structures in local caches xff0c; actual block chain network eventually achieves the function of a persistent layer xff0c; preservation of block chain data in a database xff0c; for example, the BTC core network uses the K-V database LevelDB xff1a; BlockCache.java

 

第四步,有了区块链结构后,需要新增向区块链中添加区块的方法,同时每次添加区块的时候,我们需要验证新区块的有效性,例如Hash值是否正确,新区块中上一区块的Hash属性的值,与上一区块的Hash值是否相等。

Step 4 xff0c; with block chain structure xff0c; with additional blocks xff0c; with each block added xff0c; we need to verify the validity of the new block xff0c; e.g., the Hash value is correct xff0c; the value of the Hash properties of the previous block xff0c in the new block is equal to the Hash value of the previous block.

另外,区块链中必须有个创世区块,我们直接通过硬编码实现: BlockService.java

And xff0c; there must be a creative block in the chain of blocks xff0c; we do it directly by hard code: BlockService.java

 

以上关键代码实现之后,我们就构建了一个非常简单的区块链模型,包含一个基本的区块模型和一个区块链模型,并且能够生成新的区块并添加到区块链中,接下来我们进行测试。

xff0c; we built a very simple block chain model xff0c; we included a basic block model and a block chain model xff0c; and we were able to generate new blocks and add them to the block chain xff0c; we then tested them.

第五步,我们编写一个Controller类进行调用: BlockController.java

Step 5 #xff0c; we're preparing a Controller for call #xff1a; BlockController.java

 

第六步,系统测试 首先系统启动后,先查看区块链中的数据,可以看到当前系统中的区块链为空:

Step 6 xff0c; system testing xff0c after system start-up; first looking at data in block chains xff0c; you can see that the block chain in the current system is empty xff1a;

然后我们调用创建创世区块的方法,查看返回结果:

Then we call the method of creating the creation block & #xff0c; view the return result & #xff1a;

我们把生成的创世区块添加到本地区块链中后,转换成JSON字符串返回,可以看到当前区块链中存储的有一个区块对象,至此我们已经实现了一个简单的区块链。实际的区块链系统模型要复杂的多,需要根据不同的业务场景扩展相应的字段,但是基本特征都是一样的。

We add the creation blocks to the local chain xff0c; convert them to JSON string returns xff0c; see that one block object xff0c is stored in the current block chain; so we have achieved a simple block chain. The actual block chain model is complex and multiple xff0c; the corresponding field xff0c needs to be expanded according to different business scenes; but the basic features are the same.

(3)共识机制实现

在上章节中,我们实现了一个简单的区块链结构,并且能够生成并添加新的区块,但是问题来了,实际的区块链系统是一个多节点、分布式、去中心化的网络,每个节点通过网络交互,实时同步保存着同样的整条区块链数据,那么我们生成的区块,如何才能被其他节点认可,并同步添加到其他所有节点上呢,这个时候我们就需要一套规则,让所有网络节点的参与者达成能够达成共识,接纳并保存新的区块,也就是所谓的“共识机制”。

In the previous chapter, xff0c; we achieved a simple block chain structure xff0c; and we were able to generate and add new blocks xff0c; but the problem arose xff0c; the actual block chain system was a multi-node, distributed, decentralized network xff0c; each node was interactive through the network xff0c; the same whole block chain data was kept in real time xff0c; then we generated blocks xff0c; how other nodes could be endorsed xff0c; and synchronized to all other nodes xff0c; at this time we needed a set of rules xff0c; allowed participants in all nodes to reach consensus xff0c; accepted and preserved new blocks xff0c; so-called “consensus mechanism”.

理论基础部分已经提到了,共识机制有很多种,各有各的优势与缺点,接下来我们就用java代码来模拟实现我们最为熟知的一种机制:工作量证明(Proof of Work),顾名思义就是对工作量的证明,在基于POW机制构建的区块链网络中,节点通过计算随机哈希散列的数值争夺记账权,求得正确的数值并生成区块的能力是节点算力的具体表现,计算的过程一般被形象地称为“挖矿”。

The theoretical foundation already refers to xff0c; the consensus mechanism has many xff0cs; each has strengths and weaknesses xff0c; we then use the java code to simulate a mechanism that we know best xff1a; workload proof xff08; Proof of Work) xff0c; by definition, proof of workload xff0c; in a network of blocks based on the Pow mechanism xff0c; nodes to compete for accounting rights by calculating random Hashishites xff0c; the ability to get the correct values and generate blocks is a concrete performance of the node #xff0c; and the calculation process is generally called “mining”.

简单来说就是,区块链系统设定一套计算规则或者说是一套计算题,在新区块生成前,各个节点都投入到这道题的求解计算中,哪个节点先计算出结果,并得到其它节点的验证和认可,这个节点就会获得新区块的记账权,并获得系统相应的奖励,共识结束。

Simplely xff0c; block chain systems set a set of calculation rules or a set of calculation xff0c; xff0c before a new block is created; xff0c; xff0c; which node first calculates the result xff0c; validated and endorsed by other nodes xff0c; this node will be given the right to account for the new block xff0c; and the system will be rewarded xff0c; and the consensus will be concluded.

典型的PoW共识机制应用就是BTC网络,在BTC网络中,共识计算的目标是找到满足某个特定要求的区块Hash(哈希值)。这个区块哈希值就是工作结果的一个证明,计算工作的目的就是为了寻找到这个证明值,上一章节中,测试时我们已经见过这个Hash值:

The typical PoW consensus application is the BTC network & #xff0c; in the BTC network & #xff0c; the consensus calculation is to find the Hash( the Hashi value & #xff09; and the Hashi value is a proof of the results of the work & #xff0c; the purpose of the calculation is to find this certificate value xff0c; in the previous section xff0c; we have already seen this Hash value xff1a;

 

BTC网络PoW使用的Hashcash算法,大致逻辑如下:

Hashcash algorithm & #xff0c for BTC network PoW; the approximate logic is as follows & #xff1a;

  1. 获取某种公开可知的数据data(BTC网络中,指的是区块头);
  2. 添加一个计数器nonce,初始值设置为0;
  3. 计算data与nonce拼接字符串的哈希值;
  4. 检查上一步的哈希值是否满足某个条件,满足则停止计算,不满足则nonce加1,然后重复第3步和第4步,直到满足这个特定的条件为止。

接下来我们用Java代码实现这个算法,设定满足的特定条件为,Hash值前4位都是0,则计算成功(实际区块链网络中的特定条件要求更高,对计算的运算能力要求也高,并且系统随着计算难度动态调整满足的特定条件,来保证区块生成的速度)。

Next, we use Java codes to achieve this algorithm xff0c; set specific conditions to be met xff0c; calculated success xff0c; calculated success xff08; specified conditions in the actual block chain network are higher xff0c; calculated capacity requirements are also high xff0c; and the system adjusts to meet specific conditions xff0c; ensures the speed of block generation xff09;

第一步,我们新建一个共识机制服务类,添加一个“挖矿”方法,计算成功后,获取记账权,调用添加区块的方法,把区块添加到区块链中: PowService.java

Step 1 xff0c; we create a new consensus mechanism service category xff0c; add a “mining” method xff0c; xff0c after calculation; get rights to bookkeeping xff0c; call blocks xff0c; add blocks to the block chain xff1a; PowerService.java

 

第二步,编写测试共识机制服务的Controller类方法: BlockController.java

Step 2 & #xff0c; development of Controller-type methodology for testing consensus mechanism services & #xff1a; BlockController.java

 

第三步,启动系统,进行测试。 首先执行http://localhost:8080/create方法,生成创世区块。 其次调用http://localhost:8080/mine方法进行工作量计算证明,生成新的区块,并添加到本地区块链中:

Step 3 & #xff0c; start-up system & #xff0c; perform tests. First, implement http://localhost:8080/create methodology , generate creation blocks. Second, call http://localhost:8080/mine methodology for workload calculation certification , generate new blocks #xff0c; and add to the local chain xff1a;

我们来看一下,系统后台计算的过程,此次计算共花费1048ms计算出满足条件的Hash值,共计算4850次:

Let's take a look at xff0c; the system's back-office calculation xff0c; this calculation cost a total of 1048 ms to calculate the xff0c which meets the conditions; 4850 xff1a;

至此,我们实现了一个简单的工作量证明机制,并在当前区块链系统节点上运行,完成了正确结果的计算,生成了一个新的区块。

xff0c; we have achieved a simple workload certification mechanism xff0c; run xff0c on the current block chain system node; have completed the calculation of the correct results xff0c; and have generated a new block.

接下来我们将会开发一个P2P网络,实现多个节点的同时运行,当一个节点挖矿完成后,通过P2P网络广播给其他节点,其他节点验证通过后,会把新产生的区块添加到自己的区块链上,进而保证整个区块链网络所有节点的数据一致性。

Next, we will develop a P2P network & #xff0c; run xff0c while achieving multiple nodes; xff0c when one node is excavated; broadcast to other nodes xff0c via the P2P network; xff0c after validation by other nodes; add newly created blocks to its own block chain xff0c; and thus ensure data consistency across the entire block chain network.

(4)P2P网络开发

前面我们已经实现了一个基本的区块链系统,并且实现了PoW工作量证明共识机制,通过挖矿计算出正确的结果同时生成一个新的区块添加到区块链中,但是这些都是基于单节点的运行,实际的区块链是有多个节点同时运行的分布式网络系统,所有节点同时计算抢夺记账权,共同维护一条完整的区块链。

We have already achieved a basic block chain system & #xff0c; and the PoW Workload Certification Consensus Mechanism & #xff0c; the correct result is calculated by excavating a new block to be added to the block chain & #xff0c; these are, however, run on the basis of a single node & #xff0c; the actual block chain is a distributed network system running simultaneously at multiple nodes & #xff0c; all nodes compute seizure rights at the same time #xff0c; and jointly maintain a complete block chain.

接下来我们基于Java的WebSocket实现一个Peer-to-Peer网络,实现多个节点间的相互通信,通过本章节,我们将要实现以下功能:

We then move on to WebSocket, based on Java, to achieve a Peer-to-Peer network & #xff0c; to achieve communication between multiple nodes xff0c; to adopt this chapter xff0c; we will achieve the following functions xff1a;

 

开发测试本章节的功能,我们最好准备两台电脑或者虚拟机,再或者Docker集群环境也可以,便于多节点的运行测试。如果只有一台电脑也可以,各个节点运行的端口号设置为不相同即可。

Develops the functionality of this chapter & #xff0c; we better prepare two computers or virtual machines & #xff0c; or the Docker cluster environment can also & #xff0c; allow for multi-point running tests. If only one computer can & #xff0c; the port numbers running at each node are different.

第一步,开发思路整理 目前我们已经实现了单节点的区块生成,那么我们接下来只需要实现各个节点的消息同步即可。

Step one #xff0c; develop a sort of idea that we have now achieved single nodes #xff0c; then we just need to synchronize the messages for each node.

  • 首先,通过java代码实现p2p网络的server端和client端,每个节点既是服务端也是客户端。
  • 然后,一个节点启动时,会寻找区块链网络上的有效节点,并建立socket连接(BTC网络可以通过使用“DNS”种子方式获取BTC有效节点,DNS种子提供比特币节点的IP地址列表),我们直接把节点列表配置到application.yml文件中。
  • 接着,从连接上的节点获取最新的区块信息,如果当前节点首次运行,则获取整个区块链信息,并替换到本地。
  • 之后,各个节点同时挖矿计算,哪个节点先计算完成,就把生成的新区块全网广播给其他所有节点(实际的区块链网络一直在计算,我们为了便于测试,手动触发一个节点挖矿产生区块,然后全网广播给其他所有节点)。
  • 最后,当一个节点收到广播内容后,对接收到的新区块进行验证,验证通过后添加到本地区块链上,验证的首要条件是新区块的高度必须比本地的区块链高度要高。

第二步,先实现P2P网络server端 新建一个P2PServer类,并添加一个初始化server端的方法: P2PServer.java

Step 2 & #xff0c; achieve P2P network server end first New P2PServer class & #xff0c; add an initial server end method & #xff1a; P2PServer.java

 

第三步,实现P2P网络client端 P2PClient.java

Step 3 #xff0c; achieve P2P network cliet end P2PCliet.java

 

第四步,定义P2P网络同步的消息模型 同步的消息模型,我们定义为四类,分别是: BlockConstant.java

Step 4 & #xff0c; defining a message model for the P2P network synchronisation & #xff0c; defining four categories & #xff0c; & #xff1a; BlockConstant.java

 

定义一个各个节点间传递的消息模型: Message.java

Defines a message model from one node to the next & #xff1a; Message.java

 

第五步,实现向其他节点广播的方法

Step 5 #xff0c; means of achieving broadcast to other nodes

新建一个p2p网络服务类,向外发送消息,或者处理当前节点收到其他节点发送的请求。 P2PService.java

New p2p web service class xff0c; sending out messages xff0c; or processing requests received from other nodes at the current node. P2Pservice.java

 

第六步,开发消息处理路由

Step 6 & #xff0c; development of message processing routes

第五步中已经实现了向外发送消息,本步骤实现接收消息。 首先设计一个服务端和客户端共用的消息路由,来分发消息给对应的处理单元。 P2PService.java

Step 5 has already achieved out-posting of messages & #xff0c; this step achieves reception of messages. First, design a common routing of messages between the service and the client & #xff0c; distribute messages to the corresponding processing module. P2Pservice.java

 

第七步,开发消息处理单元

Step 7 & #xff0c; development of message processing modules

有了消息路由之后,接着编写不同的处理单元,处理其他节点发送来的区块或者区块链信息,总体原则是:先校验其他节点发送来的区块或者区块链的有效性,然后判断它们的高度比当前节点的区块链高度要高,如果高则替换本地的区块链,或者把新区块添加到本地区块链上。 P2PService.java

xff0c after the source of the message xff0c; followed by the preparation of different processing units xff0c; processed block or block chain information from other nodes xff0c; the general principle was xff1a; verified the validity of block or block chain from other nodes xff0c; then determined that their altitude was higher than the current node chain xff0c; replaced local block chain xff0c if high; or added new blocks to the area chain.P2Pservice.javava.

 

3、完整系统运行与测试

第一步,打包生成测试用的可执行jar包 准备两台机器(虚拟机或者Docker集群都行),同时运行两个节点,节点信息如下:

Step 1 & #xff0c; executable jar packages for packing generation tests Preparation of two machines & #xff08; virtual machines or Docker clusters & #xff09; & #xff0c; running two nodes & #xff0c simultaneously; node information & #xff1a;

通过mvn package -Dmaven.test.skip=true命令对工程进行打包,生成可直接运行的jar包,打包前对工程进行配置,配置信息如下图:

xff0c by mvn package -Dmaven.test.skip= true command to package the project xff0c; generate a directly operational jar package xff0c; configure the project xff0c prior to packing; configure information xff1a below;

节点Node1打包:

Node1 Pack & #xff1a;

节点Node2打包:

Node2 packing #xff1a;

分别打包之后,生成两个节点的可执行jar包,如下:

xff0c after packing separately; executable jar package xff0c generating two nodes; xff1a below;

把两个jar包分别放在对应IP的windows机器上,打开命令行模式,进入jar所在文件夹,分别执行以下命令运行两个节点: java -jar dce-blockchain-node1.jar java -jar dce-blockchain-node2.jar

Put the two jar bags on the same machine & #xff0c; open command line mode & #xff0c; enter the jar folder & #xff0c; run the two nodes & #xff1a; java -jar dce-blockchain-node1. java -jar dce-blockchai-node2.jar

启动节点2的时候,可以看到后台日志,已经连接上节点1,如下图所示:

Start node 2 & #xff0c; background log & #xff0c can be seen; links to top node 1 & #xff0c; xff1a as shown in the figure below;

第二步,对两个节点进行测试

Step 2 & #xff0c; testing of two nodes

首先,两个节点启动后,用postman分别执行http://192.168.0.104:8080/scan和http://192.168.0.112:8090/scan请求,可以看到两个节点的区块链内容都为空。

First xff0c; xff0c after the start of two nodes; execution by postman at http://192.168.104:8080/scan and http://192.168.112:8090/scan request xff0c; see that the content of the block chain at both nodes is empty.

然后,在节点1上分别执行http://192.168.0.104:8080/create和http://192.168.0.104:8080/mine请求,来生成创世区块,以及通过挖矿产生第二个区块,执行后查看节点1的区块链信息如下: 执行http://192.168.0.104:8080/scan结果:

xff0c; implementation at node 1 of http://192.168.104:80800/create and http://192.168.104:80800/mine request xff0c; creation of creation blocks xff0c; generation of a second block xff0c through mining; post-implementation viewing of node 1 of the chain of blocks as xff1a; implementation of http://192.168.104:808080/scan result xff1a;

 

最后,我们来验证节点2是否已经完成了节点1生成的区块链信息的网络同步,Postman执行http://192.168.0.112:8090/scan请求,查看返回结果:

Finally xff0c; we have come to verify that node 2 has completed the network sync of block chain information generated by node 1 xff0c; Postman executes http://192.168.112:8090/scan request xff0c; see return results xff1a;

从结果可以看到,区块链网络节点2已经接收到节点1发送的区块链信息,系统日志如下:

From the results, it can be seen that xff0c; that node 2 of the block chain network has been received for the block chain information sent by node 1 xff0c; that the system logs as xff1a;

反过来,我们在节点2上再执行一次挖矿操作,可以看到节点1上,已经接收到节点2挖矿新产生的区块信息,并添加到节点1的区块链上:

Conversely, xff0c; we perform another mining operation at node 2 xff0c; see node 1 xff0c; have received information on newly generated blocks at node 2 xff0c; and have been added to the block chain at node 1 xff1a;

至此,我们已经实现了一个完整的小型区块链网络,并实现各个节点间的通信,多个节点共同维护同一个区块链信息。

To this end xff0c; we have achieved a complete network of small block chains xff0c; we have achieved communication between nodes xff0c; multiple nodes jointly maintain the same block chain information.

结语: 区块链系统非常庞大,涉及方方面面的技术,本人所演示的代码主要对区块链基础的一些概念进行了诠释,感兴趣的同学,还可以在此基础上继续开发,来实现例如持久层、消息的加密解密、系统账户模型、预言机、侧链技术以及智能合约等区块链系统功能。

xff1a; The block chain system is very large xff0c; technology involving various aspects xff0c; the code that I have demonstrated mainly interprets some of the concepts underlying the block chain xff0c; interested classmates xff0c; it can also continue to develop xff0c on this basis; and it fulfils the functions of block chain systems such as persistent layers, encryption of messages, system account models, predictors, side chain technology and smart contracts.


写给每个区块链技术人员: 目前市面上流行的企业级区块链框架,例如超级账本Fabric都是国外人员在主导,而我们国内除了几家大厂外,其他很多区块链公司基本都是把人家的东西拿过来进行二次封装,然后对外声称自己公司已经掌握了区块链核心技术,并对企业提供服务,这是一种不好的现象。大家可以想想我们现在用的开发语言、框架有几个真正是国产的,我们再联想一下前段时间中兴、华为被人家核心技术卡脖子事件,就知道我们要做的事情有很多,我们需要去除浮躁,静下心来好好研究底层核心技术,这样才能实现真正的“弯道超车”!

Write to each block chain technician xff1a; now popular on the market xff0c; for example, Fabric, a superbook, is dominated by foreign nationals xff0c; and many other block chains in our country, apart from several major factories, are basically to bring people's things over for a second wrapping xff0c; then claim that they already have xff0c; and provide services to businesses xff0c; this is a bad thing. You can think about the development language we're now using, and that there are several truly national xff0cs; let's think about the #xff0cs that have been stuck to the core technology during the previous period; we know that we have a lot to do xff0c; we need to take care of the bottom core technology xff0c; we need to be quiet to study the bottom xff0c; in order to achieve a true “drawling” #xff01;

本文完整源代码地址:

This text has a full source address & #xff1a;

https://gitee.com/luckytuan/dce-blockchain

PS:如果觉得我的分享不错,欢迎大家随手点赞、在看。

PS: if you think my share is good #xff0c; welcome to cheer up and watch.

美化布局示例

欧易(OKX)最新版本

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

APP下载   全球官网 大陆官网

币安(Binance)最新版本

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

APP下载   官网地址

火币HTX最新版本

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

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

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

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

分享:

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

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

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 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...
  • 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)汇率更新时...
  • 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...
  • 币圈院士:5.20比特币(BTC)以太坊(ETH)行情分析

    币圈院士:5.20比特币(BTC)以太坊(ETH)行情分析
    利空出尽?华尔街多头坚信美股将摆脱泥潭 经济衰退风险被夸大A lot of people on Wall Street believe that beauty will escape the quagmire; the risk of recession is exaggerated. 从目前美国经济的情况加上美股先有的走势来判断,确信通胀已经或即将见顶,这为价格压力回落铺平了道路,这最终将使美联储得以放缓...
  • 2000年美国GDP占世界的304%,中国GDP仅占35%,现在呢?

    2000年美国GDP占世界的304%,中国GDP仅占35%,现在呢?
    GDP作为全球公认的实力基准,就像是一个大国实力的代言人,它是布雷顿森林体系下全球团结的声音。它不仅仅是数字的累积,更是大国综合实力的人格化,默默诉说着每个国家的辉煌与荣耀。虽然GDP不是衡量一个国家综合实力的唯一标准,但无疑是最关键的指标之一。作为一面镜子,它反映了国家的经济实力和发展水平,是国家综合实力的重要体现,不容忽视。2000年,中国GDP迈过/克洛克-0/万亿美元的重要门槛,达到/克洛克-0/。2/克洛克-0/万亿美元(折合人民币7。7万亿元)。然而,在全球经济的...
标签列表