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

original : Andy.Chen 


Reading probably takes 5 minute


since 2008 In the middle of the year, Ben Tsung proposed the concept of bitcoin , reach 2009 The birth of bitcoin , This represents the first implementation of cryptocurrency based on the decentralized transaction mode of blockchain technology , At the same time, it has attracted the attention of countless people, focusing on blockchain technology . Here, let's first understand a few concepts , What is cryptocurrency , Digital currency , electronic money , Virtual currency ?

Digital currency : Widely understood 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 , Cryptocurrency , Digital cash, etc .

Cryptocurrency : Based on blockchain and encryption operation technology , Create through the network , Issuing and circulating electronic currency , Cryptocurrency , Like bitcoin , Ethereum, etc .

Virtual currency : Unreal currency , Right and wrong Finance , A numerical representation of the value of currency substitutes issued by monetary institutions that are used only in cyberspace , such as Q Currency, etc .

electronic money : Electronic transaction card as the medium , Through computer communication technology , The currency that is stored in the bank's computer system in the form of electronic data stream and realizes the circulation and payment function in the form of information transmission through the computer network . Like credit cards ,IC Card, etc .


development history

Before the emergence of bitcoin, electronic money has been used in electronic payment related to funds as early as the 1980s and 1990s , But its core is still based on centralized data management , therefore 2009 Bitcoin is the first application of blockchain core technology in real sense ,2013 Year by year Vitalik
Put forward the concept of Ethereum public chain ( Next generation smart contract and decentralized application platform ),2017 Public chain Star Cloud chain launched in China ( Blockchain operating system and search engine based on value scale ), Again 2018 Year's TrueChain Primary chain ( New generation hybrid consensus does not need license chain ) appear . No matter the launch of any new public chain, the core technology of blockchain will still remain unchanged , The underlying ideas are the same , All of them P2P Network node of , Open book , Consensus mechanism algorithm , Decentralized storage .



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

Design concept

Bitcoin :
( Also known as blockchain 1.0 edition ) It is a point-to-point e-cash system based on blockchain , It is developed and designed for the settlement network , Decentralized transactions , storage , It solves the problem of world currency , Due to the lack of protocol scalability in its design , Later, Ethereum appeared .

Official website :

Ethereum :
( Also known as blockchain 2.0 edition ) It is an open source public blockchain platform with smart contract function , Ethernet provides decentralized virtual machines through its cryptocurrency EVM and Solidity Programming language to handle point-to-point contracts , Ethereum solves the problem of insufficient scalability of bitcoin in design , Its goal is to create a decentralized new generation of Internet application platform . So far , Ether is the second most valuable cryptocurrency , Second only to bitcoin .

Official website :

TrueChain:  Initial chain focuses on creating free , to open up , Safe, efficient and easy to use blockchain Technology Foundation , Industry infrastructure , Construction of business infrastructure for operation system of block chain economy . Support unlimited node access , High performance (10,000-100,000
TPS), High security , Free open criteria for users .Truechain Inheriting the virtual machine of Ethereum (EVM) Design ideas , And do more expansion , New TVM virtual machine ( be similar to X86
), Multiple development languages can be run in this virtual machine (python,go,javascript etc. ) Written smart contract , Can quickly develop and deploy decentralized Dapp application .

Official website :


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 background program running on each node , Including mining , Blockchain management , Script engine and network management and other functions . As shown in the figure :


Ethereum : The architecture is divided into three parts : The top one is DApp, It passes through Web3.js Exchange with smart contract layer ; The middle layer is the smart contract layer , All smart contracts run on EVM( Ethereum virtual machine ) upper , And will use it RPC Call of ; stay EVM and RPC Here are the four core contents of Ethereum , include :blockChain,
Consensus algorithm , Mining and network layer . except DApp External , All the rest is in the Ethereum client , At present, the most popular Ethereum client is Geth(Go-Ethereum). As shown in the figure :

TrueChain:  The technical architecture of the initial chain is divided into five layers from bottom to top : First, the underlying services , contain P2P network ,LevelDB
database , Cryptography algorithm , Slice optimization ; The second is the core layer , Contains blockchain modules ,TRUE modular , Consensus algorithm module ; Third, it is API Interface layer , include TVM virtual machine ,gRPC
Communication protocol ; Fourth, smart contract layer ; The fifth floor is Dapp layer . As shown in the figure :

Consensus algorithm

Bitcoin :PoW Algorithm of workload proof mechanism , Only when certain workload conditions are met can a block be generated .

advantage : Completely decentralized , Node free access , The cost of establishing and maintaining centralized credit institutions is avoided , As long as the power of the network destroyer does not exceed that of the network 50%, The transaction status of the network can be agreed .

: At present, bitcoin mining causes a lot of waste of resources , In addition, the incentive mechanism of mining also results in the high concentration of calculation power of ore pool , The bigger problem is PoW The consensus of the mechanism takes a long time to reach , You can only do at most per second 7 Deals , About 10 Minutes to produce a block , Not suitable for commercial application .

Ethereum : be based on PoW Consensus mechanism for implementation of workload proof algorithm ( Mining algorithm )ETHash.

: Increase memory level difficulty , Avoid parallel use of memory to compute multiple Nonce value , Reduce the risk of centralization . In addition, Ethereum is also changing from PoW The consensus mechanism gradually transformed into PoS( Proof of interest ) Consensus mechanism .

TrueChain:   Selected will PBFT And PoW A hybrid consensus mechanism based on decentralization .fPoW
It is a new mining design concept , The initial chain uses fruit chain (FruitChain) Design of , Ensure the fairness of all participants in the mining process .

advantage : Make up for the previous two generations of blockchain bitcoin and Ethereum TPS Too low can not be applied to the development of commercial applications , The contradiction between decentralization and performance .


Account model

Bitcoin : use UTXO(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 status and transaction as input , Output to new status .

Bitcoin as a state transition system :

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


Ethereum : cancel UTXO Model , Using your own account model , There are two types of accounts on Ethereum : One is for smart contract accounts CA( Controlled by contract code ), One is aimed at Dapp For users EOA( Controlled by private key ). By creating and signing a transaction from a EOA User account send message , Whenever the contract account CA 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 what kind of book model you use , The core of the transaction at the bottom of the blockchain is actually a process of state object transformation , As shown in the figure is the state transition function of Ethereum :

TrueChain:   Slice optimization is adopted , Divide the world state of blockchain into different “ slice ”, each “ slice ” It's all different PBFT
The Committee , Turn serial processing into parallel processing , In order to achieve a substantial improvement in performance .



This article mainly talks about digital currency , Cryptocurrency , electronic money , The concept of virtual currency , And the development of blockchain technology , And contrast coin ( Blockchain Technology 1.0)、
Ethereum ( Blockchain Technology 2.0), Primary chain TrueChain 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 messages to my questions , Now take one to answer .

answer :

1, On Development , I will answer from three aspects , first , News from the Ministry of industry and information technology the day before yesterday “ China Netcom :2018 In the first half of the year, the development momentum of core technologies in the information field such as blockchain is on the rise ”; second , From the data of recruitment “ Blockchain and cryptocurrency work is growing in Asia
50% above ”, third , From the perspective of patent application technology ( Thomson Reuters ): “2017 The 406
Blockchain patents , Yes 56% From China ”; fourth , From the perspective of industry , recently IBM Announced 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 the application of blockchain technology take ? My personal opinion , From the initial emergence of bitcoin to Ethereum and now to star cloud chain ,Truechain
And other public chains , Blockchain technology has become very mature , It can be said that blockchain technology is booming .

3, On the bottleneck problem , At present, the biggest bottleneck in the development of blockchain technology should be how to improve TPS The problem of , To solve the bottleneck problem of blockchain, we can't just consider technology , More should also consider the business environment and industry environment factors .