1 thought on “Blockchain Alliance Chain (3) Knowing Fabric”
Ted
Fabric is the core blockchain framework launched by the Super Legend Alliance, which is suitable for building an alliance chain in complex enterprises and enterprises. According to the goal of the Super Legend Alliance, Fabric has been built as a modular, supporting basic alliance chain framework for insertable components. ;
. Different from the Quorum of the Ethereum system, Fabric has only considered the application between enterprises from the beginning. Its unique Channel concept connects the enterprise according to different business purposes with different subnets. Each subnet corresponds to a Channel, and each Channel has its own independent blockchain. And Quorum is obviously only one public network (all enterprise nodes are added), and the private business between enterprises and enterprises is completed through Private Manager.
The the easiest way to understand Channel is to compare its TOPIC to a message service. In fact, Fabic was first achieved based on Kafka distributed message services.
In the Fabric network, a company can have one or more nodes to join the entire alliance chain; one company can add 1 or more channels (subnets); one node can add 1 or more Channel. Each channel constitutes a subnet, so Fabric is a network composed of subnets.
So how does Fabric implement the execution and completion of the business chain of smart contracts (record the result of the transaction in the blockchain)?
Different from other frameworks, Fabric divides the entire process into three stages:
S business endorsement phase: endorsement nodes sent by customer requests, complete the business calculation through smart contracts to complete the business calculation of the business (But not updated the status) and complete the endorsement; return the endorsement result to a client.
It business sorting phase: The client sends the endorsement result to the order node (orderr), completes the sorting of the transaction in the sorting node, and packs it into the block, and finally sends it to all connections to all connections to the connection to Channel node. rn rn 业务验证并写入账本阶段: 通过Gossip 网络,所有Channel的节点都会接收到新的block,节点会验证block中的每一个事务,确定是否有效:有效地将会跟The new World State will be marked as "invalid" and will not update the World State, but the entire block will be completely added to the ledger (including invalid transactions).
According to the above description, the Fabric node can actually be divided into, ordinary nodes and order nodes:
people, ordinary nodes, complete endorsement (including only contract execution) and and Verification.
orderr, sort nodes, complete sorting.
The Fabric network added to the Orderer node can be described as follows:
Each chanel defines all nodes belonging to Channel, but not all nodes are connected to Ordererer to Nodes (nodes can spread private data or transactions through gossip protocol communication).
In blockchain, consensus is the basis of the blockchain. Unlike the public chain, the consensus of the alliance chain requires that all the transactions to join the ledger are determined and ultimate, that is, there is no bifurcation. The order between the block and the block is certain, and there is only the only chain. In Fabric, this objective demand is realized by sorting. All transactions will be submitted to the orderr node to get a certain order, and it will eventually pack them into a block to enter the ledger. Fabric has supported RAFT -based sorting services from 1.4.1, which can be considered to achieve consensus based on RAFT.
The RAFT -based sorting service phase is better distributed for early Kafka, and the configuration is simpler. It is a commonly used consensus algorithm commonly used in the alliance chain. Floor. To put it simply, Raft is a leader and follower model. All nodes that join the RAFT network have a leader at any time. Only this leader has the right to determine the order of affairs and pack it into a block. Other nodes can only submit transactions as Follower. And synchronize block.
based on the FAFT network, each company can have one or more nodes to participate in the Orderer. The network connection between enterprises in FRABRIC can change into the following forms:
The user users of blockchain are called EOA (External of Account) in Ethernet, and the carrier of EOA is wallet. Let's use this concept to see how Fabric realizes users and initiated affairs. EOA in Fabric is released by a CA center (X.509), a representative of an idea (this is still very different from Ethereum, an EOA in Ethereum is actually a hash address). The authorized operation is determined by the Channel's MSP (Service Provider) (as shown below).
Note: It is a common practice to verify the identity in the password; it includes personal information, public key, and the signature of this CA. The verification party only needs to have this CA certificate (including the public key of the CA) to verify whether the signature is correct and whether the content of the content is tampered with. Simply put, through CA and we can get a verified identity and trust chain.
As shown in the figure above, Fabric Zhongtong uses Wallet as an EOA carrier. One Wallet can contain multiple Identity (X.509). Identity is verified by the trust chain provided by the CA to verify the correctness.
A verification of identity, Fabric solves whether the identity represents the organization's members and what roles have in the organization through the MSP. For example, Channel first verifies whether the current user Identity is an effective identity, and then check the company and the role of the company and the role of the user through MSP, and finally determine whether the user has the right to perform operations.
can be said that Fabric's access control is completed by MSP. A MSP needs to be defined in every place where you need to access control. For example, each channel defines an MSP, which specifies the access permissions of resources within the channel range. MSP is a obscure concept in Fabric, and it is also the basis for its security visits to enterprises.
If mentioned in the previous article, Fabric divides business processing and Internet access into three parts, endorsement, sorting, and adding the ledger after verification.
The endorsement is the stage of Fabric's execution of smart contracts. In Ethereum, smart contracts are executed in EVM, with a variety of languages support. In Fabric, smart contracts are called Chaincode: a CHAINCODE can be understood as a smart contract container, which can include one or more smart contracts, not for EVM, ChainCode in JVM or Nodejs.
The customer applications to access the ledger through smart contracts. Each accessible smart contract is installed on the node that can be accessed by the client and is defined in the Channel. (Nodes that can only be contracts are called endorsement nodes. Nodes that are not only available for contracts are said to be submitted without submitting nodes. The endorsement node will first verify the customer's signature to ensure that the identity of the customer has the right to execute the transaction, and then execute the smart contract mentioned in the transaction, and generate an endorsement response (or transaction proposal, Tran-ProPosal). This endorsement response usually contains the reading collection, writing collection, and the signature of the node on the transaction. The main difference between the Ethereum Alliance Chain here is that only the transaction is simulated during the endorsement stage, and the transaction results are not really updated. The real update transaction is completed in the third stage. The endorsement of the endorsement node will respond to the client to the client, and the execution of the smart contract part is over.
usually a transaction execution requires multiple signatures, so the client needs to send a transaction to multiple endorsements nodes. The choice of these endorsements needs to meet the requirements of the endorsement strategy.
The figure below is a network schematic diagram that contains customers and endorsements, submitting a node.
Colidally based on Fabric's official reference document, the positive fruit process of customer transactions can be described below.
It as shown above, from 1 to 3, for endorsement phase, 4 is the sorting stage, 4.1,4,2, 5 is the verification submission stage. With reference to the concept of FRABIC, you can learn more about the concepts of trading details.
In general, Fabric is more focused on enterprises. Through the above, everyone can let everyone have a general understanding of the basic composition and concept of Fabric. Fabric itself is not mysterious, and it is the technology of existing enterprises. To better understand, it is recommended to refer to the support of the reading distributed message system and the security infrastructure of the enterprise (CA -related). Compared with the implementation of the Ethereum Alliance Chain, Fabric's sub -net concept is more adaptable to complex enterprises, but its complex security considerations make the operating costs very high. Limitation, Fabric will change here in the new 2.0.
The next article, we will take a look at Sawtooth in the future, the blockchain framework provided by INTER.
The alliance chain of the blockchain (1) Knowing Ethereum
The alliance chain of the blockchain (2) Knowing Quotum
Blockchain Alliance chain (3) Knowing Fabric
The alliance chain of the blockchain (4) Knowing Sawtooth
Fabric is the core blockchain framework launched by the Super Legend Alliance, which is suitable for building an alliance chain in complex enterprises and enterprises. According to the goal of the Super Legend Alliance, Fabric has been built as a modular, supporting basic alliance chain framework for insertable components. ;
. Different from the Quorum of the Ethereum system, Fabric has only considered the application between enterprises from the beginning. Its unique Channel concept connects the enterprise according to different business purposes with different subnets. Each subnet corresponds to a Channel, and each Channel has its own independent blockchain. And Quorum is obviously only one public network (all enterprise nodes are added), and the private business between enterprises and enterprises is completed through Private Manager.
The the easiest way to understand Channel is to compare its TOPIC to a message service. In fact, Fabic was first achieved based on Kafka distributed message services.
In the Fabric network, a company can have one or more nodes to join the entire alliance chain; one company can add 1 or more channels (subnets); one node can add 1 or more Channel. Each channel constitutes a subnet, so Fabric is a network composed of subnets.
So how does Fabric implement the execution and completion of the business chain of smart contracts (record the result of the transaction in the blockchain)?
Different from other frameworks, Fabric divides the entire process into three stages:
S business endorsement phase: endorsement nodes sent by customer requests, complete the business calculation through smart contracts to complete the business calculation of the business (But not updated the status) and complete the endorsement; return the endorsement result to a client.
It business sorting phase: The client sends the endorsement result to the order node (orderr), completes the sorting of the transaction in the sorting node, and packs it into the block, and finally sends it to all connections to all connections to the connection to Channel node. rn rn 业务验证并写入账本阶段: 通过Gossip 网络,所有Channel的节点都会接收到新的block,节点会验证block中的每一个事务,确定是否有效:有效地将会跟The new World State will be marked as "invalid" and will not update the World State, but the entire block will be completely added to the ledger (including invalid transactions).
According to the above description, the Fabric node can actually be divided into, ordinary nodes and order nodes:
people, ordinary nodes, complete endorsement (including only contract execution) and and Verification.
orderr, sort nodes, complete sorting.
The Fabric network added to the Orderer node can be described as follows:
Each chanel defines all nodes belonging to Channel, but not all nodes are connected to Ordererer to Nodes (nodes can spread private data or transactions through gossip protocol communication).
In blockchain, consensus is the basis of the blockchain. Unlike the public chain, the consensus of the alliance chain requires that all the transactions to join the ledger are determined and ultimate, that is, there is no bifurcation. The order between the block and the block is certain, and there is only the only chain. In Fabric, this objective demand is realized by sorting. All transactions will be submitted to the orderr node to get a certain order, and it will eventually pack them into a block to enter the ledger. Fabric has supported RAFT -based sorting services from 1.4.1, which can be considered to achieve consensus based on RAFT.
The RAFT -based sorting service phase is better distributed for early Kafka, and the configuration is simpler. It is a commonly used consensus algorithm commonly used in the alliance chain. Floor. To put it simply, Raft is a leader and follower model. All nodes that join the RAFT network have a leader at any time. Only this leader has the right to determine the order of affairs and pack it into a block. Other nodes can only submit transactions as Follower. And synchronize block.
based on the FAFT network, each company can have one or more nodes to participate in the Orderer. The network connection between enterprises in FRABRIC can change into the following forms:
The user users of blockchain are called EOA (External of Account) in Ethernet, and the carrier of EOA is wallet. Let's use this concept to see how Fabric realizes users and initiated affairs. EOA in Fabric is released by a CA center (X.509), a representative of an idea (this is still very different from Ethereum, an EOA in Ethereum is actually a hash address). The authorized operation is determined by the Channel's MSP (Service Provider) (as shown below).
Note: It is a common practice to verify the identity in the password; it includes personal information, public key, and the signature of this CA. The verification party only needs to have this CA certificate (including the public key of the CA) to verify whether the signature is correct and whether the content of the content is tampered with. Simply put, through CA and we can get a verified identity and trust chain.
As shown in the figure above, Fabric Zhongtong uses Wallet as an EOA carrier. One Wallet can contain multiple Identity (X.509). Identity is verified by the trust chain provided by the CA to verify the correctness.
A verification of identity, Fabric solves whether the identity represents the organization's members and what roles have in the organization through the MSP. For example, Channel first verifies whether the current user Identity is an effective identity, and then check the company and the role of the company and the role of the user through MSP, and finally determine whether the user has the right to perform operations.
can be said that Fabric's access control is completed by MSP. A MSP needs to be defined in every place where you need to access control. For example, each channel defines an MSP, which specifies the access permissions of resources within the channel range. MSP is a obscure concept in Fabric, and it is also the basis for its security visits to enterprises.
If mentioned in the previous article, Fabric divides business processing and Internet access into three parts, endorsement, sorting, and adding the ledger after verification.
The endorsement is the stage of Fabric's execution of smart contracts. In Ethereum, smart contracts are executed in EVM, with a variety of languages support. In Fabric, smart contracts are called Chaincode: a CHAINCODE can be understood as a smart contract container, which can include one or more smart contracts, not for EVM, ChainCode in JVM or Nodejs.
The customer applications to access the ledger through smart contracts. Each accessible smart contract is installed on the node that can be accessed by the client and is defined in the Channel. (Nodes that can only be contracts are called endorsement nodes. Nodes that are not only available for contracts are said to be submitted without submitting nodes. The endorsement node will first verify the customer's signature to ensure that the identity of the customer has the right to execute the transaction, and then execute the smart contract mentioned in the transaction, and generate an endorsement response (or transaction proposal, Tran-ProPosal). This endorsement response usually contains the reading collection, writing collection, and the signature of the node on the transaction. The main difference between the Ethereum Alliance Chain here is that only the transaction is simulated during the endorsement stage, and the transaction results are not really updated. The real update transaction is completed in the third stage. The endorsement of the endorsement node will respond to the client to the client, and the execution of the smart contract part is over.
usually a transaction execution requires multiple signatures, so the client needs to send a transaction to multiple endorsements nodes. The choice of these endorsements needs to meet the requirements of the endorsement strategy.
The figure below is a network schematic diagram that contains customers and endorsements, submitting a node.
Colidally based on Fabric's official reference document, the positive fruit process of customer transactions can be described below.
It as shown above, from 1 to 3, for endorsement phase, 4 is the sorting stage, 4.1,4,2, 5 is the verification submission stage. With reference to the concept of FRABIC, you can learn more about the concepts of trading details.
In general, Fabric is more focused on enterprises. Through the above, everyone can let everyone have a general understanding of the basic composition and concept of Fabric. Fabric itself is not mysterious, and it is the technology of existing enterprises. To better understand, it is recommended to refer to the support of the reading distributed message system and the security infrastructure of the enterprise (CA -related). Compared with the implementation of the Ethereum Alliance Chain, Fabric's sub -net concept is more adaptable to complex enterprises, but its complex security considerations make the operating costs very high. Limitation, Fabric will change here in the new 2.0.
The next article, we will take a look at Sawtooth in the future, the blockchain framework provided by INTER.
The alliance chain of the blockchain (1) Knowing Ethereum
The alliance chain of the blockchain (2) Knowing Quotum
Blockchain Alliance chain (3) Knowing Fabric
The alliance chain of the blockchain (4) Knowing Sawtooth