Deep understanding of blockchain Technology, From bitcoin, Ethereum to the latest public chain

Original: Andy.Chen 





 

Reading probably needs5 Minute

background


since2008 In the middle of the year, bencong proposed the concept of bitcoin, reach2009 The birth of bitcoin in, This represents the first cryptocurrency implementation based on the decentralized transaction mode of blockchain Technology, At the same time, it has attracted numerous people's attention and focused on blockchain technology.. Let's first understand some concepts here, What is cryptocurrency, Digital currency, electronic money, Virtual currency?

Digital currency: Broad understanding is based on digital technology, Transmission over the network, The carrier of value carrying and transferring in non physical form. It can include electronic money, Virtual currency, Encrypted currency, Digital cash, etc..

Encrypted currency: Technology based on blockchain and encryption, Create over the network, Issue and realize the circulation of electronic money, Cryptocurrency, Like bitcoin. Ether square, etc..

Virtual currency: Untrue currency, Non financial, A digital representation of the value of money issued by a monetary institution as a substitute for money only in Cyberspace, such asQ Coins, etc..


electronic money: Electronic transaction card as media, Through computer communication technology, A currency that is stored in a bank's computer system in the form of an electronic data stream and that can be circulated and paid through a computer network in the form of information transmission.. Like a credit card.IC Card, etc..

 

development history


Before the advent of bitcoin, electronic money had been applied to fund related electronic payment as early as the 1980s and 1990s. But because its core is still based on centralized data management, therefore2009 The emergence of bitcoin in is the first application of blockchain core technology,2013 Year byVitalik
Buterin
Put forward the concept of public chain of Ethereum( Next generation smart contract and decentralized application platform),2017 Launched public chain Star Cloud chain in( Blockchain operating system and search engine based on value scale), Until then2018 YearTrueChain Initial chain( New generation hybrid consensus without license chain) Appear. No matter the introduction of any new public chain, its blockchain core technology will remain unchanged. The basic ideas at the bottom are the same. All areP2P Network node of, Open books, Consensus mechanism algorithm, Decentralized storage.

 

Difference

Let's compare the technical architecture and implementation differences of these public chains.:

*
Design concept

Bitcoin:
( Also known as blockchain1.0 Edition) It is a point-to-point e-cash system based on blockchain, It is developed and designed with the goal of settlement network, Decentralized transactions, storage, It solves the problem of world currency, Due to the lack of protocol scalability in its design, Only later did Ethereum appear.

Official website:https://bitcoin.org/zh_CN/

Ether square:
( Also known as blockchain2.0 Edition) It is an open-source public blockchain platform with smart contract function, Provide decentralized virtual machine through its cryptocurrency, EthernetEVM andSolidity Programming language to handle point-to-point contracts, Ethereum solves the problem of bitcoin's lack of scalability in design, Its goal is to build a new generation of Internet application platform with decentralization. So far, Ethernet is the second highest valued cryptocurrency, Second only to bitcoin.

Official website:https://www.ethereum.org/


TrueChain:  Primary chain strives to create free, To open up, Technology foundation of safe, efficient and easy to use blockchain, Industrial infrastructure, Building business infrastructure of operation system of blockchain economy. Support unlimited node access, High performance(10,000-100,000
TPS), High safety, Free and open rules for users.Truechain Inheriting the virtual machine of Ethereum(EVM) Design ideas of, And expand more, New TVM virtual machine( Be similar to X86
), Multiple development languages can be run in this virtual machine(python,go,javascript etc.) Smart contracts written, Rapid development and deployment of decentralized Dapp application.

Official website:https://www.truechain.pro/zh/

 

*
architecture design


Bitcoin: The architecture is divided into two parts: Part of it is the front end. Including Wallet(Wallet) Or graphical interface; The other part is the daemons running on each node, Including mining, Blockchain management, Script engine and network management. As illustrated:



 


Ether square: The architecture is generally divided into three parts: The top isDApp, It passesWeb3.js Exchange with smart contract layer; The middle layer is the smart contract layer, All smart contracts run onEVM( Ethereum virtual machine) upper, And will be used.RPC Call; stayEVM andRPC Here are the four core contents of Ethereum, Include:blockChain,
Consensus algorithm, Mining and network layer. exceptDApp External, All other parts are in the Ethereum client, At present, the most popular Ethereum client isGeth(Go-Ethereum). As illustrated:



TrueChain:  The technical structure of the primary chain is divided into five layers from the bottom up: First, the underlying services, ContainP2P network,LevelDB
data base, Cryptography algorithm, Slice optimization; Second, core layer, Block chain module included,TRUE Modular, Consensus algorithm module; Three is API Interface layer, Include TVM virtual machine,gRPC
Communication protocol; Fourth, smart contract layer; The five level isDapp layer. As illustrated:



*
Consensus algorithm

Bitcoin:PoW Workload proof mechanism algorithm, When certain workload conditions are met, a block will be generated..

Advantage: Complete decentralization, Free access of nodes, Avoid the cost of establishing and maintaining centralized credit institutions, As long as the computing power of the network destroyer is not more than that of the network50%, The transaction status of the network can be agreed.

shortcoming
: At present, bitcoin mining causes a lot of waste of resources, In addition, the incentive mechanism of mining also causes the high concentration of the calculation force of the ore pool. The bigger problem isPoW The consensus of mechanism takes a long time to reach, Can only do at most per second7 Pen Trading, Probably10 Minutes to generate a block, Not suitable for commercial application.

Ether square: Be based onPoW Consensus mechanism of workload proof algorithm( Mining algorithm)ETHash.

Advantage
: Improve memory level difficulty, Avoid parallel use of memory while calculating multipleNonce value, Reduce the risk of centralization. In addition, Ethereum is alsoPoW The consensus mechanism is gradually transformed intoPoS( Proof of rights and interests) Consensus mechanism.

TrueChain:   Selected will bePBFT Efficient andPoW A hybrid consensus mechanism based on decentralization.fPoW
It is a new design and mining design concept, The primary chain adopts fruit chain(FruitChain) Design, Ensure the fairness of all participants in the mining process.

Advantage: Make up for the previous two generations of blockchain bitcoin and EthereumTPS The disadvantages of too low to be applied to real commercial application development, The contradiction between decentralization and performance.

   

*
Account model

Bitcoin: UseUTXO(unspent transaction
outputs  Unused transaction output) Account model, From a technical point of view, Bitcoin ledger can be considered as a state transition system, The system includes all existing bitcoin ownership States and state transition functions, The state transition function takes the current state and transaction as input, Output to new state.

Bitcoin as a state transition system:



Code:
// UTXO type Transaction struct { //1. transactionhash TxHash []byte //2. input Vins
[]*TXInput //3. output Vouts []*TXOutput }
 

 


Ether square: cancelUTXO Model, Use your own account model, There are two types of accounts in Ethereum: One is for smart contract accountCA( Controlled by contract code), One is forDapp User usedEOA( Private key controlled). By creating and signing a transaction from aEOA Send message to user account, Whenever the contract accountCA Received a message, The code inside the contract will be activated, Allows it to read and write to internal storage, And send other messages or create contracts. No matter which ledger model is used, The core of its transactions at the bottom of the blockchain is actually a process of state object transformation. As shown in the figure, the state transition function of Ethereum:



TrueChain:   Adopt fragment optimization, Divide the world state of blockchain into different“ slice”, each“ slice” All by different PBFT
Committee to deal with, Turn serial processing into parallel processing, So that the performance can be greatly improved..

 

Summary

This article mainly deals with digital currency, Encrypted currency, electronic money, The concept of virtual currency, And the development of blockchain Technology, And the comparison( Blockchain Technology1.0)、
Ether square( Blockchain Technology2.0), Initial chainTrueChain The core technologies of blockchain are compared, I believe you have a new understanding of the whole blockchain technology.. 



In the last article, Some friends added my wechat message to ask me questions, Now take one out to answer.



answer:


1, On Development, I'll answer it in three ways, first, News from the Ministry of industry and information technology the day before yesterday“ China net:2018 In the first half of the year, China's core technologies in the field of information such as blockchain have a good development momentum.”; Second, From the data of recruitment“ Blockchain and cryptocurrency work are growing in Asia
50% Above”, Third, From the perspective of patent application technology( Thomson Reuters): “2017 Published worldwide in 406
Blockchain patents, Yes56% From China”; Fourth, From the perspective of industry, recentlyIBM Announce that it has developed a new payment system based on blockchain Technology. Guotai Junan and Shanghai Stock Exchange, Shenzhen Stock Exchange cooperates to study the application and supervision of blockchain”.

2, How long will it take for blockchain technology to be applied? My personal opinion, From the emergence of bitcoin to Ethereum and now star cloud chain,Truechain
Launch of various public chains, Blockchain technology has become very mature, It can be said that blockchain technology is booming.

3, On the bottleneck, At present, the biggest bottleneck of blockchain technology development is how to improveTPS Problem, To solve the bottleneck problem of blockchain, we should not only consider technology, More consideration should be given to business environment and industry environment.