CN111669267B - Configuration method for consensus mechanism and endorsement strategy of block chain - Google Patents

Configuration method for consensus mechanism and endorsement strategy of block chain Download PDF

Info

Publication number
CN111669267B
CN111669267B CN202010414383.2A CN202010414383A CN111669267B CN 111669267 B CN111669267 B CN 111669267B CN 202010414383 A CN202010414383 A CN 202010414383A CN 111669267 B CN111669267 B CN 111669267B
Authority
CN
China
Prior art keywords
channel
sequencing
blockchain
service
endorsement
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010414383.2A
Other languages
Chinese (zh)
Other versions
CN111669267A (en
Inventor
陈楷
陈昌
杨文韬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Zhigui Internet Technology Co ltd
Original Assignee
Xi'an Zhigui Internet Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xi'an Zhigui Internet Technology Co ltd filed Critical Xi'an Zhigui Internet Technology Co ltd
Priority to CN202010414383.2A priority Critical patent/CN111669267B/en
Publication of CN111669267A publication Critical patent/CN111669267A/en
Application granted granted Critical
Publication of CN111669267B publication Critical patent/CN111669267B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/065Encryption by serially and continuously modifying data stream elements, e.g. stream cipher systems, RC4, SEAL or A5/3
    • H04L9/0656Pseudorandom key sequence combined element-for-element with data sequence, e.g. one-time-pad [OTP] or Vernam's cipher
    • H04L9/0662Pseudorandom key sequence combined element-for-element with data sequence, e.g. one-time-pad [OTP] or Vernam's cipher with particular pseudorandom sequence generator
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/56Financial cryptography, e.g. electronic payment or e-cash
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention provides a block chain consensus mechanism configuration and endorsement policy configuration method. The configuration method of the consensus mechanism of the block chain comprises the following steps: creating a plurality of ordering services corresponding to the plurality of initial blocks one by one; selecting a consensus mechanism from a plurality of preset consensus mechanisms for each sequencing service, wherein each sequencing service has a unique address; creating a channel, and designating a ranking service from a plurality of ranking services for the created channel according to the requirements of the created channel. The configuration method of the consensus mechanism of the blockchain can flexibly select the required consensus without modifying codes of the blockchain.

Description

Configuration method for consensus mechanism and endorsement strategy of block chain
Technical Field
The invention relates to the technical field of communication, in particular to a block chain consensus mechanism configuration and endorsement policy configuration method.
Background
Currently, in Hyperledger Fabric blockchains, consensus types can only be set in the ordering configuration set (Orderer Config Group), and only one consensus type can be set. While current Hyperledegr Fabric supports a variety of consensus plugins, including Solo, kafka, lift, and later on adds BFT consensus, there is and only one consensus in the initial Block (Genesis Block). When the ordering (Orderer) service is started, the System Channel (System Channel) and all application channels (Application Channel) can only use this consensus. In some application scenarios, multiple channels (channels) respectively run different types of applications, and these applications may wish to use different consensus mechanisms, so that their development is restricted.
Disclosure of Invention
Based on the problems existing in the prior art, the invention provides a block chain consensus mechanism configuration and endorsement policy configuration method. The configuration method of the consensus mechanism of the blockchain can flexibly select the required consensus without modifying codes of the blockchain.
In a first aspect, the present invention provides a method for configuring a common knowledge mechanism of a blockchain, including:
creating a plurality of ordering services corresponding to the plurality of initial blocks one by one;
selecting a consensus mechanism from a plurality of preset consensus mechanisms for each sequencing service, wherein each sequencing service has a unique address;
creating a channel, and designating a ranking service from a plurality of ranking services for the created channel according to the requirements of the created channel.
According to the configuration method of the common knowledge mechanism of the blockchain, the codes of the blockchain are not required to be modified, and different channels can flexibly select the required common knowledge.
In some examples, the creating the channel and assigning a ranking service to the created channel from a plurality of ranking services according to a requirement of the created channel includes:
an address is selected from a plurality of addresses of the ordering service for the created channel to be assigned to the channel so that the channel uses a corresponding consensus mechanism through the selected address.
In a second aspect, the present invention provides a method for configuring a common knowledge mechanism of a blockchain, including:
creating a channel map, the channel map maintaining a plurality of channels and an ordering corresponding to the plurality of channels one to one;
creating channels, selecting corresponding sequences from the channel maps according to the sequence service types specified for the created channels, wherein the sequences have a common recognition mechanism.
In a third aspect, the present invention provides a method for configuring endorsement policies of a blockchain, including:
the client generates a proposal, wherein the proposal comprises transaction data and a random value;
a plurality of candidate endorsement nodes receive the proposal, and a preset verifiable random function is adopted according to the random value so as to determine whether the candidate endorsement nodes are endorsement nodes or not;
and if so, executing corresponding operation according to the proposed transaction data.
In some examples, the verifiable random function includes three encryption functions: keygen, evaluate, and Verify, wherein,
keygen (r) is used to generate (VK, SK): for arbitrary random inputs, a pair of asymmetric key pairs is generated: a verification key VK (public key) and a private key SK;
the evaluation (SK, X) is used to output (Y, ρ): the evaluation function evaluation inputs a private key SK and a message X, and outputs a pseudo-random character string Y and a proof ρ;
verify (VK, X, Y, ρ) outputs 0/1: verification function Verify inputs verification key VK, message X and output in the evaluation function: a pseudorandom string Y and proof ρ; output result 0/1: output 1 when the proof of function verification ρ is generated from X and Y can be derived from the proof ρ.
In a fourth aspect, the present invention provides a method for configuring an endorsement policy of a blockchain, including:
the client generates a proposal, wherein the proposal comprises transaction data and block height;
the multiple candidate endorsement nodes receive the proposal and determine whether the candidate endorsement nodes are endorsement nodes according to the block height and the weight of each node in the multiple candidate endorsement nodes;
and if so, executing corresponding operation according to the proposed transaction data.
In some examples, the determining whether the block is an endorsement node according to the block height and the weight of each of the plurality of candidate endorsement nodes includes:
acquiring the latest weight states of all nodes of the block height, and arranging the latest weight states;
and selecting a part of endorsement nodes with larger weight according to the endorsement policy to form an endorsement node candidate set.
In a fifth aspect, the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the method for configuring a consensus mechanism of a blockchain according to the first aspect or the second aspect, or the method for configuring an endorsement policy of a blockchain according to the third aspect or the fourth aspect when the computer program is executed.
In a fourth aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method for configuring a consensus mechanism for a blockchain as described in the first aspect or the second aspect, or the method for configuring an endorsement policy for a blockchain as described in the third aspect or the fourth aspect.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings that are necessary for the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention and that other drawings can be obtained from these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for configuring a common knowledge mechanism of a blockchain according to an embodiment of the invention;
FIG. 2 is a schematic diagram of a method for configuring a common knowledge mechanism of a blockchain according to an embodiment of the invention;
FIG. 3 is a flow chart of a method for configuring a common knowledge mechanism of a blockchain in accordance with another embodiment of the present invention;
FIG. 4 is a schematic diagram of a method for configuring a common knowledge mechanism of a blockchain according to another embodiment of the invention;
FIG. 5 is a flow chart of a method for endorsement policy configuration of a blockchain provided by an embodiment of the present invention;
FIG. 6 is a schematic diagram of a method for configuring endorsement policies of a blockchain in accordance with an embodiment of the present invention;
FIG. 7 is a flowchart of a method for endorsement policy configuration of a blockchain provided by another embodiment of the present invention;
fig. 8 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following describes the embodiments of the present invention further with reference to the accompanying drawings. The following examples are only for more clearly illustrating the technical aspects of the present invention, and are not intended to limit the scope of the present invention.
The following describes a configuration of a common knowledge mechanism and an endorsement policy configuration method of a blockchain according to an embodiment of the present invention with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a method for configuring a common knowledge mechanism of a blockchain according to an embodiment of the present invention, where, as shown in fig. 1, the method for configuring a common knowledge mechanism of a blockchain according to an embodiment of the present invention includes the following steps:
s101: a plurality of ordering services is created that corresponds one-to-one to the plurality of initial blocks.
S102: a consensus mechanism is selected from a preset plurality of consensus mechanisms for each ranking service, wherein each ranking service has a unique address.
S103: creating a channel, and designating a ranking service from a plurality of ranking services for the created channel according to the requirements of the created channel. As a specific example, an address is selected from a plurality of addresses of the ordering service for a created channel to be assigned to the channel, such that the channel uses a corresponding consensus mechanism through the selected address.
Taking Hyperledger Fabric blockchain as an example, the code of Hyperledger Fabric is not required to be modified, and different initial blocks (Genesis blocks) are directly used to create a plurality of order services (order services), each order Service selects a different consensus type, specifically, as shown in fig. 2, when creating a Channel (Channel), the addresses of the different order services are specified, so that the Channel uses the different consensus types.
According to the configuration method of the common knowledge mechanism of the blockchain, the codes of the blockchain are not required to be modified, and different channels can flexibly select the required common knowledge.
As shown in fig. 3, an embodiment of the present invention discloses a method for configuring a consensus mechanism of a blockchain, including:
s301: a channel map is created that maintains a plurality of channels and an ordering that corresponds one-to-one to the plurality of channels.
S302: creating channels, selecting corresponding sequences from the channel maps according to the sequence service types specified for the created channels, wherein the sequences have a common recognition mechanism.
As shown in connection with FIG. 4, a sort Service (Orderer Service) can be used to support multiple consensus plugins simultaneously, and the same Orderer Service can support different consensus types by designating different consensus types when creating a Channel. The channel map is, for example, a pluggable channel map (Plugin Channel Mapping).
As a specific example, a new module Plugin Channel Mapping is added in Hyperledger Fabric Orderer for maintaining a mapping relationship between channels (channels) and pluggable ordering (Orderer plug in).
Under the Orderer configuration of Configtx.yaml file, multiple configurations of Orderer plug are added simultaneously, and multiple Orderer plug are initialized at the time of Orderer startup.
The ordering service type (OrderType) configuration is added under the Application configuration of Config. Yaml file so that the Application channel (Application Channel) can select a different consensus type than the initial Block (Genesis Block).
It should be noted that all Application Channel can only inherit all the configurations of Orderer in Genesis Block. By the method of the embodiment of the invention, the configuration of the OrderrType is newly added, so that Application Channel can cover the configuration of the Orderer inherited from the Genesis Block, and the consensus type of Application Channel can be different from that of the System Channel.
For pluggable sequencing (Orderer plug in), besides the original Orderer plug in Hyperledger Fabric, a self-developed Sbft consensus plug-in is added, so that a BFT consensus algorithm is realized. Orderer plug in implements Hyperledger Fabric Orderer Plugin internal interfaces.
According to the configuration method of the common knowledge mechanism of the block chain, different channels can flexibly select the required common knowledge, the resource utilization rate is effectively improved, and a single Orderer node can participate in multiple types of common knowledge.
FIG. 5 is a flow diagram of a method of endorsement policy configuration of a blockchain in accordance with an embodiment of the invention. As shown in fig. 5, the endorsement policy configuration method of the blockchain according to an embodiment of the present invention includes:
s501: the client generates a proposal that includes transaction data and a random value.
S502: a plurality of candidate endorsement nodes receive the proposal, and a preset verifiable random function is adopted according to the random value so as to determine whether the candidate endorsement nodes are endorsement nodes or not;
s503: and if so, executing corresponding operation according to the proposed transaction data.
Wherein the verifiable random function comprises three encryption functions: keygen, evaluate, and Verify, wherein,
keygen (r) is used to generate (VK, SK): for arbitrary random inputs, a pair of asymmetric key pairs is generated: a verification key VK (public key) and a private key SK;
the evaluation (SK, X) is used to output (Y, ρ): the evaluation function evaluation inputs a private key SK and a message X, and outputs a pseudo-random character string Y and a proof ρ;
verify (VK, X, Y, ρ) outputs 0/1: verification function Verify inputs verification key VK, message X and output in the evaluation function: a pseudorandom string Y and proof ρ; output result 0/1: output 1 when the proof of function verification ρ is generated from X and Y can be derived from the proof ρ.
Specifically, as shown in FIG. 6, each chain code has an endorsement policy that specifies that a set of Peers on the channel must execute the chain code and endorse the execution result to prove that the transaction is valid. These endorsement policies specify the organization that has to endorse the transaction proposal.
However, the existing endorsement strategy adopts a fixed endorsement node to process transactions, so that the problems of safety risk and performance bottleneck exist: firstly, the endorsement node is determined at the beginning of the establishment of a blockchain network and the client must be able to identify and trust, so that the identity of the endorsement node must be disclosed and verified; the number of endorsement nodes is very small compared with the number of all nodes, the number of endorsement nodes in part of the system is only one number, and the nodes are required to process all transactions in the system, which results in obvious transaction speed bottlenecks. The root cause of the problem is that Hyperledger Fabric lacks a dynamic random selection process of endorsement nodes in the consensus process.
Wherein the random algorithm design can be verified:
1. verifiable random function
The VRF algorithm consists of a set of three encryption functions: keygen, evaluate and Verify.
Keygen (r) → (VK, SK): for arbitrary random inputs, keygen generates a pair of asymmetric key pairs: a verification key VK (public key) and a private key SK.
Evaluation (SK, X) → (Y, ρ): the evaluation function evaluation inputs the private key SK, the message X, and outputs the pseudo-random string Y and the certificate ρ.
Verify (VK, X, Y, ρ) →0/1: verification function Verify inputs verification key VK, message X and output in the evaluation function: pseudo-random string Y and proof ρ. Output result 0/1: only if the function verifies that the proof ρ is generated from X and that Y can be derived from the proof ρ,1 will be output, i.e. the function verifies if there is a unique correspondence between X and Y.
The optimized consensus process:
the client generates a proposal < req, r > signalProp, where req is transaction data (including transaction ID), r is a random value selected by the client as a seed for an endorsement node identity extraction algorithm.
After each candidate endorsement node receives the proposal of the client, the validity of the proposal is firstly improved, and then the candidate endorsement node executes an endorsement node selection algorithm to judge whether the candidate endorsement node is an endorsement node. The algorithm flow is as follows: (1) generating a random number from the seed r and proving: evaluation (SK, r) → (Y, ρ); (2) Judging whether the node is an endorsement node according to a drawing algorithm: according to the result of the drawing calculation of Y and the comparison with the threshold lambda, the hash value is obtained by first performing a hash operation on Y, the length of the hash is fixed, for example 32 bytes, the hash value is changed into a fraction, i.e. d=hash/2≡256, by knowing that the hash is uniformly distributed in the interval [0,2≡256] according to the safety characteristic of the VRF, and d is uniformly distributed between the intervals [0,1 ]. D is set to be between 0 and lambda, which means that the drawing fails and is not an endorsement node; d is between [ lambda, 0] and indicates that the drawing is successful, and is an endorsement node.
If the proposal is determined to be an endorsement node, executing the proposal and generating a read-write set, endorsing the proposal through escc-plug in, and generating a proposal response proposal_response and returning.
The client collects the proposal_response from the different endorsement nodes:
if the endorsement policy specified number of endorsement returns are collected, forwarding to the orderer ordering node
If the number of the collected endorsement results does not meet the endorsement policy, the client reconstruct the proposal;
the ordering node monitors and receives all transactions of the whole network, packages the transactions into blocks, and broadcasts the blocks to the submitting nodes.
After receiving the blcok, the submitting node firstly performs routine verification, then verifies whether an endorsement policy is met through the vscc-plug in, verifies whether the identity of the endorsement node accords with the endorsement policy through the verity (VK, r, Y, rho), and updates the ledger after the verification is passed.
According to the endorsement policy configuration method of the blockchain, provided by the embodiment of the invention, the probability that each endorsement node is selected can be balanced, so that the operation is prevented from being concentrated in a certain endorsement node, and the processing efficiency of the endorsement node is improved.
FIG. 7 is a flow diagram of a method of endorsement policy configuration of a blockchain in accordance with an embodiment of the invention. As shown in fig. 7, the endorsement policy configuration method of a blockchain according to an embodiment of the present invention includes:
s701: the client generates a proposal, wherein the proposal comprises transaction data and block height;
s702: and the plurality of candidate endorsement nodes receive the proposal and determine whether the candidate endorsement nodes are endorsement nodes according to the block height and the weight of each node in the plurality of candidate endorsement nodes. In a specific example, the latest weight states of all nodes of the block height can be obtained and arranged; and selecting a part of endorsement nodes with larger weight according to the endorsement policy to form an endorsement node candidate set.
S703: and if so, executing corresponding operation according to the proposed transaction data.
Specifically, the endorsement node set election process:
and initializing and setting weights power of all endorsement nodes through core.yaml configuration or peer environment variables, wherein the total weight is N.
According to an endorsement policy, the first n endorsement nodes with larger power are selected, and the endorsement nodes which are used for round endorse the proposal.
After the round is finished, the weight of the endorsement node is recalculated, the weight of the selected endorsement node is reduced by N, and the power of each unselected endorsement node is increased.
As each round progresses, the weights gradually increment according to the corresponding proportion of the voting rights.
The optimized consensus process:
the client generates proposal < req, h > sigedProp, wherein req is transaction data, h is current round (i.e. block height), and the client signs proposal and sends the proposal to the endorsement node candidate set.
After each candidate endorsement node receives the proposal of the client, the validity of the proposal is verified first, and then the candidate endorsement node executes an endorsement node selection algorithm to judge whether the candidate endorsement node is an endorsement node. The algorithm flow is as follows: (1) Acquiring the latest weight states of all nodes of the round h, and arranging from large to small; (2) And selecting the first n endorsement nodes with larger weights according to an endorsement policy to form an endorsement node candidate set.
If the proposal is determined to be an endorsement node, executing the proposal and generating a read-write set, endorsing the proposal through escc-plug in, and generating a proposal response proposal_response and returning.
The client collects the proposal_response from different endorsement nodes, and merges and forwards the proposal_response to the orderer ordering node.
The ordering node monitors and receives all transactions of the whole network, packages the transactions into blocks, and broadcasts the blocks to the submitting nodes.
After receiving the blcok, the submitting node firstly performs routine verification, then verifies whether an endorsement strategy is met or not through the vscc-plug in, verifies whether the identities of the endorsement nodes are in line or not through the weight values of all nodes in verification turn h, and after verification, the endorsement nodes elect to enter the next turn and recalculate the weight values of the endorsement nodes. When each submitting node completes the above operations, it may be considered that a consensus is reached for the transaction initiated by the client.
According to the endorsement policy configuration method of the blockchain, disclosed by the embodiment of the invention, the appointed number of endorsement nodes can be determined to process, so that the operation is prevented from being concentrated in a certain endorsement node, and the processing efficiency of the endorsement node is improved.
Furthermore, the probability that each endorsement node is selected varies due to the presence of power. A specific round of endorsed node candidate sets may be foreseen.
In a specific application, the transaction endorsement and the transaction verification can be plugged in and out:
hyperledger Fabric, the node will verify that the transaction is committed, and the node will check the following before executing the state change brought by the transaction itself:
verifying the identity of the signing transactor;
verifying the endorsement of the transaction:
and confirming that the transaction meets the relevant endorsement policy of the corresponding chain code naming interval.
Fabric supports custom endorsement and validation logic for nodes and enables pluggable linking to chain code execution.
In the endorsement policy optimization scheme, the pluggable plug-in mode is used for realizing random selection and verification of endorsement nodes, reducing invasiveness to fabric native codes, and being beneficial to version upgrading and maintenance.
The implementation process is as follows:
as a specific example, when an authentication plug-in needs to be implemented, implementation: plugin interface in core/handles/validation/api/validation.
By letting the node call the New method of the plugin factory interface, which will also be implemented by the plugin developer, a verification plugin instance of a given plugin type is created for each channel.
The configuration process comprises the following steps:
each node has a local configuration (core.yaml) that includes a mapping between endorsement or validation logical names and the logical implementation to be performed.
Default logic is included in the local configuration of nodes of the handles portion, called ESCC and VSCC.
The user can deploy custom endorsements and validations as a Golang plug-in by adding another attribute named library to the name attribute.
Based on the same inventive concept, a further embodiment of the present invention discloses an electronic device, see fig. 8, which specifically includes the following: a processor 801, a memory 802, a communication interface 803, and a communication bus 804;
wherein the processor 801, the memory 802, and the communication interface 803 complete communication with each other through the communication bus 804; the communication interface 803 is used for realizing information transmission between devices;
the processor 801 is configured to invoke a computer program in the memory 802, where the processor implements all steps of the above-described method for configuring a common mechanism of a blockchain or all steps of a method for configuring an endorsement policy of a blockchain when the processor executes the computer program.
Based on the same inventive concept, a further embodiment of the present invention provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements all the steps of the above-described blockchain consensus mechanism configuration method or all the steps of the blockchain endorsement policy configuration method.
Further, the logic instructions in the memory described above may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment of the invention. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on such understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the index monitoring method described in the respective embodiments or some parts of the embodiments.
Furthermore, in the present disclosure, such as "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
Moreover, in the present invention, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Furthermore, in the description herein, reference to the terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (4)

1. A method for configuring a consensus mechanism of a blockchain, comprising:
creating a plurality of ordering services corresponding to the plurality of initial blocks one by one;
selecting a consensus mechanism from a plurality of preset consensus mechanisms for each sequencing service, wherein each sequencing service has a unique address;
creating a channel, and designating a sequencing service from a plurality of sequencing services for the created channel according to the requirements of the created channel;
the creating the channel and designating a sequencing service from a plurality of sequencing services for the created channel according to the requirement of the created channel comprises:
selecting an address from a plurality of addresses of ordering services for a created channel to be assigned to the channel, so that the channel uses a corresponding consensus mechanism through the selected address;
wherein the blockchain includes a Hyperledger Fabric blockchain;
a pluggable channel map is added in the sequencing service, and the pluggable channel map is used for maintaining a mapping relation between the channel and pluggable sequencing in the sequencing service;
the pluggable channel mapping is based on Config.yaml file configuration, multiple pluggable sequencing configurations are added in the Config.yaml file at the same time, and the multiple pluggable sequencing is initialized when the sequencing service is started;
and the application configuration of the Config.yaml file is also provided with a sequencing service type configuration which is used for selecting application channels and sharing types different from the initial block.
2. A method for configuring a consensus mechanism of a blockchain, comprising:
creating a channel map, the channel map maintaining a plurality of channels and an ordering corresponding to the plurality of channels one to one;
creating channels, and selecting corresponding sequences from the channel maps according to the sequence service types designated for the created channels, wherein the sequences have a consensus mechanism; the ordering service corresponding to the ordering service type is to select an ordering service corresponding to an address from a plurality of addresses of the ordering service for the created channel; the sorting services are in one-to-one correspondence with the initial blocks;
wherein the blockchain includes a Hyperledger Fabric blockchain;
a pluggable channel map is added in the sequencing service, and the pluggable channel map is used for maintaining a mapping relation between the channel and pluggable sequencing in the sequencing service;
the pluggable channel mapping is based on Config.yaml file configuration, multiple pluggable sequencing configurations are added in the Config.yaml file at the same time, and the multiple pluggable sequencing is initialized when the sequencing service is started;
and the application configuration of the Config.yaml file is also provided with a sequencing service type configuration which is used for selecting application channels and sharing types different from the initial block.
3. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the blockchain consensus mechanism configuration method according to claim 1 or the blockchain consensus mechanism configuration method according to claim 2 when executing the computer program.
4. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements the blockchain consensus scheme configuration method according to claim 1 or the blockchain consensus scheme configuration method according to claim 2.
CN202010414383.2A 2020-05-15 2020-05-15 Configuration method for consensus mechanism and endorsement strategy of block chain Active CN111669267B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010414383.2A CN111669267B (en) 2020-05-15 2020-05-15 Configuration method for consensus mechanism and endorsement strategy of block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010414383.2A CN111669267B (en) 2020-05-15 2020-05-15 Configuration method for consensus mechanism and endorsement strategy of block chain

Publications (2)

Publication Number Publication Date
CN111669267A CN111669267A (en) 2020-09-15
CN111669267B true CN111669267B (en) 2024-02-20

Family

ID=72383752

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010414383.2A Active CN111669267B (en) 2020-05-15 2020-05-15 Configuration method for consensus mechanism and endorsement strategy of block chain

Country Status (1)

Country Link
CN (1) CN111669267B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112769831B (en) * 2021-01-12 2023-08-08 欧冶云商股份有限公司 Block chain-oriented multichannel creation method in untrusted network environment
CN112865983B (en) * 2021-04-09 2024-06-07 杭州云象网络技术有限公司 Method and system for replacing alliance chain organization certificate
CN113269565B (en) * 2021-05-11 2024-01-16 深圳棠人科技有限公司 Anti-counterfeiting identification method and device for preventing identification code from being reused and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107360248A (en) * 2017-07-31 2017-11-17 众安信息技术服务有限公司 For configuring the method and apparatus locally known together and computer-readable recording medium
CN109033405A (en) * 2018-08-03 2018-12-18 华为技术有限公司 Safeguard method and apparatus, server and the computer readable storage medium of block chain
CN109858908A (en) * 2019-01-09 2019-06-07 暨南大学 Alliance's chain building method, method of commerce and distributed supply chain system
CN110012015A (en) * 2019-04-09 2019-07-12 中国科学院沈阳计算技术研究所有限公司 A kind of internet of things data sharing method and system based on block chain
CN110226168A (en) * 2017-09-29 2019-09-10 甲骨文国际公司 For providing the system and method for the interface of block chain cloud service
CN110505223A (en) * 2019-08-15 2019-11-26 腾讯科技(深圳)有限公司 Block chain multichain management method and device
CN110602138A (en) * 2019-09-26 2019-12-20 腾讯科技(深圳)有限公司 Data processing method and device for block chain network, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107360248A (en) * 2017-07-31 2017-11-17 众安信息技术服务有限公司 For configuring the method and apparatus locally known together and computer-readable recording medium
CN110226168A (en) * 2017-09-29 2019-09-10 甲骨文国际公司 For providing the system and method for the interface of block chain cloud service
CN109033405A (en) * 2018-08-03 2018-12-18 华为技术有限公司 Safeguard method and apparatus, server and the computer readable storage medium of block chain
CN109858908A (en) * 2019-01-09 2019-06-07 暨南大学 Alliance's chain building method, method of commerce and distributed supply chain system
CN110012015A (en) * 2019-04-09 2019-07-12 中国科学院沈阳计算技术研究所有限公司 A kind of internet of things data sharing method and system based on block chain
CN110505223A (en) * 2019-08-15 2019-11-26 腾讯科技(深圳)有限公司 Block chain multichain management method and device
CN110602138A (en) * 2019-09-26 2019-12-20 腾讯科技(深圳)有限公司 Data processing method and device for block chain network, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
区块链技术综述;张亮;刘百祥;张如意;江斌鑫;刘一江;;计算机工程(05);全文 *
基于区块链的信息网络信任支撑环境构建研究;周云;;信息安全与通信保密(04);全文 *

Also Published As

Publication number Publication date
CN111669267A (en) 2020-09-15

Similar Documents

Publication Publication Date Title
CN111669267B (en) Configuration method for consensus mechanism and endorsement strategy of block chain
CN109165945B (en) Representative node device election method and device, computer device and storage medium
CN108549580B (en) Method for automatically deploying Kubernets slave nodes and terminal equipment
CN110912707B (en) Block chain-based digital certificate processing method, device, equipment and storage medium
CN109472572B (en) Contract system based on block chain main chain and parallel multiple sub-chains
CN111008201B (en) Method and apparatus for parallel modification and reading of state trees
CN109493052B (en) Cross-chain contract system based on main chain and parallel multiple sub-chains
CN111460504B (en) Service processing method, device, node equipment and storage medium
CN110809042B (en) Intelligent contract fragmentation storage method based on de bruijn sequence generation technology
Vizier et al. Comchain: Bridging the gap between public and consortium blockchains
CN110046638B (en) Method, device and equipment for fusing data among multiple platforms
CN114978908A (en) Computing power network node evaluation and operation method and device
JP2020204898A (en) Method, system, and program for managing operation of distributed ledger system
CN112348518A (en) Block chain transaction certification method and device
CN113469371A (en) Federal learning method and device
CN110990790B (en) Data processing method and equipment
CN111640018B (en) Block chain transaction existence verification method and device
CN111262724B (en) Method and device for confirming trust relationship between domains
CN113626875A (en) Knowledge graph file storage method for block chain fragment enabling
CN108228197A (en) A kind of method and apparatus for installing software in the cluster
CN112181599A (en) Model training method, device and storage medium
CN112487487A (en) Authority management method, device, equipment and storage medium for member of block chain node
CN116938523A (en) Blockchain system, operating method, electronic device and storage medium
US20230291656A1 (en) Operation of a distributed deterministic network
CN114564530A (en) Database access method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant