Welcome toTencent Cloud + community, get more Tencent mass technology practice dry goods oh ~

This article was published by Ao Meng in cloud + Community column

With the development of blockchain, there are many different forms of blockchain technology. With the development of technology, it is generally accepted that blockchain has entered the 2.0 era. Blockchain 1.0 is a decentralized digital currency blockchain system represented by Bitcoin, while 2.0 is a blockchain system that introduces smart contracts.

Among the blockchain systems that support smart contracts, Hyperledger Fabric (contributed by IBM), which is owned by the Linux Foundation, and Ethereum, created and managed by the Ethereum Foundation led by Vitalik Buterin, are two examples. These two blockchain systems have very different design approaches, which fully embodies the difference between the traditional enterprise information systems thinking design model (Fabric) and the blockchain fundamentalist thinking design model.

First take a look at Ethereum, which is a very typical blockchain system influenced by the Bitcoin architecture. Its most typical feature is that the chain is the foundation. All trust comes from chained data structures secured with Hash cryptography, and all functionality is architected on top of this trust.

For Fabric, the system must have a beautiful technical architecture: pluggable modular design, high scalability, high cohesion and low coupling. On a beautiful technical architecture, each module is called to construct a function – chain, each function can be added to the existing chain, or a new chain can be created.

Ethereum uses virtual machines to implement smart contracts. The virtual machine in Ethereum, called EVM, is a lightweight sandbox execution environment. To make smart contracts more convenient, Ethereum developers have created new languages for writing smart contracts, and the most popular EVM programming language is Solidity. One of the characteristics of EVM is that only on-chain data can be read and written, and off-chain data can only be passed to the smart contract by the caller through function parameters when the smart contract is called. (This feature of EVM ensures that the outcome of a smart contract is deterministic and does not vary by node execution.) The smart contract itself and the invocation of the smart contract (or transaction using the smart contract) are recorded on the chain.

Therefore, we can see that in ethereum’s architecture, the “chain” is the anchor point of trust, and all trust comes from the chain.

Fabric uses the Docker mechanism to implement smart contracts. Compared to Ethereum’s EVM, Docker is a heavyweight sandbox execution environment. Because of the nature of Docker, Fabric can develop smart contracts in many languages, as well as using many library functions and system functions. Therefore, Fabric’s smart contracts are more flexible (such as communicating with Internet of Things devices). However, this flexibility also leads to the risk that different nodes may execute with different results and no consensus can be reached. The introduction of channels enables Fabric smart contracts to be deployed directly on certain nodes. Each smart contract can create a new chain or share a chain with other smart contracts. In the Fabric architecture, a chain is a storage space shared by several nodes that participate in the implementation of a function.

Once we understand the difference in how these two smart contracts are implemented, we can see the difference in the design of these two typical blockchains — which layer of the architecture should the “chain” be located on?

In blockchain fundamentalism, an entire data system strung together by Hash algorithms is trusted because no one else can be trusted. However, in the alliance chain for inter-enterprise applications, the nodes need identity authentication to join, so the reliability degree is higher. So, as long as some key data reached consensus to achieve credibility.

Because of this design difference, in Ethereum, all smart contracts run on the same chain, sharing a trusted infrastructure; In a Fabric, each application corresponds to one chain, and the entire system consists of many sub-chains that share a basic trust infrastructure.

From a system architecture perspective, Ethereum is a complete infrastructure that can’t be pulled apart to be used. While there is a high degree of design coupling within Ethereum, with strong module dependencies and even the entire system depending on some underlying smart contract (such as the Ethereum contract), this can be seen as a result of the cohesion of the entire infrastructure.

Fabric, on the other hand, is more like a blockchain cloud service platform, enabling users to easily create chains one by one using each module on the base platform to implement applications one by one. So Fabric is a platform for low-coupling design.

Question and answer

What is blockchain?

reading

See blockchain clearly

Blockchain primer

Blockchain has lived and died

Deep Learning technology (NLP) with a PhD from Nanyang Technological University in Singapore

This article has been authorized by the author to Tencent Cloud + community, more original text pleaseClick on the

Search concern public number “cloud plus community”, the first time to obtain technical dry goods, after concern reply 1024 send you a technical course gift package!

Massive technical practice experience, all in the cloud plus community!