TrueChain-Yellow-paper Analysis

in -blockchain •  6 years ago 





# TrueChain ‘s yellow paper analysis


[TOC]


------




## Preface


Witnessed the iteration of TrueChain


This article is used to introduce the basic situation of the public chain project - the initial chain. Analytical arguments are based on source white papers, yellow papers, public article, Github. And based on the hierarchical structure of the blockchain, this paper will interpret the development status of the initial chain and the future technical route from the data layer, the network layer, the consensus layer, the inventive layer, the contact layer and the application layer one by one, aiming at the expression easy to understand. The analysis includes the summary of core technologies and the feasibility of technology landing. Affirm that this article is intended only as a study guide and does not constitute any investment advice.


Author's perspective: After the introduction of Lanzhou, the community entered the community simply to lick wool. At first, I didn't know anything about TrueChain. The inherent concept was not optimistic about domestic projects. With two months of study, I saw the growth of TrueChain. Technical breakthrough. At the beginning of the first time, the main network did not go online, the community, the public number, nothing on Github, the format of the white paper is not standardized; to the current project of community activity, now the public number of TrueChain is high-yielding like a sow, perfect I have my own white paper, and with my own yellow book, I can see that TrueChain grew up and saw the team's sincerity in doing practical things.


> **If you want to judge something, you have to be someone know it**


## Introduction


### Background


There are countless public chains in the world, and it can be said that Bitcoin, Ethereum, EOS, etc. come to see the map.


If we look at the white paper, apart from the different project names and different alphabetic abbreviations, we can't see the difference between them. Every project will say that it is subverting the production relationship, breaking the inherent rules of the Internet, and will fall to all walks of life. Everyone knows very well. There are only two or three settled down. I boldly predict that it will probably not exceed five. Family. Boss represents the application of the monetary system, and the second child represents the application of the trading system of the financial system, and will later represent a mainstream industry.


![image.png]()


According to the current hierarchical level of blockchain: data layer, network layer, consensus layer, incentive layer, the contract layer, the application layer.  level map, as can be seen from the level chart, all projects cannot escape this framework, below The third layer is the basic component of the blockchain. For investors, it is the biggest problem for developers to find a team with competitive advantages. There is a huge information asymmetry. We can't take the time to understand one by one. The team is really doing technology, and there is time cost. In a limited time, seeing a project, starting from the level is to clear the idea and improve a lot of efficiencies. If you have something in the network layer or the consensus or incentive layer, you can choose to continue watching it, otherwise, the project can be lost. Know the methodology, how to implement it? My approach is to look at the Yellow Book, the Github code, and the progress of the team pushed by the public.


According to the introduction in the Yellow Book, the initial chain team has gone out of its own innovation at the consensus level and the contract level.


### Consensus layer innovation - hybrid formula algorithm


 At present, in the distributed system, that is, the blockchain system, in addition to solving the basic problem of consistency, it is also necessary to solve the problem of fault tolerance. That is to say, there are problems in which nodes are combined to deliberately do evil.


The public chain consensus generally has two phases, the first phase: the inefficient decentralized solution Nakamoto Pow; they are indeed subversive to create history, from the ancient PBFT Byzantine algorithm voting to the use of hashes Algorithm, which is random, difficult to calculate, and easy to verify. This ensures the safety and reliability of the process. However, during the development of this decade, some problems have also been exposed. First of all, the ASIC mining machine for Hash logic operation, combined with the mining pool, will lead to the centralization of the blockchain. In summary, the traditional algorithm is inefficient and has a centralized risk.


The second stage: the commissioning phase, DPOS. Although it improves efficiency, its committee's system does not perfectly reflect the advantages of going to the center.


Then the team gave the third option, the mixed formula; this can be regarded as an attempt, and it is TrueChain that gives a complete definition of the hybrid consensus algorithm, and the program, FPOW.


FPOW Github code:https://github.com/truechain/truechain-fpow


![image.png]()


FPOW completion status: According to the degree of code submission and the disclosure of the TrueChain public number, the block data structure has been changed, and the Fruit and Record fields have been added to simulate the behavior of the PBTFT to issue the transaction package, and the new data block is packaged and wound.


```

// Header represents a block header in the Ethereum blockchain.

type Header struct {

ParentHash common.Hash `json:"parentHash"       gencodec:"required"`


PointerHash  common.Hash `json:"pointerHash"      gencodec:"required"`

FruitsHash   common.Hash `json:"fruitSetHash"     gencodec:"required"`

RecordHash   common.Hash

RecordNumber *big.Int

Fruit bool


UncleHash   common.Hash    `json:"sha3Uncles"       gencodec:"required"`

Coinbase    common.Address `json:"miner"            gencodec:"required"`

Root        common.Hash    `json:"stateRoot"        gencodec:"required"`

TxHash      common.Hash    `json:"transactionsRoot" gencodec:"required"`

ReceiptHash common.Hash    `json:"receiptsRoot"     gencodec:"required"`

Bloom       Bloom          `json:"logsBloom"        gencodec:"required"`

Difficulty  *big.Int       `json:"difficulty"       gencodec:"required"`

Number      *big.Int       `json:"number"           gencodec:"required"`

GasLimit    uint64         `json:"gasLimit"         gencodec:"required"`

GasUsed     uint64         `json:"gasUsed"          gencodec:"required"`

Time        *big.Int       `json:"timestamp"        gencodec:"required"`

Extra       []byte         `json:"extraData"        gencodec:"required"`

MixDigest   common.Hash    `json:"mixHash"          gencodec:"required"`

Nonce       BlockNonce     `json:"nonce"            gencodec:"required"`

}


// field type overrides for gencodec

type headerMarshaling struct {

Difficulty *hexutil.Big

Number     *hexutil.Big

GasLimit   hexutil.Uint64

GasUsed    hexutil.Uint64

Time       *hexutil.Big

Extra      hexutil.Bytes

Hash       common.Hash `json:"hash"` // adds call to Hash() in MarshalJSON

}

```


The above code is the data structure of the underlying block of TrueChain, and you can clearly see the field with the added fruithash.


Here I also noticed another interesting place. TrueChain used the Gas field to indicate that the TrueChain team followed the ETH settlement method. I very much agree with this approach. GAS settlement can be said to be a very clever design, especially suitable for more advanced blockchain architecture. The advantages of GAS usage and transaction fees in Bitcoin are 1. By limiting the upper limit of the block GAS Achieve the role of defining the block memory size. 2. Balance the cost of ordinary transfer transactions and complex data submissions, and be fairer.


#### Update electoral system


It is not only in the case of mistakes but also in the case of evil, it will take the initiative to eliminate nodes; now in order to speed up the enthusiasm and mobility of the nodes. The team added the duration variable to the original, which means that the fixed time, the identity of the committee is replaced once, which further strengthens the decentralization, and more nodes have equal power.


![image.png]()


It can be seen that the community is quite active, compared to EOS, and the big consortium participates in the node campaign. TrueChain is superior to EOS in the design of the DAO community system. The most obvious feature is that more personal nodes are involved. This is a sign of a healthy and healthy community. If a DAO organization's nodes and miners are huge capital, institutions, it will only cause worry and disappointment.


![image.png]()


Based on my verification with the TrueChain development team, the idea is currently in development. If it can be achieved, it has already surpassed EOS at the level of incentives, that is, the economic model.


#### Data fragmentation and fragmentation processing system


According to my understanding, the functionality of this section is related to the block timestamp. If the time the block is not recorded in the current state is a potential vulnerability.


### Contract Layer Innovation - Reuse of ETH's Virtual Machine Principle TVM


 


#### TVM


Like EVM for ETH. Just like a computer.


What is special is that there will be two virtual machines in one node, why? Because of the FPOW algorithm. A virtual machine handles the PBFT consensus, and a virtual machine handles the POW consensus.


At the beginning of the design, the TrueChain team chose between Docker and virtual machines and finally chose the virtual machine. At present, this decision is correct, the most public chain, there must be hundreds of contracts in the future. If you choose Docker, it means hundreds of thousands of dockers, which is bound to affect performance, assuming the alliance chain, that docker is the best choice. For the current performance considerations and docker is still in the development stage, the shortest medium-term replacement of virtual machines is really good.


### Modifications to the Ethereum paradigm


 Combined with the current computing power on the market, TrueChain designed and improved FPOW and reused SnailChain's protocol. The specific details include compensation mechanism, non-POW mining. To tell the truth, this part of Yellow Paper is not currently understood.


But solved the following problems:


- Address joint mining

- Address self-propelled mining

- Allow out-of-order mining


## Hope


The dream is to have something, otherwise, there is no difference between it and the salted fish. Change it, otherwise, there is no difference between it and the air.


As a participating citizen of the blockchain, I am very happy to see the efforts of TrueChain, TrueChain's down-to-earth.


According to the instructions in the white paper, TrueChain will be the first to apply to the digital advertising industry. This is also a very popular direction on the 2C side. Optimistic about the future of TrueChain


## Node campaign


Finally, attach the rules of the node campaign, hope to see the last you can also participate in


https://mp.weixin.qq.com/s/dPiA95KcO5YsEIDRPoX-2w


## About me


![image.png]()


 Master of Multimedia Information, City University of Hong Kong 


Code,Speech,Fit


Nowadays, I  am now part of the blockchain community.Message me anytime


Wechat:Dinocchou


MyBlog:https://rickeeyzhou.github.io/



Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

@rickeey, I gave you an upvote on your post! Please give me a follow and I will give you a follow in return and possible future votes!

Thank you in advance!