WO2022242337A1 - 用于编辑区块链的方法和装置 - Google Patents

用于编辑区块链的方法和装置 Download PDF

Info

Publication number
WO2022242337A1
WO2022242337A1 PCT/CN2022/084715 CN2022084715W WO2022242337A1 WO 2022242337 A1 WO2022242337 A1 WO 2022242337A1 CN 2022084715 W CN2022084715 W CN 2022084715W WO 2022242337 A1 WO2022242337 A1 WO 2022242337A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
nodes
public key
data
editing
Prior art date
Application number
PCT/CN2022/084715
Other languages
English (en)
French (fr)
Inventor
王东晖
刘斐
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP22803662.0A priority Critical patent/EP4318287A1/en
Publication of WO2022242337A1 publication Critical patent/WO2022242337A1/zh
Priority to US18/513,014 priority patent/US20240089132A1/en

Links

Images

Classifications

    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or 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/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • 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
    • 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

Definitions

  • the present application relates to the field of information technology, and more particularly, to a method and device for editing a block chain.
  • Blockchain (block chain, BC) can be understood as a tamper-proof decentralized ledger for recording transactions (transaction, TX) in the network. Specifically, transactions are generated and stored in units of blocks, and are connected into a chain structure in chronological order. Use the block to record the transaction, the block and the block are linked by the hash algorithm, record the history of the transaction between the peer nodes in the network, and the confirmed and proved transaction starts from the beginning of the block chain Blocks are linked to the latest block.
  • the non-tamperable modification of the blockchain may cause bad information to bring large-scale, persistent or even permanent negative effects.
  • Blockchain may become an effective way to avoid supervision and release bad information.
  • This application provides a method and device for editing a block chain.
  • the node with the endorsement function in the block chain endorses the editing request, and sends the endorsement result to the node with the editing function.
  • Block chain editor provides a method and device for editing a block chain.
  • a method for editing a blockchain is provided, and the method for editing a blockchain can be executed by a first node, or can also be executed by a chip or a circuit provided in the first node, This application is not limited to this.
  • the methods for editing the blockchain include:
  • the first node receives the request message, and the request message is used to request to edit the data, the data includes transactions or blocks; the first node endorses the request message to generate an endorsement result; the first node sends at least one second The nodes send the endorsement results respectively, and the at least one second node belongs to the second node set; wherein, the first node is any node among multiple nodes with endorsement function in the block chain, and the at least one second node Each second node in knows the private key segment corresponding to the second node and the public key corresponding to the second node set, and the public key is determined according to at least one public key segment corresponding to the at least one second node .
  • the method for editing the block chain uses nodes with the endorsement function in the block chain to endorse the editing request, and sends the endorsement result to the node with the editing function, so as to realize block chaining under the premise of improving security. chain editor.
  • the method before the first node sends the endorsement result to the at least one second node respectively, the method further includes: the first node determines the first node according to the data Two node sets; or, the first node determines the second node set according to an identifier carried in the request message, and the identifier is used to indicate the second node set.
  • the first node can determine the second node set through the data that needs to be modified and/or the identification of the second node set, providing a flexible method for determining the second node set Program.
  • the method further includes: the first node verifies hash collision according to the first hash value and the first random number, where the first hash value and The first random number is obtained according to at least one second hash value and at least one second random number, and the at least one second hash value and at least one second random number are each second node in the at least one second node Calculated based on the chameleon hash private key fragment corresponding to the second node.
  • nodes in the block chain verify hash collisions to improve the security of the scheme.
  • the method before the first node receives the request message, the method further includes: the first node receives the data; The data is verified, and the verification includes hashing and signing based on the public key.
  • the method for editing a blockchain provided in the embodiment of the present application also provides a data upload process.
  • the method before the first node verifies the data according to the public key, the method further includes: the first node determines the second node set; the first node A node determines the public key based on the second set of nodes.
  • the key for verification by the endorsement node is determined according to the set of editing nodes, which improves the security of the scheme.
  • the first node determining the second node set includes: the first node determining the second node set according to preconfiguration information, the preconfiguration information indicating that the data Corresponding to the second set of nodes; or, the first node determines the second set of nodes according to an identifier, where the identifier is used to indicate the second set of nodes.
  • the first node can determine the second node set by requiring pre-configuration information and/or the identification of the second node set, providing a flexible solution for determining the second node set .
  • the method further includes: the first node sends a response message to the client, where the response message includes an editing result corresponding to the data.
  • the first node can notify the client after the editing is completed.
  • the blockchain includes a consortium chain.
  • the blockchain involved in this application is an alliance chain.
  • a method for editing a block chain is provided.
  • the method for editing a block chain can be executed by a client, or can also be executed by a chip or a circuit set in the client.
  • the present application There is no limit to this.
  • the methods for editing the blockchain include:
  • the client sends a request message to multiple nodes respectively, the request message is used to request to edit the data, the data includes blocks or transactions, the request message includes an identifier, and the identifier is used to indicate the second set of nodes; the client Respectively receive response messages from the plurality of nodes, the response messages include editing results corresponding to the data; wherein, the second node set includes at least one second node, and each second node in the at least one second node
  • the private key slice (tki) corresponding to the second node and the public key corresponding to the second node set are known, and the public key is determined according to at least one public key slice (hki) respectively corresponding to the at least one second node.
  • the client when it needs to modify a certain data, it can send a request message to the node with the endorsement function, and carry an identifier indicating the set of editing nodes in the request message, In order to make the node with endorsement function in the blockchain endorse the editing request, send the endorsement result to the node with editing function, and realize blockchain editing under the premise of improving security.
  • the method before the client sends request messages to the multiple nodes respectively, the method further includes: the client sends the data to the multiple nodes respectively; the client The verification results from the plurality of nodes are respectively received, wherein the verification results include hash calculation and signature results based on the public key.
  • the method for editing a blockchain provided in the embodiment of the present application also provides a data upload process.
  • a method for editing a blockchain is provided, and the method for editing a blockchain may be executed by a second node, or may also be executed by a chip or a circuit provided in the second node, This application is not limited to this.
  • the methods for editing the blockchain include:
  • the second node generates private key fragments and public key fragments corresponding to the second node; the second node sends the second node corresponding to the second node to other second nodes in the second node set except the second node
  • the public key fragment of the second node; the second node receives the public key fragments corresponding to the other second nodes sent by other second nodes in the second node set except the second node; the second node according to The public key fragments corresponding to at least one second node in the second set are respectively calculated to obtain the public key corresponding to the second node set; the second node sends the public key to the nodes in the block chain.
  • the key required for endorsement or verification is provided by the editing node, which improves the security of the scheme.
  • the method further includes: the second node receives the endorsement results from the request messages respectively sent by the multiple nodes, the request messages are used to request editing of the data,
  • the data includes transactions or blocks; after the second node determines that the number of endorsement results received meets the preset value, the second node calculates the corresponding A second hash value and a second random number; the second node receives second hash values corresponding to the other second nodes sent by other second nodes in the second node set except the second node and the second random number; the second node calculates the first hash value and the first random number according to the second hash value and the second random number respectively corresponding to at least one second node in the second set; the first hash value and the first random number; The second node sends the first hash value and the first random number to nodes in the block chain, wherein the multiple nodes are nodes in the block chain that verify transactions.
  • a device for editing a blockchain includes a processor, configured to implement the function of the first node in the method described in the first aspect above.
  • the device for editing the block chain may further include a memory, the memory is coupled with the processor, and the processor is configured to implement the function of the first node in the method described in the first aspect above.
  • the memory is used to store program instructions and data.
  • the memory is coupled with the processor, and the processor can call and execute the program instructions stored in the memory, so as to realize the function of the first node in the method described in the first aspect above.
  • the device for editing the block chain may also include a communication interface, which is used for the device for editing the block chain to communicate with other devices.
  • the communication interface may be a transceiver, an input/output interface, or a circuit.
  • the device for editing blockchain includes: a processor and a communication interface
  • the processor is used to run a computer program, so that the device for editing the blockchain implements any one of the methods described in the first aspect above;
  • the processor communicates with the outside through the communication interface.
  • the external may be an object other than the processor, or an object other than the device.
  • the device for editing the block chain is a chip or a chip system.
  • the communication interface may be an input/output interface, an interface circuit, an output circuit, an input circuit, pins or related circuits on the chip or the chip system.
  • the processor may also be embodied as a processing circuit or logic circuit.
  • a device for editing a blockchain includes a processor, configured to implement the functions of the client in the method described in the second aspect above.
  • the device for editing the block chain may further include a memory, the memory is coupled with the processor, and the processor is configured to realize the function of the client in the method described in the second aspect above.
  • the memory is used to store program instructions and data.
  • the memory is coupled with the processor, and the processor can call and execute the program instructions stored in the memory, so as to implement the functions of the client in the method described in the second aspect above.
  • the device for editing the block chain may also include a communication interface, which is used for the device for editing the block chain to communicate with other devices.
  • the communication interface may be a transceiver, an input/output interface, or a circuit.
  • the device for editing blockchain includes: a processor and a communication interface
  • the processor is used to run a computer program, so that the device for editing the blockchain implements any one of the methods described in the first aspect above;
  • the processor communicates with the outside through the communication interface.
  • the external may be an object other than the processor, or an object other than the device.
  • the device for editing the block chain is a chip or a chip system.
  • the communication interface may be an input/output interface, an interface circuit, an output circuit, an input circuit, pins or related circuits on the chip or the chip system.
  • the processor may also be embodied as a processing circuit or logic circuit.
  • a device for editing a blockchain includes a processor configured to implement the function of the second node in the method described in the third aspect above.
  • the device for editing the block chain may further include a memory, the memory is coupled with the processor, and the processor is configured to realize the function of the second node in the methods described in the third aspect and the fourth aspect above.
  • the memory is used to store program instructions and data.
  • the memory is coupled with the processor, and the processor can call and execute program instructions stored in the memory, so as to realize the function of the second node in the method described in the third aspect above.
  • the device for editing the block chain may also include a communication interface, which is used for the device for editing the block chain to communicate with other devices.
  • the communication interface may be a transceiver, an input/output interface, or a circuit.
  • the device for editing blockchain includes: a processor and a communication interface
  • the processor communicates with the outside through the communication interface
  • the processor is used to run a computer program, so that the device for editing the blockchain implements any method described in the third aspect above.
  • the external may be an object other than the processor, or an object other than the device.
  • the device for editing the block chain is a chip or a chip system.
  • the communication interface may be an input/output interface, interface circuit, output circuit, input circuit, pin or related circuit on the chip or chip system.
  • the processor may also be embodied as a processing circuit or logic circuit.
  • the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, it causes the computer to execute the method of the above aspects.
  • the present application provides a computer program product including instructions, which, when run on a computer, cause the computer to execute the method of the above aspects.
  • a communication system including the device for editing a block chain shown in the fourth aspect to the sixth aspect.
  • a chip device including a processing circuit, the processing circuit is used to call and run a program from the memory, so that the communication device installed with the chip device can perform any one of the possibilities in the first to third aspects above. method in the implementation.
  • Figure 1 is a schematic diagram of a blockchain.
  • Fig. 2 is a schematic diagram of the linking method between blocks.
  • Fig. 3 is a schematic diagram of a consortium chain including nodes.
  • Fig. 4 is a schematic diagram of a block rewriting method.
  • Fig. 5 is a schematic flowchart of a transaction on-chain provided by this application.
  • Fig. 6 is a schematic flowchart of a method for editing a block chain provided by the present application.
  • FIG. 7 is a schematic diagram of a device 700 for editing a block chain proposed by this application.
  • Fig. 8 is a schematic structural diagram of a first node applicable to this embodiment of the present application.
  • FIG. 9 is a schematic diagram of a device 900 for editing a block chain proposed by the present application.
  • Fig. 10 is a schematic structural diagram of a second node applicable to this embodiment of the present application.
  • Fig. 11 is a schematic diagram of a device 1100 for editing a block chain proposed by this application.
  • Fig. 12 is a schematic structural diagram of a client applicable to the embodiment of the present application.
  • FIG. 1 is a schematic diagram of the blockchain.
  • Fig. 2 is a schematic diagram of the linking method between blocks.
  • Blockchain technology implements a chained data structure that connects data and information blocks sequentially in chronological order, and cryptographically guaranteed non-tamperable and unforgeable distributed storage.
  • transactions the data and information in the blockchain are called "transactions”.
  • Blockchain technology is not a single technology, but a system of point-to-point transmission, consensus mechanism, distributed data storage and integrated application of cryptography principles.
  • the system has the technical characteristics of full disclosure and tamper-proof.
  • point-to-point transmission The nodes participating in the blockchain are independent and peer-to-peer, and the synchronization of data and information is realized between nodes through point-to-point transmission technology. Nodes can be different physical machines or different instances in the cloud.
  • the consensus mechanism of the blockchain refers to the process in which nodes participating in multiple parties reach agreement on specific data and information through the interaction between nodes under preset logic rules.
  • the consensus mechanism needs to rely on a well-designed algorithm, so different consensus mechanism performance (such as: transaction throughput transaction per second (TPS), delay in reaching consensus, consumed computing resources, consumed transmission resources, etc. ) there are certain differences.
  • TPS transaction throughput transaction per second
  • distributed data storage means that the nodes participating in the blockchain each have independent and complete data, which ensures that the data storage is fully open among the nodes.
  • traditional distributed data storage divides data into multiple copies for backup or synchronous storage according to certain rules, while blockchain distributed data storage relies on peer-to-peer, Consensus between independent nodes to achieve highly consistent data storage.
  • Blockchain is usually based on asymmetric encryption technology to achieve credible information dissemination, verification, etc.
  • each “block” includes two parts: “block header” and “block body”, where “block body” contains the transaction records packed into the “block”; “block header” contains " The root hash of all transactions in the “block” and the hash of the previous “block”.
  • the data structure of the blockchain ensures that the data stored on the blockchain is immutable.
  • Blockchains can currently be divided into three categories: public chains, alliance chains, and private chains.
  • the public chain means that any bookkeeping node (peer) can be used as a consensus node (also called a consensus computing node) of the blockchain, and then participate in the consensus calculation of blockchain data storage and maintain the blockchain anonymously. Nodes do not trust each other.
  • peer can be used as a consensus node (also called a consensus computing node) of the blockchain, and then participate in the consensus calculation of blockchain data storage and maintain the blockchain anonymously. Nodes do not trust each other.
  • the consortium chain adds access permissions on the basis of the public chain, so that nodes with certain qualifications can be used as consensus computing nodes of the blockchain, and then participate in the consensus calculation of the blockchain data storage and maintain the blockchain. There is a certain amount of trust with the nodes.
  • the access mechanism of the private chain is more stringent, making the blockchain and the consensus computing nodes of the blockchain unique to private individuals.
  • FIG. 3 is a schematic diagram of the alliance chain including nodes.
  • the alliance chain is composed of peer nodes (as shown in Figure 3, including P#1, P#2, P#3, P#4, P#5...P#n), where the peer node carries
  • the ledger and smart contract are used to record the transaction process in a non-tamperable way through the smart contract ledger.
  • the smart contract and ledger are used to encapsulate the shared processing and shared information in the entire network.
  • each peer node can host one or more ledgers and one or more smart contracts.
  • the above-mentioned peer nodes are further divided into endorsement nodes, bookkeeping nodes, and sorting nodes.
  • the endorsement nodes are bound to contracts to check and endorse transaction proposals and calculate the results of transaction execution;
  • All peer nodes are bookkeeping nodes, which are used to recheck the legality of the transaction and write the modification of the ledger to the blockchain before accepting the transaction results;
  • the ordering nodes sort the transactions sent to the network, and sort the transactions according to The agreement in the configuration is sorted into blocks and then submitted to the confirmation node for processing.
  • Fig. 1 and Fig. 2 are only exemplary illustrations of the blockchain technology involved in the embodiment of the present application, and Fig. 3 only exemplarily points out that the consortium chain includes multiple nodes, which does not constitute any limitation on the scope of protection of the present application.
  • the specific definitions of block chain and consortium chain can refer to the relevant description in the current technology, and this application will not go into details.
  • the blockchain is open, transparent and non-tamperable.
  • the non-tamperable modification of the blockchain may cause some problems in the actual blockchain deployment, such as:
  • GDPR stipulates that data subjects enjoy the rights of "data to be forgotten” and “data portability”. Request the third party to stop processing the data.
  • FIG. 4 is a schematic diagram of a block rewriting method.
  • the original blockchain contains blocks B#0, B#1, B#2, B#3...B#n.
  • the method shown in Figure 4 uses the chameleon hash to update the block, but it does not consider security enough, and there are still some deficiencies.
  • the block rewriting method adopts a single trapdoor mechanism, and the trapdoor owner has full control over the modification rights.
  • this application proposes a method for editing the blockchain, which endorses the editing request through the node with the endorsement function in the blockchain, and sends the endorsement result to the node with the editing function Nodes can realize block chain editing under the premise of improving security.
  • the security requirements that Chameleon hashing satisfies include:
  • Semantic security For any message m1m2, the probability distributions of Hash(HK,m1,r1) and Hash(HK,m2,r2) are indistinguishable. In particular, when r is randomly selected, from Hash(HK,m, r) No information about m can be obtained.
  • Chameleon Hash can artificially set up a "weakness" or "backdoor". After mastering this backdoor, hash collisions can be easily found. To a certain extent, it destroys the two collision characteristics of the hash function, and at the same time, it also destroys the non-tamperable characteristics of the blockchain based on the hash function, but it also expands the application scenarios of the blockchain, and for different For ordinary users who know the threshold, it is still not feasible to find collisions. That is to say, the security of Chameleon Hash can also be guaranteed. For managers with "backdoors", if they tamper with blocks at will, It can also be verified by verifying that the hashes of the two blocks are equal.
  • a smart contract is a computer protocol designed to communicate, verify or enforce contracts in an informational manner. All users on the blockchain can see the smart contracts based on the blockchain. However, this causes all vulnerabilities, including security holes, to be visible and may not be fixed quickly.
  • the rules are open and transparent, and the rules and data in the contract are visible to the outside; all transactions are publicly visible, and there will be no false or hidden transactions.
  • Blockchain technology has the characteristics of "openness and transparency” and “non-tamperable” which are endowed by smart contracts to blockchain. Smart contracts allow for trusted transactions without third parties, which are traceable and irreversible. Smart contracts are based on immutable data and can automatically execute some pre-defined rules and terms.
  • the consensus mechanism is how to reach a consensus among all accounting nodes to determine the validity of a record. This is not only a means of identification, but also a means of preventing tampering.
  • the blockchain proposes four different consensus mechanisms, which are suitable for different application scenarios and strike a balance between efficiency and security.
  • Transactions on the chain means that transactions are packaged in a block through the consensus mechanism to become a new block, and linked to the previous block, becoming an unchangeable transaction on the chain.
  • Endorsement in the blockchain can be understood as the process and mechanism for the endorsement node undertaking the endorsement task to verify the transaction information for the blockchain transaction, and declare the transaction to be legal for the verified transaction.
  • the transaction needs to be endorsed by the endorsement node first, then the transaction is sorted, and finally the ledger is updated using the ordered transaction.
  • the endorsement policy verification process includes:
  • the initiator application When initiating a transaction, the initiator application generally calls the software development kit (SDK) to specify the transaction proposal and send it to one or more endorsement nodes for endorsement verification.
  • SDK software development kit
  • the endorsement node that receives the proposal is specified in the transaction proposal request of the SDK. If not specified, the transaction proposal request will be sent to all nodes joining the channel (channel), and the client application will wait for the return of the endorsement node after sending;
  • the endorsement node After the endorsement node receives the proposal, it first performs some checks and signature verification, including verifying its signature with the public key of the client (SDK), verifying whether the client can operate on the channel, whether the transaction has been submitted, and the transaction proposal Is the organization correct. After the verification is passed, simulate and execute the chaincode (chaincode) to generate a proposal result, and endorse the result, that is, add a digital signature to the result and sign the result with a private key;
  • SDK public key of the client
  • chaincode chaincode
  • the client After the client (SDK) receives the results of enough endorsement nodes, it indicates that the transaction has been correctly endorsed, and then packages the transaction proposal, simulation results and endorsement information to the ordering node; if the client does not collect enough endorsement nodes Feedback endorsement information, the transaction will be discarded;
  • the ordering node sorts the information from the client (SDK), creates blocks, and then broadcasts them on the channel channel;
  • the peer node on the channel After the peer node on the channel receives the transaction block, it verifies whether the endorsement policy is satisfied, and then updates the ledger. At this point, the verification process of the endorsement policy is completed.
  • the embodiments shown below do not specifically limit the specific structure of the execution subject of the method provided by the embodiment of the present application, as long as the program that records the code of the method provided by the embodiment of the present application can be run to provide the method according to the embodiment of the present application.
  • the method of editing (or rewriting, or modifying) the block chain is enough.
  • the execution subject of the method provided by the embodiment of this application can be a computer, a server, or a functional module in a computer or a server that can call a program and execute the program. .
  • for indicating can be understood as “enabling”, and “enabling” can include direct enabling and indirect enabling.
  • enabling can include direct enabling and indirect enabling.
  • information for enabling A it may include that the information directly enables A or indirectly enables A, but it does not mean that A must be carried in the information.
  • the information enabled by the information is called the information to be enabled.
  • the information to be enabled can be directly enabled, such as to be enabled The information itself or the index of the information to be enabled, etc.
  • the to-be-enabled information may also be indirectly enabled by enabling other information, where there is an association relationship between the other information and the to-be-enabled information. It is also possible to enable only a part of the information to be enabled, while other parts of the information to be enabled may be known or agreed in advance.
  • specific information can also be enabled by means of a pre-agreed (for example, protocol-specified) arrangement order of each information, thereby reducing the enabling overhead to a certain extent.
  • a pre-agreed arrangement order of each information for example, protocol-specified
  • common parts of each information can be identified and enabled uniformly, so as to reduce the enabling overhead caused by enabling the same information separately.
  • preset may include pre-definition, for example, protocol definition.
  • predefinition for example, protocol definition.
  • “predefine” can be realized by pre-saving corresponding codes, tables or other methods that can be used to indicate related information in devices (for example, including nodes), and this application does not limit its specific implementation.
  • the "storage" mentioned in the embodiment of the present application may refer to saving in one or more memories.
  • the one or more memories may be provided independently, or may be integrated in an encoder or decoder, a processor, or a communication device.
  • a part of the one or more memories may also be provided separately, and a part may be integrated in a decoder, a processor, or a communication device.
  • the type of the storage may be any form of storage medium, which is not limited in this application.
  • Fig. 5 is a schematic flowchart of a transaction on-chain provided by this application. Include the following steps:
  • the client sends a transaction uplink request to the endorsement node.
  • the client sends a transaction on-chain request to an endorsement node as an example.
  • the client creates a transaction, and sends a transaction on-chain request to the endorsement node set selected by the exchange, and the endorsement node set includes at least one endorsement node.
  • the client may send transaction uplink requests to the endorsement nodes in the endorsement node set at the same time, or the client may not send transaction uplink requests to the endorser nodes in the endorsement node set at the same time.
  • the transaction on-chain request includes the smart contract ID (smart contract ID), transaction content (TX content) and signature (sign).
  • the smart contract identifier can also be called an identifier, and is used to specify the second set of nodes corresponding to the transaction. It should be understood that the identifier used to specify the second node set may also have other forms, and the smart contract ID shown in this embodiment is only an example, and does not constitute any limitation on the protection scope of the present application.
  • the alliance chain involved in the embodiment of the present application is different from the alliance chain shown in Figure 3 in that: the alliance chain involved in the embodiment of the present application includes a second node (also called an editing node).
  • the defined editing node is explained:
  • the editing node is a node in the alliance chain that has the authority to modify the block and has the public and private key fragments of Chameleon.
  • the edit node set includes multiple edit nodes, which can be understood as a set of nodes that can jointly perform editing work.
  • One or more edit node sets can be set in the consortium chain, and each edit node set ID is in one-to-one correspondence with the edit node list.
  • Edit node set #1 includes ⁇ node #a, node #b, node #c ⁇ , the chameleon hashing algorithm is as follows:
  • Node #a retains private key fragment tk a
  • node #b retains private key fragment tk b
  • node #c retains private key fragment tk c
  • node #a broadcasts public key fragment hk a in the blockchain
  • node #b broadcasts the public key segment hk b in the blockchain
  • node #c broadcasts the public key segment hk c in the blockchain.
  • Editing node set #2 and/or editing node set #3 can also be set in the alliance chain , wherein, edit node set #2 includes ⁇ node m, node n, node t ⁇ ; edit node set #3 includes ⁇ node m, node n, node t ⁇ .
  • edit node set #1 For example, in the consortium chain, there are edit node set #1, edit node set #2, and edit node set #3.
  • the identifier of edit node set #1 is edit node set ID #1. a, corresponding to node #b, node #c; edit node set #2 is identified as edit node set ID #2, edit node set ID #2 corresponds to node #e, node #f, node #g; edit node set #
  • the identifier of 3 is edit node set ID#3, and edit node set ID#3 corresponds to node #h, node #i, and node #j.
  • the identifier may be edit node set ID#1, indicating node #a, node #b, and node #c.
  • the endorsement node receives the transaction on-chain request, it performs the following steps S520 to S550:
  • the endorsement node decides whether the transaction on-chain request passes the endorsement.
  • This application mainly involves transaction on-chain request through endorsement.
  • the endorsement node When the transaction on-chain request passes the endorsement, the endorsement node generates the endorsement result: simulate the transaction, use the public key hk corresponding to the ID of the second node set specified by the transaction to perform chameleon hash calculation, and sign.
  • the endorsement node sends the endorsement result to the client.
  • the ordering node After the ordering node receives the transaction request, it executes:
  • Fig. 6 is a schematic flowchart of a method for editing a block chain provided by the present application.
  • the method for editing a blockchain provided in the embodiment of the present application can be applied to a consortium chain for editing a consortium chain; or it can also be applied to a public chain or a private chain.
  • the blockchain involved in the embodiment of the present application includes at least one endorsement node.
  • the endorsement nodes defined in the consortium chain mentioned in the current related technologies for example, the nodes that can be used to implement the endorsement function can be defined in the public chain or private chain.
  • the endorsement nodes in the blockchain are currently existing or newly added. It is only necessary that the blockchain includes at least one node capable of implementing the endorsement function.
  • the data editing method based on the consortium chain is taken as an example below.
  • the data editing in other types of blockchains is similar to the data editing in the consortium chain, and will not be repeated in this application.
  • the method for editing blockchain includes at least some of the following steps:
  • the first node receives a request message, where the request message is used to request editing data.
  • the data involved in this application includes transactions or blocks, and the first node is any one of multiple nodes with an endorsement function in the blockchain.
  • the first node receives the request message from the client, or the client sends the request message to the first node.
  • the client determines that the data needs to be edited, and sends a request message to the set of endorsing nodes selected by the data, and the set of endorsing nodes includes the first node.
  • the client may send the first request message to the endorsing nodes in the set of endorsing nodes at the same time, or the client may not send the first request message to the endorsing nodes in the set of endorsing nodes at the same time.
  • there is no limitation on how the client creates data and how to send a request message to the endorser nodes in the endorser node set and reference can be made to the descriptions in the current related technologies, which will not be repeated here.
  • the client sends a request message to the first node as an example.
  • the client can also send other endorsement nodes in the endorsement node set (for example, the second endorsement node and (or the third endorsement node) sends the request message, and other endorsement nodes receive the request message and perform steps based on the request message are similar to the first node receiving the request message and performing steps, which will not be repeated in this application.
  • This request message may be called a data editing request message, or may be called a propose (propose) message.
  • the request message is used to request the first node to edit data.
  • the client involved in this embodiment of the present application may be an application program or a user.
  • the request message includes an identifier, where the identifier is used to identify a second node set corresponding to the above data, where the second node set includes at least one second node.
  • the at least one second node corresponding to the data involved in this embodiment of the present application refers to an editing node capable of editing the data.
  • the identification may respectively indicate an identification (identify, ID) of at least one second node corresponding to the data; or,
  • the identifier indicates the smart contract identifier (smart contract ID) corresponding to the data; or,
  • the identifier indicates an identifier of a second node set to which at least one second node corresponding to the data belongs.
  • the request message also includes data content (content) and a signature (signature), and the signature information is used to protect the request message.
  • content data content
  • signature signature
  • the request message in the embodiment of this application can be understood as the propose message sent by the client to the endorsement node in the current blockchain technology.
  • the request message in the embodiment of the application includes the above-mentioned identification, while the propose message does not The identifier for identifying the editing node is not included, so the request message in the embodiment of the present application can reuse the current propose message and add an identifier in the propose message, or reuse the existing information in the propose message to identify the editing node.
  • the method flow shown in FIG. 6 also includes:
  • the first node endorses the request message, and generates an endorsement result.
  • the first node After the first node receives the above request message, it decides whether to pass the endorsement, and if so, generates the endorsement result: simulate the transaction, use the public key corresponding to the identity of the second node set specified by the data to perform hash calculation, and sign.
  • the endorsement node also needs to verify the signature of the request message and whether it complies with the channel ACL.
  • the method flow shown in Figure 6 also includes:
  • the first node also needs to determine that the request message has permission to request data modification.
  • the method flow shown in Figure 6 also includes:
  • the first node determines that the client sending the request message has the right to modify the data.
  • the client may be the client that initiates the data uplink request.
  • the first node verifies the signature of the request message, and if the verification is passed, it is determined that the request message has permission to request data modification.
  • the first node needs to send the endorsement result to the editing node, and the method flow shown in Figure 6 also includes:
  • the first node sends the endorsement results to at least one second node respectively.
  • At least one second node belongs to the second node set, and the second node has an editing function.
  • Each second node in the at least one second node knows its corresponding private key segment and the public key corresponding to the second node set, and the public key is determined according to at least one public key segment corresponding to the at least one second node.
  • the set of second nodes may be determined in the following manner.
  • Mode 1 the first node determines the second node set according to the data.
  • the first node determines the second node set determined during the data uplink process as the second node set.
  • Mode 2 The first node determines the second node set according to the identifier, the identifier is carried in the request message, and the identifier is used to indicate the second node set.
  • the second node determines that the number of received endorsement results satisfies a preset value.
  • multiple first nodes all execute the above-mentioned endorsement process, and send the endorsement structure to the second nodes in the second node set respectively.
  • the second node After the second node determines that it has received endorsements from enough endorsement nodes, it uses the private key to calculate the second hash value and the second random number corresponding to itself.
  • the second set of nodes includes ⁇ the second node #a, the second node #b, the second node #c ⁇ , the algorithm of the second hash value h i and the second random number R i is as follows:
  • the second node calculates the first hash value and the second random number according to the second hash value and the second random number corresponding to itself, and the second hash values and the second random numbers respectively corresponding to other second nodes in the second node set. the first random number.
  • H h a & h b & h c .
  • the method flow shown in FIG. 6 also includes:
  • the sorting node writes the sorting.
  • the method flow shown in Figure 6 also includes:
  • the edit history of the blockchain can also be recorded.
  • editing result may be returned to the client, and the method flow shown in FIG. 6 also includes:
  • the editing result may be indication information for editing success; or, the editing result may be an editing response message.
  • serial numbers of the above-mentioned processes do not mean the order of execution, and the execution order of each process should be determined by its functions and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application . And it may not be necessary to perform all the operations in the above method embodiments.
  • the method implemented by the first node can also be implemented by components (such as chips or circuits) that can be used for the first node, and the method implemented by the second node can also be implemented by available implemented in the components of the second node.
  • FIG. 7 is a schematic diagram of a device 700 for editing a block chain proposed by the present application.
  • the device 700 includes an endorsement unit 710 , a receiving unit 720 , and a sending unit 730 .
  • the receiving unit 720 is configured to receive a request message, the request message is used to request editing data, the data includes transactions or blocks;
  • an endorsement unit 710 configured to endorse the request message and generate an endorsement result
  • a sending unit 730 configured to respectively send the endorsement result to at least one second node, where the at least one second node belongs to the second node set;
  • the first node is any node among multiple nodes with endorsement function in the blockchain
  • Each second node in the at least one second node knows the private key segment corresponding to the second node and the public key corresponding to the second node set, and the public key is based on the at least one corresponding to the at least one second node A public key shard is determined.
  • the unit also includes:
  • the processing unit 740 is configured to determine that the request message has permission to request modification of the data.
  • the endorsement unit 710 and the processing unit 740 can be one unit, and can realize the endorsement function and the processing function.
  • the apparatus 700 completely corresponds to the first node in the method embodiment, and the apparatus 700 may be the first node in the method embodiment; or the apparatus 700 may be a chip or a functional module inside the first node in the method embodiment. Corresponding units of the apparatus 700 are configured to perform corresponding steps performed by the first node in the method embodiment shown in FIG. 5 or FIG. 6 .
  • the processing unit 740 in the apparatus 700 executes the steps implemented or processed inside the first node in the method embodiment.
  • the receiving unit 720 executes the step of receiving by the first node in the method embodiment.
  • the sending unit 730 executes the steps sent by the first node in the method embodiment.
  • the sending unit 730 and the receiving unit 720 can form a transceiver unit, which has the functions of receiving and sending at the same time.
  • the sending unit 730 may be a transmitter
  • the receiving unit 720 may be a receiver. Receivers and transmitters can be integrated together to form a transceiver.
  • FIG. 8 is a schematic structural diagram of a first node applicable to this embodiment of the present application.
  • the first node includes a processor 810 , a memory 820 , and a transceiver 830 .
  • the processor is used to control the transceiver to send and receive information
  • the memory is used to store the computer program
  • the processor is used to call and run the computer program from the memory, so as to execute the method performed by the first node in the method for editing the block chain proposed by this application. corresponding processes and/or operations. I won't repeat them here.
  • FIG. 8 only shows a memory and a processor. In a real system, there may be multiple processors and memories.
  • a storage may also be called a storage medium or a storage device, etc., which is not limited in this embodiment of the present application.
  • FIG. 9 is a schematic diagram of a device 900 for editing a block chain proposed by the present application.
  • an apparatus 900 includes a processing unit 910 , a receiving unit 920 , and a sending unit 930 .
  • a processing unit 910 configured to generate private key fragments and public key fragments corresponding to the second node
  • a sending unit 930 configured to send the public key fragment corresponding to the second node to other second nodes in the second node set except the second node;
  • a receiving unit 920 configured to receive public key fragments respectively corresponding to the other second nodes sent from other second nodes in the second node set except the second node;
  • the processing unit 910 is further configured to calculate and obtain the public key corresponding to the second node set according to the public key fragments respectively corresponding to at least one second node in the second set;
  • the sending unit is also used to send the public key to the nodes in the block chain.
  • the apparatus 900 completely corresponds to the second node in the method embodiment, and the apparatus 900 may be the second node in the method embodiment; or the apparatus 900 may be a chip or a functional module inside the second node in the method embodiment.
  • the corresponding units of the apparatus 900 are configured to execute corresponding steps performed by the second node in the method embodiment shown in FIG. 5 or FIG. 6 .
  • the processing unit 910 in the apparatus 900 executes the steps implemented or processed inside the second node in the method embodiment.
  • the receiving unit 920 executes the step of receiving by the second node in the method embodiment.
  • the sending unit 930 executes the steps sent by the second node in the method embodiment.
  • the sending unit 930 and the receiving unit 920 can form a transceiver unit, which has functions of receiving and sending at the same time.
  • the sending unit 930 may be a transmitter
  • the receiving unit 920 may be a receiver. Receivers and transmitters can be integrated together to form a transceiver.
  • FIG. 10 is a schematic structural diagram of a second node applicable to this embodiment of the present application.
  • the second node includes a processor 1010 , a memory 1020 , and a transceiver 1030 .
  • the processor is used to control the transceiver to send and receive information
  • the memory is used to store the computer program
  • the processor is used to call and run the computer program from the memory, so as to execute the second node in the method for editing the block chain proposed by this application. corresponding processes and/or operations. I won't repeat them here.
  • FIG. 10 only shows a memory and a processor. In a real system, there may be multiple processors and memories.
  • a storage may also be called a storage medium or a storage device, etc., which is not limited in this embodiment of the present application.
  • FIG. 11 is a schematic diagram of a device 1100 for editing a blockchain proposed by the present application.
  • an apparatus 1100 includes a receiving unit 1110 and a sending unit 1120 .
  • the sending unit 1120 is configured to send a request message to a plurality of nodes respectively, the request message is used to request editing of data, the data includes blocks or transactions, and the request message includes an identifier, the identifier is used to indicate the second set of nodes ;
  • the receiving unit 1110 is configured to receive response messages from the plurality of nodes, the response messages include editing results corresponding to the data;
  • the second node set includes at least one second node, and each second node in the at least one second node knows the private key fragment corresponding to the second node and the public key corresponding to the second node set,
  • the public key is determined according to at least one public key fragment respectively corresponding to the at least one second node.
  • the apparatus 1100 completely corresponds to the client in the method embodiment, and the apparatus 1100 may be the client in the method embodiment; or the apparatus 1100 may be a chip or a functional module inside the client in the method embodiment.
  • the corresponding units of the apparatus 1100 are configured to execute corresponding steps performed by the client in the method embodiment shown in FIG. 5 or FIG. 6 .
  • the apparatus 1100 may further include a processing unit, configured to execute the steps implemented or processed inside the client in the method embodiment.
  • the receiving unit 1110 executes the steps of receiving by the client in the method embodiment.
  • the sending unit 1120 executes the steps of client sending in the method embodiment.
  • the sending unit 1120 and the receiving unit 1110 can form a sending and receiving unit, and have functions of receiving and sending at the same time.
  • the sending unit 1120 may be a transmitter
  • the receiving unit 1110 may be a receiver. Receivers and transmitters can be integrated together to form a transceiver.
  • FIG. 12 is a schematic structural diagram of a client applicable to an embodiment of the present application.
  • the client includes a processor 1210 , a memory 1220 , and a transceiver 1230 .
  • the processor is used to control the transceiver to send and receive information
  • the memory is used to store the computer program
  • the processor is used to call and run the computer program from the memory, so as to execute the corresponding functions executed by the client in the method for editing the block chain proposed by this application. process and/or operation. I won't repeat them here.
  • FIG. 12 only shows a memory and a processor. In a real system, there may be multiple processors and memories.
  • a storage may also be called a storage medium or a storage device, etc., which is not limited in this embodiment of the present application.
  • the embodiment of the present application also provides a block chain including the above-mentioned first node and second node.
  • the present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are run on a computer, the computer is made to execute the above method as shown in FIG. 5 or FIG. 6 .
  • the present application also provides a computer program product containing instructions.
  • the computer program product When the computer program product is run on a computer, it causes the computer to execute the method shown in FIG. 5 or FIG. 6 .
  • the present application also provides a chip, including a processor.
  • the processor is used to read and run the computer program stored in the memory to execute the method for editing the block chain provided by the present application.
  • the chip further includes a memory, the memory is connected to the processor through a circuit or wires, and the processor is used to read and execute the computer program in the memory.
  • the chip further includes a communication interface, and the processor is connected to the communication interface.
  • the communication interface is used to receive data and/or information to be processed, and the processor acquires the data and/or information from the communication interface and processes the data and/or information.
  • the communication interface may be an input/output interface, interface circuit, output circuit, input circuit, pin or related circuit on the chip.
  • the processor may also be embodied as a processing circuit or logic circuit.
  • the disclosed systems, devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .

Abstract

本申请提供了一种用于编辑区块链的方法和装置,该用于编辑区块链的方法包括:第一节点接收用于请求对数据进行编辑的请求消息,并对该请求消息进行背书,生成背书结果,进一步地,第一节点向至少一个第二节点分别发送该背书结果,该至少一个第二节点属于第二节点集合,其中,该第一节点为该区块链中多个具有背书功能的节点中的任意一个节点,该至少一个第二节点中的每个第二节点已知该第二节点对应的私钥分片以及该第二节点集合对应的公钥,该公钥根据该至少一个第二节点分别对应的至少一个公钥分片确定。通过区块链中具有背书功能节点对编辑请求进行背书,将背书结果发送给具有编辑功能的节点,提高安全保障的前提下实现区块链编辑。

Description

用于编辑区块链的方法和装置
本申请要求于2021年05月18日提交中国专利局、申请号为202110540087.1、申请名称为“用于编辑区块链的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息技术领域,并且更具体地,涉及一种用于编辑区块链的方法和装置。
背景技术
区块链(block chain,BC)可以理解为一种防篡改的去中心化账本,用于记录网络中的交易(transaction,TX)。具体地,交易以区块(block)为单位产生和存储,并按照时间顺序连成链式(chain)结构。利用区块记录发生的交易,区块与区块之间通过哈希算法链接起来,记录网络中的对等节点之间发生的交易的历史记录,经过确认和证明的交易从区块链的开始区块链接到最新的区块。
区块链不可篡改的特点与实际区块链应用场景之间存在一些矛盾,例如,区块链的不可篡改性,可能使得不良信息带来大范围、持续性甚至是永久性的负面影响,区块链可能会成为规避监管、发布不良信息的有效途径。
为了解决上述的矛盾,提出编辑区块链的方法,例如,利用变色龙哈希函数对实现对区块的重写,但是目前提出的编辑区块链的方法对安全性的考量依然存在一些不足,因此如何在考虑安全性的前提下编辑区块链成为亟待解决的问题。
发明内容
本申请提供一种用于编辑区块链的方法和装置,通过区块链中具有背书功能节点对编辑请求进行背书,将背书结果发送给具有编辑功能的节点,提高安全保障的前提下实现区块链编辑。
第一方面,提供了一种用于编辑区块链的方法,该用于编辑区块链的方法可以由第一节点执行,或者,也可以由设置于第一节点中的芯片或电路执行,本申请对此不作限定。
该用于编辑区块链的方法包括:
第一节点接收请求消息,该请求消息用于请求对数据进行编辑,该数据包括交易或区块;该第一节点对该请求消息进行背书,生成背书结果;该第一节点向至少一个第二节点分别发送该背书结果,该至少一个第二节点属于第二节点集合;其中,该第一节点为该区块链中多个具有背书功能的节点中的任意一个节点,该至少一个第二节点中的每个第二节点已知该第二节点对应的私钥分片以及该第二节点集合对应的公钥,该公钥根据该至少一个第二节点分别对应的至少一个公钥分片确定。
本申请实施例提供的用于编辑区块链的方法,通过区块链中具有背书功能节点对编辑请求进行背书,将背书结果发送给具有编辑功能的节点,提高安全保障的前提下实现区块 链编辑。
结合第一方面,在第一方面的某些实现方式中,在该第一节点向该至少一个第二节点分别发送该背书结果之前,该方法还包括:该第一节点根据该数据确定该第二节点集合;或者,该第一节点根据标识确定该第二节点集合,该标识承载于该请求消息,该标识用于指示该第二节点集合。
本申请实施例提供的用于编辑区块链的方法,第一节点可以通过需要被修改的数据和/或第二节点集合的标识确定出第二节点集合,为确定第二节点集合提供灵活的方案。
结合第一方面,在第一方面的某些实现方式中,该方法还包括:该第一节点根据第一哈希值和第一随机数验证哈希碰撞,其中,该第一哈希值和第一随机数根据至少一个第二哈希值和至少一个第二随机数得到,该至少一个第二哈希值和至少一个第二随机数为该至少一个第二节点中的每个第二节点根据该第二节点对应的变色龙哈希私钥分片计算出的。
本申请实施例提供的用于编辑区块链的方法,区块链中的节点验证哈希碰撞,以提高方案的安全性。
结合第一方面,在第一方面的某些实现方式中,在该第一节点接收该请求消息之前,该方法还包括:该第一节点接收该数据;该第一节点根据该公钥对该数据进行验证,该验证包括基于该公钥进行哈希计算并签名。
本申请实施例提供的用于编辑区块链的方法,还提供了数据上链流程。
结合第一方面,在第一方面的某些实现方式中,在该第一节点根据该公钥对该数据进行验证之前,该方法还包括:该第一节点确定该第二节点集合;该第一节点根据该第二节点集合确定该公钥。
本申请实施例提供的用于编辑区块链的方法,背书节点进行验证的密钥是根据编辑节点集合确定的,提高方案的安全性。
结合第一方面,在第一方面的某些实现方式中,该第一节点确定该第二节点集合包括:该第一节点根据预配置信息确定该第二节点集合,该预配置信息指示该数据与该第二节点集合对应;或者,该第一节点根据标识确定该第二节点集合,该标识用于指示该第二节点集合。
本申请实施例提供的用于编辑区块链的方法,第一节点可以通过需要预配置信息和/或第二节点集合的标识确定出第二节点集合,为确定第二节点集合提供灵活的方案。
结合第一方面,在第一方面的某些实现方式中,该方法还包括:该第一节点向客户端发送响应消息,该响应消息中包括该数据对应的编辑结果。
本申请实施例提供的用于编辑区块链的方法,完成编辑之后第一节点可以通知到客户端。
结合第一方面,在第一方面的某些实现方式中,该区块链包括联盟链。
具体地,本申请中涉及到的区块链为联盟链。
第二方面,提供了一种用于编辑区块链的方法,该用于编辑区块链的方法可以由客户端执行,或者,也可以由设置于客户端中的芯片或电路执行,本申请对此不作限定。
该用于编辑区块链的方法包括:
客户端向多个节点分别发送请求消息,该请求消息用于请求对数据进行编辑,该数据包括区块或交易,该请求消息中包括标识,该标识用于指示第二节点集合;该客户端分别 接收来自该多个节点的响应消息,该响应消息中包括该数据对应的编辑结果;其中,该第二节点集合包括至少一个第二节点,该至少一个第二节点中的每个第二节点已知该第二节点对应的私钥分片(tki)以及该第二节点集合对应的公钥,该公钥根据该至少一个第二节点分别对应的至少一个公钥分片(hki)确定。
本申请实施例提供的用于编辑区块链的方法,客户端需要对某个数据进行修改时,可以向具有背书功能的节点发送请求消息,并在请求消息中携带指示编辑节点集合的标识,以使得区块链中具有背书功能节点对编辑请求进行背书,将背书结果发送给具有编辑功能的节点,提高安全保障的前提下实现区块链编辑。
结合第二方面,在第二方面的某些实现方式中,在该客户端向多个节点分别发送请求消息之前,该方法还包括:该客户端向多个节点分别发送该数据;该客户端分别接收来自该多个节点的验证结果,其中,该验证结果包括基于该公钥进行哈希计算并签名的结果。
本申请实施例提供的用于编辑区块链的方法,还提供了数据上链流程。
第三方面,提供了一种用于编辑区块链的方法,该用于编辑区块链的方法可以由第二节点执行,或者,也可以由设置于第二节点中的芯片或电路执行,本申请对此不作限定。
该用于编辑区块链的方法包括:
该第二节点生成该第二节点对应的私钥分片和公钥分片;该第二节点向该第二节点集合中除该第二节点之外的其他第二节点发送该第二节点对应的公钥分片;该第二节点接收来自该第二节点集合中除该第二节点之外的其他第二节点发送的该其他第二节点分别对应的公钥分片;该第二节点根据该第二集合中的至少一个第二节点分别对应的公钥分片计算得到该第二节点集合对应的公钥;该第二节点向该区块链中的节点发送该公钥。
本申请实施例提供的用于编辑区块链的方法,背书或验证所需的密钥由编辑节点提供,提高了方案的安全性。
结合第三方面,在第三方面的某些实现方式中,该方法还包括:该第二节点接收来自多个节点分别发送的请求消息的背书结果,该请求消息用于请求对数据进行编辑,该数据包括交易或区块;该第二节点确定接收到的该背书结果的数量满足预设值之后,该第二节点根据该第二节点对应的私钥分片计算得到该第二节点对应的第二哈希值和第二随机数;该第二节点接收来自该第二节点集合中除该第二节点之外的其他第二节点发送的该其他第二节点分别对应的第二哈希值和第二随机数;该第二节点根据该第二集合中的至少一个第二节点分别对应的第二哈希值和第二随机数计算得到第一哈希值和第一随机数;该第二节点向该区块链中的节点发送该第一哈希值和第一随机数,其中,该多个节点为该区块链中对交易进行验证的节点。
第四方面,提供一种用于编辑区块链的装置,该用于编辑区块链的装置包括处理器,用于实现上述第一方面描述的方法中第一节点的功能。
可选地,该用于编辑区块链的装置还可以包括存储器,该存储器与该处理器耦合,该处理器用于实现上述第一方面描述的方法中第一节点的功能。
在一种可能的实现中,该存储器用于存储程序指令和数据。该存储器与该处理器耦合,该处理器可以调用并执行该存储器中存储的程序指令,用于实现上述第一方面描述的方法中第一节点的功能。
可选地,该用于编辑区块链的装置还可以包括通信接口,该通信接口用于该用于编辑 区块链的装置与其它设备进行通信。当该用于编辑区块链的装置为第一节点时,该通信接口可以为收发器、输入/输出接口、或电路等。
在一种可能的设计中,该用于编辑区块链的装置包括:处理器和通信接口,
该处理器用于运行计算机程序,以使得该用于编辑区块链的装置实现上述第一方面描述的任一种方法;
该处理器利用该通信接口与外部通信。
可以理解,该外部可以是处理器以外的对象,或者是该装置以外的对象。
在另一种可能的设计中,该用于编辑区块链的装置为芯片或芯片系统。该通信接口可以是该芯片或芯片系统上输入/输出接口、接口电路、输出电路、输入电路、管脚或相关电路等。该处理器也可以体现为处理电路或逻辑电路。
第五方面,提供一种用于编辑区块链的装置,该用于编辑区块链的装置包括处理器,用于实现上述第二方面描述的方法中客户端的功能。
可选地,该用于编辑区块链的装置还可以包括存储器,该存储器与该处理器耦合,该处理器用于实现上述第二方面描述的方法中客户端的功能。
在一种可能的实现中,该存储器用于存储程序指令和数据。该存储器与该处理器耦合,该处理器可以调用并执行该存储器中存储的程序指令,用于实现上述第二方面描述的方法中客户端的功能。
可选地,该用于编辑区块链的装置还可以包括通信接口,该通信接口用于该用于编辑区块链的装置与其它设备进行通信。当该用于编辑区块链的装置为客户端时,该通信接口可以为收发器、输入/输出接口、或电路等。
在一种可能的设计中,该用于编辑区块链的装置包括:处理器和通信接口,
该处理器用于运行计算机程序,以使得该用于编辑区块链的装置实现上述第一方面描述的任一种方法;
该处理器利用该通信接口与外部通信。
可以理解,该外部可以是处理器以外的对象,或者是该装置以外的对象。
在另一种可能的设计中,该用于编辑区块链的装置为芯片或芯片系统。该通信接口可以是该芯片或芯片系统上输入/输出接口、接口电路、输出电路、输入电路、管脚或相关电路等。该处理器也可以体现为处理电路或逻辑电路。
第六方面,提供一种用于编辑区块链的装置,该用于编辑区块链的装置包括处理器,用于实现上述第三方面描述的方法中第二节点的功能。
可选地,该用于编辑区块链的装置还可以包括存储器,该存储器与该处理器耦合,该处理器用于实现上述第三方面和第四方面描述的方法中第二节点的功能。
在一种可能的实现中,该存储器用于存储程序指令和数据。该存储器与该处理器耦合,该处理器可以调用并执行该存储器中存储的程序指令,用于实现上述第三方面描述的方法中第二节点的功能。
可选地,该用于编辑区块链的装置还可以包括通信接口,该通信接口用于该用于编辑区块链的装置与其它设备进行通信。当该用于编辑区块链的装置为第二节点时,该通信接口可以为收发器、输入/输出接口、或电路等。
在一种可能的设计中,该用于编辑区块链的装置包括:处理器和通信接口,
该处理器利用该通信接口与外部通信;
该处理器用于运行计算机程序,以使得该用于编辑区块链的装置实现上述第三方面描述的任一种方法。
可以理解,该外部可以是处理器以外的对象,或者是该装置以外的对象。
在另一种可能的设计中,该用于编辑区块链的装置为芯片或芯片系统。该通信接口可以是该芯片或芯片系统上的输入/输出接口、接口电路、输出电路、输入电路、管脚或相关电路等。该处理器也可以体现为处理电路或逻辑电路。
第七方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述各方面该的方法。
第八方面,本申请提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各方面该的方法。
第九方面,提供了一种通信系统,包括第四方面至第六方面所示的用于编辑区块链的装置。
第十方面,提供了一种芯片装置,包括处理电路,该处理电路用于从存储器中调用并运行程序,使得安装有该芯片装置的通信设备执行上述第一至第三方面中任一种可能实现方式中的方法。
附图说明
图1是区块链的示意图。
图2是区块与区块之间的链接方式示意图。
图3是联盟链包括节点的示意图。
图4是一种区块重写的方法示意图。
图5是本申请提供的一种交易上链的示意性流程图。
图6是本申请提供的一种用于编辑区块链的方法的示意性流程图。
图7是本申请提出的用于编辑区块链的装置700的示意图。
图8是适用于本申请实施例的第一节点的结构示意图。
图9是本申请提出的用于编辑区块链的装置900的示意图。
图10是适用于本申请实施例的第二节点的结构示意图。
图11是本申请提出的用于编辑区块链的装置1100的示意图。
图12是适用于本申请实施例的客户端的结构示意图。
具体实施方式
下面将结合附图,对本申请中的技术方案进行描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请实施例的技术方案涉及区块链,下面结合图1和图2简单介绍区块链,图1是区块链的示意图。
从图1中可以看出网络中的交易以区块为单位产生和存储,并按照时间顺序连成链式结构。网络中的经过确认和证明的交易从区块链的开头区块链接到最新的区块,多个区块 (如图1所示的区块#1、区块#2和区块#3)链接在一起形成的账本称为区块链。
图2是区块与区块之间的链接方式示意图。
从图2中可以看出区块与区块之间通过哈希(HASH)算法链接起来。
区块链技术实现了一种按照时间顺序将数据和信息区块以顺序相连的方式组成的一种链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式存储。一般情况下,将区块链中的数据和信息称为“交易”。
区块链技术不是单项的技术,而是作为点对点传输、共识机制、分布式数据存储和密码学原理集成应用的系统,该系统具有全公开和防篡改的技术特性。
第一、点对点传输:参与区块链的节点是独立的、对等的,节点与节点之间通过点对点传输技术实现数据和信息的同步。节点可以是不同的物理机器,也可以是云端不同的实例。
第二、共识机制:区块链的共识机制是指多方参与的节点在预设的逻辑规则下,通过节点间的交互实现各节点对特定数据和信息达成一致的过程。共识机制需要依赖于良好设计的算法,因此不同的共识机制性能(如:交易的吞吐量交易/秒(transaction per second,TPS)、达成共识的时延、耗费的计算资源、耗费的传输资源等)存在一定的差异。
第三、分布式数据存储:区块链中的分布式存储是参与该区块链的节点各自都存有独立的、完整的数据,保证了数据存储在节点间全公开。与传统的分布式数据存储不同,传统的分布式数据存储按照一定规则将数据分成多份进行备份或同步存储,而区块链分布式数据存储则依赖于区块链中各地位对等的、独立的节点间的共识来实现高一致性的数据存储。
第四、密码学原理:区块链通常是基于非对称加密技术实现可信的信息传播、校验等。
其中“区块”的概念是将一条或多条数据记录以“块”的形式组织,“区块”的大小可以根据实际应用场景自定义;而“链”是一种数据结构,该数据结构将存储数据记录的“区块”按照时间顺序并以哈希技术相连。在区块链中,每个“区块”包含“区块头”和“区块体”两个部分,其中“区块体”包含打包进“区块”的交易记录;“区块头”包含“区块”中所有交易的根HASH和前一“区块”的HASH。区块链的数据结构保证了区块链上存储的数据具有不可篡改的特性。
区块链目前可以分为三类:公有链、联盟链和私有链。
公有链是指参与任何记账节点(peer)都可以作为区块链的共识节点(也可以称为共识计算节点),进而参与区块链数据存储的共识计算并且匿名的维护该区块链,节点与节点之间相互不信任。
联盟链在公有链的基础上增加了准入权限,使得具有一定资格的节点才可以作为区块链的共识计算节点,进而参与该区块链数据存储的共识计算并维护该区块链,节点与节点之间存在一定的信任。
私有链相比联盟链的准入机制更加苛刻,使得该区块链以及区块链的共识计算节点为私人独有。
本申请实施例主要应用于联盟链,下面结合图3简单介绍目前联盟链的结构,图3是联盟链包括节点的示意图。
如图3所示,联盟链由peer节点组成(如图3所示包括P#1、P#2、P#3、P#4、P#5……P#n), 其中,peer节点承载了账本(ledger)及智能合约(smart contract),通过智能合约账本以不可篡改的方式记录了交易的过程,在联盟链中智能合约和账本用于封装整个网络中的共享处理和共享信息。
需要说明的是,每一个peer节点可以承载一个或者多个账本,以及一个或者多个智能合约。
针对联盟链,上述的peer节点进一步划分为背书节点、记账节点、排序节点,其中,背书节点和合约(contract)绑定,为交易的提案(proposal)检查和背书,计算交易执行的结果;所有的peer节点都是记账节点,用于在接受交易结果前再次检查合法性交易对账本的修改并写入区块链;排序节点对发往网络的交易进行排序,将排序后的交易按照配置中的约定整理为区块之后提交给确认节点进行处理。
应理解,图1和图2只是示例性说明本申请实施例涉及的区块链技术,图3也只是示例性地指出联盟链包括多个节点,对本申请的保护范围不构成任何的限定,区块链以及联盟链的具体地定义可以参考目前技术中相关描述,本申请不进行赘述。
由上述可知,区块链具有公开透明性和不可篡改性,其中,区块链的不可篡改性在实际区块链部署时可能会带来一些问题,例如:
1)从信息安全角度来讲,目前对于区块链的研究和应用更多地强调区块链上数据的存储与传输安全,而忽略了更为重要的信息内容安全,如:
(1)缺乏必要的上链信息审核与评估机制,区块链系统的验证者重点核查上链信息的语法正确性,而忽略了信息内容的语义合理性甚至是真实性;
(2)链上数据的搜索与甄别机制尚不完善,在区块链中存在有害和潜在非法的文件、图像和链接时,就有必要对非法数据做出更改;
(3)区块链的公开透明性和不可篡改性,使得不良信息将带来大范围、持续性甚至是永久性的负面影响,区块链可能会成为规避监管、发布不良信息的有效途径。
2)靠硬分叉才能解决的攻击问题,区块链和链上的智能合约,本质上也是软件代码,难免会出现漏洞,攻击者利用这些漏洞造成的攻击,如利用漏洞盗取的虚拟货币,数字资产等,由于区块链无法修改,对这些攻击结果也无法消减。
3)通用数据保护条例(general data protection regulation,GDPR)的数据可遗忘权与区块链不可修改之间的矛盾。
从隐私保护的角度,GDPR规定了数据主体享有“数据被遗忘权”和“数据可携带权”等权利,数据主体有权让数据控制主体擦除其个人数据,停止进一步传播数据,并有权要求第三方停止处理数据。
特别是在未来通信网将会面临大量用户、设备或厂商信息的个人数据,隐私问题严峻,该冲突将大大限制区块链的未来通信网中的探索、使用和部署。
为了解决上述的区块链的不可篡改性带来的问题,提出一种区块重写的方法,该方法利用变色龙哈希函数实现对区块的重写。变色龙哈希是一种特殊的哈希函数,变色龙哈希函数留有一个陷门,对于陷门的拥有者,可以利用陷门计算一个新的内容,使其与某一原始内容具有相同的哈希值,即产生哈希碰撞。如图4所示,图4是一种区块重写的方法示意图。
从图4中可以看出,原始区块链中包含区块B#0,B#1,B#2,B#3…B#n。当需要对区块 B#2进行替换的时候,区块链节点利用陷门计算出区块B#2’,使得Hash(B#2)=Hash(B#2’),并将B#2’替换掉B#2。
图4所示的方法使用变色龙哈希实现了区块的更新,但是对安全性的考量不够,依然存在一些不足。另外,该区块重写的方法采用单一的陷门机制,陷门拥有者完全掌握修改权利。
在考虑安全性的前提下编辑区块链,本申请提出一种用于编辑区块链的方法,通过区块链中具有背书功能节点对编辑请求进行背书,将背书结果发送给具有编辑功能的节点,提高安全保障的前提下实现区块链编辑。
为便于理解本申请实施例,对本申请实施例中涉及的几个基本概念做简单说明。应理解,下文中所介绍的基本概念是以目前区块链相关描述中的基本概念为例进行简单说明,但并不限定本申请实施例只能够应用于目前已有的区块链相关技术中。因此,本申请对于术语的具体名称并不限定,可以对应的扩展到其它区块链相关技术,比如未来区块链相关技术中。
1、变色龙哈希(Chameleon Hash)函数。
一个变色龙哈希函数由四个部分组成:cham_hash=(Setup,KeyGen,Hash,Forge),其中,Setup(λ)表示输入安全性参数λ,输出公共参数pp;KeyGen(pp)表示输入公共参数pp,输出公私钥对(HK,CK),HK为公钥,CK为私钥,又称门限;Hash(HK,m,r)表示输入公钥HK,消息m和随机数r,输出变色龙的哈希值CH;Forge(CK,m,r,m’)表示输入私钥CK,消息m,随机数r,消息m’,输出另一个随机数r’,满足CH=Hash(HK,m,r)=Hash(HK,m’,r’)。
变色龙哈希满足的安全性要求包括:
抗碰撞:不存在一个有效算法在输入公钥HK,可以找到(m1,r1)和(m2,r2),其中m1≠m2,满足Hash(HK,m1,r1)=Hash(HK,m2,r2)。
陷门碰撞:存在有效算法,在输入门限CK后,对于任意的m1,r1,给定m2,可以计算出r2,满足Hash(HK,m1,r1)=Hash(HK,m2,r2)。
语义安全:对于任意消息m1m2,Hash(HK,m1,r1)与Hash(HK,m2,r2)的概率分布是不可区分的,特别的,当r为随机选择时,从Hash(HK,m,r)无法得到关于m的任何信息。
相比于传统哈希函数的难以找到碰撞,变色龙哈希可以人为的设一个“弱点”或者“后门”,掌握了这个后门就可以轻松的找到哈希碰撞。在一定程度上破坏了哈希函数的两个碰撞性的特点,同时,也破坏了基于哈希函数的区块链的不可篡改的特性,但是也扩大了区块链的应用场景,而且对于不知道门限的普通用户来说,想要找到碰撞依然是不可行的,也就是说,变色龙哈希的安全性也是可以保障的,对于持有“后门”的管理人员,如果其随意篡改区块,也是可以通过验证两个区块的哈希是否相等来验证。
2、智能合约。
智能合约是一种旨在以信息化方式传播、验证或执行合同的计算机协议。区块链上的所有用户都可以看到基于区块链的智能合约。但是,这会导致包括安全漏洞在内的所有漏洞都可见,并且可能无法迅速修复。
区块链领域的智能合约有以下特点:
规则公开透明,合约内的规则以及数据对外部可见;所有交易公开可见,不会存在任何虚假或者隐藏的交易。
区块链技术具有“公开透明”“不可篡改”的特点是智能合约赋予区块链的。智能合约允许在没有第三方的情况下进行可信交易,这些交易可追踪且不可逆转。智能合约是基于不可篡改的数据,可以自动化的执行一些预先定义好的规则和条款。
3、共识机制。
共识机制就是所有记账节点之间怎么达成共识,去认定一个记录的有效性,这既是认定的手段,也是防止篡改的手段。区块链提出了四种不同的共识机制,适用于不同的应用场景,在效率和安全性之间取得平衡。
4、交易上链。
交易上链就是交易通过共识机制打包在一个区块成为一个新的区块,并且链接到前面的区块,成为链上不可篡改的交易。
5、背书。
区块链中背书可以理解为承担背书任务的背书节点为区块链交易进行交易信息验证,对验证通过的交易声明此交易合法的过程和机制。
6、背书验证。
交易需要首先通过背书节点的背书,然后再进行交易排序,最后才利用有序交易进行账本的更新。背书策略验证过程包括:
发起交易的时候,发起端应用一般调用软件开发工具包(software development kit,SDK)指定交易提议发给一个或多个背书节点进行背书验证,接收提议的背书节点在SDK的交易提议请求中指定,如果未指定,则会将交易提议请求发送给加入该通道(channel)的所有节点,发送后客户端应用等待背书节点的返回;
背书节点收到提议后,首先进行一些检查和签名的验证,包括用客户端(SDK)的公钥验证它的签名、核实客户端是否可以在该channel进行操作、交易是否已被提交、交易提议组织是否正确。验证通过后模拟执行链码(chaincode)生成一个提议结果,并对结果进行背书,即在结果中添加数字签名并利用私钥对结果进行签名;
客户端(SDK)收到足够多的背书节点的结果后,表示这个交易已经正确背书,然后将交易提议、模拟结果和背书信息打包发给排序节点;如果客户端没有收集到足够多的背书节点反馈的背书信息,这个交易就会被舍弃;
排序节点对来自客户端(SDK)的信息进行排序,并创建区块,然后在通道channel上进行广播;
channel上的peer节点接收到交易区块后,验证背书策略是否满足,然后更新账本,至此,背书策略的验证过程完成。
上文结合附图介绍了目前编辑区块链的方法存在的问题,并简单说明了本申请涉及到的一些基本概念,下文将进一步地结合附图详细介绍本申请提出的技术方案。
下文示出的实施例并未对本申请实施例提供的方法的执行主体的具体结构特别限定,只要能够通过运行记录有本申请实施例的提供的方法的代码的程序,以根据本申请实施例提供的方法编辑(或者说重写,或者说修改)区块链即可,例如,本申请实施例提供的方法的执行主体可以是计算机、服务器或计算机、服务器中能够调用程序并执行程序的功能 模块。
为了便于理解本申请实施例,做出以下几点说明。
第一,在本申请中,“用于指示”可以理解为“使能”,“使能”可以包括直接使能和间接使能。当描述某一信息用于使能A时,可以包括该信息直接使能A或间接使能A,而并不代表该信息中一定携带有A。
将信息所使能的信息称为待使能信息,具体实现过程中,对待使能信息进行使能的方式有很多种,例如但不限于,可以直接使能待使能信息,如待使能信息本身或者该待使能信息的索引等。也可以通过使能其他信息来间接使能待使能信息,其中该其他信息与待使能信息之间存在关联关系。还可以仅仅使能待使能信息的一部分,而待使能信息的其他部分可以是已知的或者提前约定的。例如,还可以借助预先约定(例如协议规定)的各个信息的排列顺序来实现对特定信息的使能,从而在一定程度上降低使能开销。同时,还可以识别各个信息的通用部分并统一使能,以降低单独使能同样的信息而带来的使能开销。
第二,在本申请中示出的第一、第二以及各种数字编号(例如,“#1”、“#2”等)仅为描述方便,用于区分的对象,并不用来限制本申请实施例的范围。例如,区分不同的区块等。而不是用于描述特定的顺序或先后次序。应该理解这样描述的对象在适当情况下可以互换,以便能够描述本申请的实施例以外的方案。
第三,在本申请中,“预设的”可包括预先定义,例如,协议定义。其中,“预先定义”可以通过在设备(例如,包括节点)中预先保存相应的代码、表格或其他可用于指示相关信息的方式来实现,本申请对于其具体的实现方式不做限定。
第四,本申请实施例中涉及的“保存”,可以是指的保存在一个或者多个存储器中。所述一个或者多个存储器,可以是单独的设置,也可以是集成在编码器或者译码器,处理器、或通信装置中。所述一个或者多个存储器,也可以是一部分单独设置,一部分集成在译码器、处理器、或通信装置中。存储器的类型可以是任意形式的存储介质,本申请并不对此限定。
以下,不失一般性,以区块链中节点之间的交互为例详细说明本申请实施例提供的用于编辑区块链的方法。
为了便于理解本申请提供的用于编辑区块链的方法,下面首先结合图5说明本申请中涉及的交易上链流程。
图5是本申请提供的一种交易上链的示意性流程图。包括以下步骤:
S510,客户端向背书节点发送交易上链请求。
为了便于描述以客户端向某个背书节点发送交易上链请求为例进行描述。
应理解,客户端创建交易,并发送交易上链请求到该交易所选择的背书节点集合,该背书节点集合中包括至少一个背书节点。客户端可能同时向该背书节点集合中的背书节点分别发送交易上链请求,或者,客户端可能不是同时向背书节点集合中的背书节点分别发送交易上链请求。本申请实施例中对于客户端如何创建数据,以及如何向背书节点集合中的背书节点发送交易上链请求不做限定,可以参考目前相关技术中的描述,这里不进行赘述。
该交易上链请求中包括智能合约标识(smart contract ID)、交易内容(TX content)以及签名(sign)。
具体地,智能合约标识也可以称为标识,用于指定交易对应的第二节点集合。应理解,用于指定第二节点集合的标识还可以有其他形式,该实施例中所示的smart contract ID只是一种示例,对本申请的保护范围不构成任何的限定。
本申请实施例中涉及的联盟链与图3中所示的联盟链不同在于:本申请实施例中涉及的联盟链中包括第二节点(也可以称为编辑节点),首先对本申请实施例中定义的编辑节点进行说明:
编辑节点为联盟链中的具有修改区块权限的,拥有变色龙公私钥分片的节点。
编辑节点集合包括多个编辑节点,可以理解为可共同执行编辑工作的节点集合。联盟链中可设定一个或多个编辑节点集合,每个编辑节点集合ID与编辑节点列表一一对应。例如:
编辑节点集合#1包括{节点#a,节点#b,节点#c},变色龙哈希算法如下:
节点#a生成私钥分片tk a=x a,并计算公钥分片hk a=g^x a,
节点#b生成私钥分片tk b=x b,并计算公钥分片hk b=g^x b,
节点#c生成私钥分片tk c=x c,并计算公钥分片hk c=g^x c,
节点#a保留私钥分片tk a,节点#b保留私钥分片tk b,节点#c保留私钥分片tk c;节点#a在区块链中广播公钥分片hk a,节点#b在区块链中广播公钥分片hk b,节点#c在区块链中广播公钥分片hk c。节点#a,节点#b和节点#c可计算得到系统公钥hk=g^(x a·x b·x c),该编辑节点集合#1的私钥tk={x a,x b,x c}。
上述只是以联盟链中设定有编辑节点集合#1为例进行说明,对本申请的保护范围不构成任何的限定,联盟链中还可以设定编辑节点集合#2和/或编辑节点集合#3,其中,编辑节点集合#2包括{节点m,节点n,节点t};编辑节点集合#3包括{节点m,节点n,节点t}。
为了便于理解,下文以交易对应的第二节点集合为上述的编辑节点集合#1为例进行说明。
例如,联盟链中设定有编辑节点集合#1、编辑节点集合#2、编辑节点集合#3,编辑节点集合#1的标识为编辑节点集合ID#1,编辑节点集合ID#1与节点#a,节点#b,节点#c对应;编辑节点集合#2的标识为编辑节点集合ID#2,编辑节点集合ID#2与节点#e,节点#f,节点#g对应;编辑节点集合#3的标识为编辑节点集合ID#3,编辑节点集合ID#3与节点#h,节点#i,节点#j对应。标识可以为编辑节点集合ID#1,指示节点#a,节点#b,节点#c。
进一步地,背书节点接收到交易上链请求之后,执行以下步骤S520至S550:
S520,验证签名。
本申请中对于背书节点如何验证交易上链请求的签名不做限定,可以参考目前相关技术中关于背书流程的描述。
S530,验证是否符合channel存取控制清单(access control list,ACL)。
本申请中对于背书节点如何验证是否符合channel ACL也不做限定,可以参考目前相关技术中关于背书流程的描述。
S540,背书节点决策交易上链请求是否通过背书。
本申请中主要涉及交易上链请求通过背书。当交易上链请求通过背书时,背书节点生 成背书结果:模拟交易,利用交易指定的第二节点集合的ID对应的公钥hk执行变色龙哈希计算,并签名。
S550,背书节点将背书结果发送给客户端。
客户端接收到足够多的第一节点(背书节点)返回的背书结果之后,执行:
S560,构建交易请求。
S570,将交易请求发送给排序节点。
排序节点接收到交易请求之后执行:
S580,进行排序生成区块。
S590,将区块同步给主节点。
最后,区块链中的各个记账节点执行:
S591,验证区块,同步本地区块链,写入新的交易。
S560至S591的具体描述可以参考目前相关技术的描述,本申请中不赘述。本申请主要涉及交易被写入后,后续联盟链修改交易需要执行的流程。下面结合图6详细介绍本申请提供的用于编辑区块链的方法。
图6是本申请提供的一种用于编辑区块链的方法的示意性流程图。
本申请实施例提供的用于编辑区块链的方法可以应用于联盟链中,用于编辑联盟链;或者,还可以应用于公有链或私有链中。
具体地,本申请实施例中涉及的区块链包括至少一个背书节点。例如,目前相关技术中所提及的联盟链中所定义的背书节点;还例如,可以在公有链或私有链中定义能够用于实现背书功能的节点。
本申请实施例中对于区块链中的背书节点是目前已有的还是新增的不做限定,只需要该区块链中包括至少一个能够实现背书功能的节点即可。
为了便于描述,下文中以基于联盟链的区块链数据编辑方法为例进行说明,其他类型的区块链中的数据编辑与联盟链中的数据编辑类似,本申请中不再赘述。
该用于编辑区块链的方法至少包括以下部分步骤:
S610,第一节点接收请求消息,该请求消息用于请求对数据进行编辑。
示例性地,本申请中涉及的数据包括交易或区块,该第一节点为区块链中多个具有背书功能的节点中的任意一个节点。
作为一种可能的实现方式,第一节点接收来自客户端的请求消息,或者说客户端向第一节点发送请求消息。
具体地,客户端确定需要对数据进行编辑,并发送请求消息到该数据所选择的背书节点集合,该背书节点集合中包括该第一节点。客户端可能同时向该背书节点集合中的背书节点分别发送该第一请求消息,或者,客户端可能不是同时向背书节点集合中的背书节点分别发送该第一请求消息。本申请实施例中对于客户端如何创建数据,以及如何向背书节点集合中的背书节点发送请求消息不做限定,可以参考目前相关技术中的描述,这里不进行赘述。
需要说明的是,为了便于描述本申请实施例中以客户端向第一节点发送请求消息为例进行说明,该客户端还可以向背书节点集合中的其他背书节点(例如,第二背书节点和/或第三背书节点)发送该请求消息,其他的背书节点接收请求消息以及基于请求消息所执 行的步骤与第一节点接收请求消息和执行的步骤类似,本申请不进行赘述。
该请求消息可以称为数据编辑请求消息,或者可以称为提议(propose)消息。该请求消息用于请求该第一节点对数据进行编辑。
示例性地,本申请实施例中涉及的客户端可以是应用程序或者用户。
示例性地,请求消息中包括标识,该标识用于标识与上述的数据对应的第二节点集合,该第二节点集合包括至少一个第二节点。
应理解,本申请实施例中所涉及的数据对应的至少一个第二节点指的是能够对该数据进行编辑的编辑节点。
作为一种可能的实现,该标识可以分别指示该数据对应的至少一个第二节点的标识(identify,ID);或者,
作为另一种可能的实现,该标识指示该数据对应的智能合约标识(smart contract ID);或者,
作为又一种可能的实现,该标识指示该数据对应的至少一个第二节点所属的第二节点集合的标识。
可选地,请求消息中还包括数据内容(content),以及签名(signature),该签名信息用于保护该请求消息。
本申请实施例中的请求消息可以理解为目前区块链技术中的客户端向背书节点发送的propose消息,不同的是本申请实施例中的请求消息中包括上述的标识,而propose消息中并未包括标识编辑节点的标识,所以说本申请实施例中的请求消息可以复用目前的propose消息,并在该propose消息中新增标识,或者复用propose消息中已有的信息标识编辑节点。
第一节点接收到上述的请求消息之后需要对请求消息进行背书,生成背书结果,图6所示的方法流程还包括:
S620,第一节点对请求消息进行背书,生成背书结果。
第一节点接收到上述的请求消息之后,决策是否通过背书,若是则生成背书结果:模拟交易,利用数据指定的第二节点集合的标识对应的公钥执行哈希计算,并签名。
需要说明的是,背书节点还需要验证请求消息的签名以及验证是否符合channel ACL。图6所示的方法流程还包括:
S621,验证签名。
本申请中对于第一节点如何验请求消息的签名不做限定,可以参考目前相关技术中关于背书流程的描述。
S622,验证是否符合channel ACL。
本申请中对于第一节点如何验证是否符合channel ACL也不做限定,可以参考目前相关技术中关于背书流程的描述。
示例性地,第一节点还需要确定请求消息具备请求修改数据的权限。图6所示的方法流程还包括:
S623,确定请求消息具备请求修改数据的权限。
例如,第一节点确定发送该请求消息的客户端具备修改该数据的权限,具体地,可以是该客户端是发起该数据上链请求的客户端。
还例如,第一节点验证该请求消息的签名,若验证通过确定该请求消息具备请求修改数据的权限。
进一步地,第一节点需要将背书结果发送给编辑节点,图6所示的方法流程还包括:
S630,第一节点向至少一个第二节点分别发送所述背书结果。
至少一个第二节点属于第二节点集合,第二节点具有编辑功能。至少一个第二节点中的每个第二节点已知自身对应的私钥分片以及第二节点集合对应的公钥,公钥根据至少一个第二节点分别对应的至少一个公钥分片确定。
具体地,在第一节点向至少一个第二节点分别发送背书结果之前,可以通过以下方式确定第二节点集合。
方式一:第一节点根据数据确定第二节点集合。
例如,第一节点将数据上链过程中确定得到的第二节点集合确定为第二节点集合。
方式二:第一节点根据标识确定第二节点集合,标识承载于请求消息,标识用于指示第二节点集合。
进一步地,以第二节点集合中的某个第二节点为例说明第二节点接收到上述的背书结果之后需要执行的步骤:
S631,第二节点确定接收到的背书结果的数量满足预设值。
例如,多个第一节点均执行了上述的背书流程,并将背书结构分别发给了第二节点集合中的第二节点。
S632,计算得到自身对应的第二哈希值h i和第二随机数R i
第二节点确定接收到足够多的背书节点的背书之后,分别用私钥计算得到自身对应的第二哈希值和第二随机数。
示例性地,第二节点集合包括{第二节点#a,第二节点#b,第二节点#c},第二哈希值h i和第二随机数R i算法如下:
第二节点#a生成第二哈希值h a和第二随机数R a;其中,h a=chameleon(m,tk a);
第二节点#b生成第二哈希值h b和第二随机数R b;其中,h b=chameleon(m,tk b);
第二节点#c生成第二哈希值h c和第二随机数R c;其中,h c=chameleon(m,tk c);
S633,将计算得到的第二哈希值和第二随机数广播给第二节点集合中的其他第二节点。
S634,计算得到第一哈希值H和第一随机数R。
第二节点根据自身对应的第二哈希值和第二随机数,以及第二节点集合中的其他第二节点分别对应的第二哈希值和第二随机数计算得到第一哈希值和第一随机数。其中,H=h a&h b&h c
第二节点执行上述的S631至S63之后,图6所示的方法流程还包括:
S640,区块链中的其他节点验证哈希碰撞。
本申请中对于节点如何验证哈希碰撞不做限定,可以参考目前相关技术中关于哈希碰撞的描述。
S650,排序节点写入排序。
本申请中对于排序节点如何进行写入排序不做限定,可以参考目前相关技术中关于排序节点进行排序的描述。
排序节点进行排序之后,图6所示的方法流程还包括:
S660,修改本地区块链写入新的数据。
可选地,还可以记录区块链的编辑历史记录。
进一步地,可以将编辑结果返回给客户端,图6所示的方法流程还包括:
S670,向客户端发送编辑结果。
示例性地,编辑结果可以是用于编辑成功的指示信息;或者,编辑结果可以是编辑响应消息。
上述方法实施例中,上述各过程的序列号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。并且有可能并非要执行上述方法实施例中的全部操作。
应理解,上述方法实施例中各个节点可以执行施例中的部分或全部步骤,这些步骤或操作仅是示例,本申请实施例还可以包括执行其它操作或者各种操作的变形。
可以理解的是,上述方法实施例中,由第一节点实现的方法,也可以由可用于第一节点的部件(例如芯片或者电路等)实现,由第二节点实现的方法,也可以由可用于第二节点的部件实现。
还应理解,在本申请的各个实施例中,如果没有特殊说明以及逻辑冲突,不同的实施例之间的术语和/或描述可以具有一致性、且可以相互引用,不同的实施例中的技术特征根据其内在的逻辑关系可以组合形成新的实施例。
上面结合图5和图6的详细介绍了本申请实施例中的用于编辑区块链的方法,下面结合图7-图12详细介绍本申请实施例提供的用于编辑区块链的装置。
参见图7,图7是本申请提出的用于编辑区块链的装置700的示意图。如图7所示,装置700包括背书单元710、接收单元720、发送单元730。
接收单元720,用于接收请求消息,该请求消息用于请求对数据进行编辑,该数据包括交易或区块;
背书单元710,用于对该请求消息进行背书,生成背书结果,
发送单元730,用于向至少一个第二节点分别发送该背书结果,该至少一个第二节点属于第二节点集合;
其中,该第一节点为该区块链中多个具有背书功能的节点中的任意一个节点,
该至少一个第二节点中的每个第二节点已知该第二节点对应的私钥分片以及该第二节点集合对应的公钥,该公钥根据该至少一个第二节点分别对应的至少一个公钥分片确定。
该装置还包括:
处理单元740,用于确定该请求消息具备请求修改该数据的权限。
可选地,背书单元710和处理单元740可以为一个单元,可以实现背书功能和处理功能。
装置700和方法实施例中的第一节点完全对应,装置700可以是方法实施例中的第一节点;或者装置700可以是方法实施例中的第一节点内部的芯片或功能模块。装置700的相应单元用于执行图5或图6所示的方法实施例中由第一节点执行的相应步骤。
其中,装置700中的处理单元740执行方法实施例中第一节点内部实现或处理的步骤。接收单元720执行方法实施例中第一节点接收的步骤。发送单元730执行方法实施例中第一节点发送的步骤。发送单元730和接收单元720可以组成收发单元,同时具有接收和发 送的功能。其中,发送单元730可以是发射器,接收单元720可以是接收器。接收器和发射器可以集成在一起组成收发器。
参见图8,图8是适用于本申请实施例的第一节点的结构示意图。为了便于说明,图8仅示出了第一节点的主要部件。如图8所示,第一节点包括处理器810、存储器820、收发器830。处理器用于控制收发器收发信息,存储器用于存储计算机程序,处理器用于从存储器中调用并运行该计算机程序,以执行本申请提出的用于编辑区块链的方法中由第一节点执行的相应流程和/或操作。此处不再赘述。
本领域技术人员可以理解,为了便于说明,图8仅示出了一个存储器和处理器。在实际的系统中,可以存在多个处理器和存储器。存储器也可以称为存储介质或者存储设备等,本申请实施例对此不做限制。
参见图9,图9是本申请提出的用于编辑区块链的装置900的示意图。如图9所示,装置900包括处理单元910、接收单元920、发送单元930。
处理单元910,用于生成该第二节点对应的私钥分片和公钥分片;
发送单元930,用于向该第二节点集合中除该第二节点之外的其他第二节点发送该第二节点对应的公钥分片;
接收单元920,用于接收来自该第二节点集合中除该第二节点之外的其他第二节点发送的该其他第二节点分别对应的公钥分片;
该处理单元910还用于根据该第二集合中的至少一个第二节点分别对应的公钥分片计算得到该第二节点集合对应的公钥;
该发送单元还用于向该区块链中的节点发送该公钥。
装置900和方法实施例中的第二节点完全对应,装置900可以是方法实施例中的第二节点;或者装置900可以是方法实施例中的第二节点内部的芯片或功能模块。装置900的相应单元用于执行图5或图6所示的方法实施例中由第二节点执行的相应步骤。
其中,装置900中的处理单元910执行方法实施例中第二节点内部实现或处理的步骤。接收单元920执行方法实施例中第二节点接收的步骤。发送单元930执行方法实施例中第二节点发送的步骤。发送单元930和接收单元920可以组成收发单元,同时具有接收和发送的功能。其中,发送单元930可以是发射器,接收单元920可以是接收器。接收器和发射器可以集成在一起组成收发器。
参见图10,图10是适用于本申请实施例的第二节点的结构示意图。为了便于说明,图10仅示出了第二节点的主要部件。如图10所示,第二节点包括处理器1010、存储器1020、收发器1030。处理器用于控制收发器收发信息,存储器用于存储计算机程序,处理器用于从存储器中调用并运行该计算机程序,以执行本申请提出的用于编辑区块链的方法中由第二节点执行的相应流程和/或操作。此处不再赘述。
本领域技术人员可以理解,为了便于说明,图10仅示出了一个存储器和处理器。在实际的系统中,可以存在多个处理器和存储器。存储器也可以称为存储介质或者存储设备等,本申请实施例对此不做限制。
参见图11,图11是本申请提出的用于编辑区块链的装置1100的示意图。如图11所示,装置1100包括接收单元1110、发送单元1120。
发送单元1120,用于向多个节点分别发送请求消息,该请求消息用于请求对数据进 行编辑,该数据包括区块或交易,该请求消息中包括标识,该标识用于指示第二节点集合;
接收单元1110,用于接收来自该多个节点的响应消息,该响应消息中包括该数据对应的编辑结果;
其中,该第二节点集合包括至少一个第二节点,该至少一个第二节点中的每个第二节点已知该第二节点对应的私钥分片以及该第二节点集合对应的公钥,该公钥根据该至少一个第二节点分别对应的至少一个公钥分片确定。
装置1100和方法实施例中的客户端完全对应,装置1100可以是方法实施例中的客户端;或者装置1100可以是方法实施例中的客户端内部的芯片或功能模块。装置1100的相应单元用于执行图5或图6所示的方法实施例中由客户端执行的相应步骤。
其中,装置1100中的还可以包括处理单元,用于执行方法实施例中客户端内部实现或处理的步骤。接收单元1110执行方法实施例中客户端接收的步骤。发送单元1120执行方法实施例中客户端发送的步骤。发送单元1120和接收单元1110可以组成收发单元,同时具有接收和发送的功能。其中,发送单元1120可以是发射器,接收单元1110可以是接收器。接收器和发射器可以集成在一起组成收发器。
参见图12,图12是适用于本申请实施例的客户端的结构示意图。为了便于说明,图12仅示出了客户端的主要部件。如图12所示,客户端包括处理器1210、存储器1220、收发器1230。处理器用于控制收发器收发信息,存储器用于存储计算机程序,处理器用于从存储器中调用并运行该计算机程序,以执行本申请提出的用于编辑区块链的方法中由客户端执行的相应流程和/或操作。此处不再赘述。
本领域技术人员可以理解,为了便于说明,图12仅示出了一个存储器和处理器。在实际的系统中,可以存在多个处理器和存储器。存储器也可以称为存储介质或者存储设备等,本申请实施例对此不做限制。
本申请实施例还提供一种区块链包括上述的第一节点和第二节点。
本申请还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在计算机上运行时,使得计算机执行上述如图5或图6所示的方法。
本申请还提供了一种包含指令的计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行如图5或图6所示的方法。
本申请还提供一种芯片,包括处理器。该处理器用于读取并运行存储器中存储的计算机程序,以执行本申请提供的用于编辑区块链的方法。可选地,该芯片还包括存储器,该存储器与该处理器通过电路或电线与存储器连接,处理器用于读取并执行该存储器中的计算机程序。进一步可选地,该芯片还包括通信接口,处理器与该通信接口连接。通信接口用于接收需要处理的数据和/或信息,处理器从该通信接口获取该数据和/或信息,并对该数据和/或信息进行处理。该通信接口可以是该芯片上的输入/输出接口、接口电路、输出电路、输入电路、管脚或相关电路等。该处理器也可以体现为处理电路或逻辑电路。
应理解,上述的芯片也可以替换为芯片系统,这里不再赘述。
本申请中的术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (28)

  1. 一种用于编辑区块链的方法,其特征在于,包括:
    第一节点接收请求消息,所述请求消息用于请求对数据进行编辑,所述数据包括交易或区块;
    所述第一节点对所述请求消息进行背书,生成背书结果;
    所述第一节点向至少一个第二节点分别发送所述背书结果,所述至少一个第二节点属于第二节点集合;
    其中,所述第一节点为所述区块链中多个具有背书功能的节点中的任意一个节点,所述第二节点为所述区块链中具有编辑功能的节点,所述至少一个第二节点中的每个第二节点已知所述第二节点对应的私钥分片以及所述第二节点集合对应的公钥,所述公钥根据所述至少一个第二节点分别对应的至少一个公钥分片确定。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    所述第一节点确定所述请求消息具备请求修改所述数据的权限。
  3. 根据权利要求1或2所述的方法,其特征在于,在所述第一节点向所述至少一个第二节点分别发送所述背书结果之前,所述方法还包括:
    所述第一节点根据所述数据确定所述第二节点集合;或者,
    所述第一节点根据标识确定所述第二节点集合,所述标识承载于所述请求消息,所述标识用于指示所述第二节点集合。
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述方法还包括:
    所述第一节点根据第一哈希值和第一随机数验证哈希碰撞,
    其中,所述第一哈希值和第一随机数根据至少一个第二哈希值和至少一个第二随机数得到,所述至少一个第二哈希值和至少一个第二随机数为所述至少一个第二节点中的每个第二节点根据所述第二节点对应的变色龙哈希私钥分片计算出的。
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,在所述第一节点接收所述请求消息之前,所述方法还包括:
    所述第一节点接收所述数据;
    所述第一节点根据所述公钥对所述数据进行验证,所述验证包括基于所述公钥进行哈希计算并签名。
  6. 根据权利要求5所述的方法,其特征在于,在所述第一节点根据所述公钥对所述数据进行验证之前,所述方法还包括:
    所述第一节点确定所述第二节点集合;
    所述第一节点根据所述第二节点集合确定所述公钥。
  7. 根据权利要求6所述的方法,其特征在于,所述第一节点确定所述第二节点集合包括:
    所述第一节点根据预配置信息确定所述第二节点集合,所述预配置信息指示所述数据与所述第二节点集合对应;或者,
    所述第一节点根据标识确定所述第二节点集合,所述标识用于指示所述第二节点集合。
  8. 根据权利要求1至7中任一项所述的方法,其特征在于,所述方法还包括:
    所述第一节点向客户端发送响应消息,所述响应消息中包括所述数据对应的编辑结果。
  9. 根据权利要求1至8中任一项所述的方法,其特征在于,所述区块链包括联盟链。
  10. 一种用于编辑区块链的方法,其特征在于,包括:
    客户端向多个第一节点分别发送请求消息,所述请求消息用于请求对数据进行编辑,所述数据包括区块或交易,所述请求消息中包括标识,所述标识用于指示第二节点集合;
    所述客户端分别接收来自所述多个第一节点的响应消息,所述响应消息中包括所述数据对应的编辑结果;
    其中,所述第一节点为所述区块链中具有背书功能的节点,所述第二节点集合包括至少一个第二节点,所述至少一个第二节点中的每个第二节点已知所述第二节点对应的私钥分片以及所述第二节点集合对应的公钥,所述公钥根据所述至少一个第二节点分别对应的至少一个公钥分片确定。
  11. 根据权利要求10所述的方法,其特征在于,在所述客户端向多个第一节点分别发送请求消息之前,所述方法还包括:
    所述客户端向多个第一节点分别发送所述数据;
    所述客户端分别接收来自所述多个第一节点的验证结果,
    其中,所述验证结果包括基于所述公钥进行哈希计算并签名的结果。
  12. 一种用于编辑区块链的方法,所述区块链中包括第二节点集合,所述第二节点集合包括至少一个第二节点,其特征在于,所述方法包括:
    所述第二节点生成所述第二节点对应的私钥分片和公钥分片;
    所述第二节点向所述第二节点集合中除所述第二节点之外的其他第二节点发送所述第二节点对应的公钥分片;
    所述第二节点接收来自所述第二节点集合中除所述第二节点之外的其他第二节点发送的所述其他第二节点分别对应的公钥分片;
    所述第二节点根据所述第二集合中的至少一个第二节点分别对应的公钥分片计算得到所述第二节点集合对应的公钥;
    所述第二节点向所述区块链中的节点发送所述公钥。
  13. 根据权利要求12所述的方法,其特征在于,所述方法还包括:
    所述第二节点接收来自多个第一节点分别发送的请求消息的背书结果,所述请求消息用于请求对数据进行编辑,所述数据包括交易或区块;
    所述第二节点确定接收到的所述背书结果的数量满足预设值之后,所述第二节点根据所述第二节点对应的私钥分片计算得到所述第二节点对应的第二哈希值和第二随机数;
    所述第二节点接收来自所述第二节点集合中除所述第二节点之外的其他第二节点发送的所述其他第二节点分别对应的第二哈希值和第二随机数;
    所述第二节点根据所述第二集合中的至少一个第二节点分别对应的第二哈希值和第二随机数计算得到第一哈希值和第一随机数;
    所述第二节点向所述区块链中的节点发送所述第一哈希值和第一随机数,
    其中,所述多个节点为所述区块链中对交易进行验证的节点。
  14. 一种第一节点,其特征在于,包括:
    接收单元,用于接收请求消息,所述请求消息用于请求对数据进行编辑,所述数据包括交易或区块;
    背书单元,用于对所述请求消息进行背书,生成背书结果;
    发送单元,用于向至少一个第二节点分别发送所述背书结果,所述至少一个第二节点属于第二节点集合;
    其中,所述第一节点为所述区块链中多个具有背书功能的节点中的任意一个节点,
    所述至少一个第二节点中的每个第二节点已知所述第二节点对应的私钥分片以及所述第二节点集合对应的公钥,所述公钥根据所述至少一个第二节点分别对应的至少一个公钥分片确定。
  15. 根据权利要求14所述的第一节点,其特征在于,所述第一节点还包括:
    处理单元,用于确定所述请求消息具备请求修改所述数据的权限。
  16. 根据权利要求14或15所述的第一节点,其特征在于,在所述发送单元向所述至少一个第二节点分别发送所述背书结果之前,所述第一节点还包括:
    处理单元,用于根据所述数据确定所述第二节点集合;或者,
    所述处理单元还用于根据标识确定所述第二节点集合,所述标识承载于所述请求消息,所述标识用于指示所述第二节点集合。
  17. 根据权利要求14至16中任一项所述的第一节点,其特征在于,所述第一节点还包括:
    处理单元,用于根据第一哈希值和第一随机数验证哈希碰撞,
    其中,所述第一哈希值和第一随机数根据至少一个第二哈希值和至少一个第二随机数得到,所述至少一个第二哈希值和至少一个第二随机数为所述至少一个第二节点中的每个第二节点根据所述第二节点对应的变色龙哈希私钥分片计算出的。
  18. 根据权利要求14至17中任一项所述的第一节点,其特征在于,在所述接收单元接收所述请求消息之前,所述接收单元还用于接收所述数据;
    所述第一节点还包括:
    处理单元,用于根据所述公钥对所述数据进行验证,所述验证包括基于所述公钥进行哈希计算并签名。
  19. 根据权利要求18所述的第一节点,其特征在于,在所述处理单元根据所述公钥对所述数据进行验证之前,所述处理单元还用于确定所述第二节点集合;
    所述处理单元根据所述第二节点集合确定所述公钥。
  20. 根据权利要求19所述的第一节点,其特征在于,所述处理单元确定所述第二节点集合包括:
    所述处理单元根据预配置信息确定所述第二节点集合,所述预配置信息指示所述数据与所述第二节点集合对应;或者,
    所述处理单元根据标识确定所述第二节点集合,所述标识用于指示所述第二节点集合。
  21. 根据权利要求14至20中任一项所述的第一节点,其特征在于,所述发送单元还用于向客户端发送响应消息,所述响应消息中包括所述数据对应的编辑结果。
  22. 根据权利要求14至21中任一项所述的第一节点,其特征在于,所述区块链包括联盟链。
  23. 一种客户端,其特征在于,包括:
    发送单元,用于向多个第一节点分别发送请求消息,所述请求消息用于请求对数据进行编辑,所述数据包括区块或交易,所述请求消息中包括标识,所述标识用于指示第二节点集合;
    接收单元,用于接收来自所述多个第一节点的响应消息,所述响应消息中包括所述数据对应的编辑结果;
    其中,所述第一节点为所述区块链中具有背书功能的节点,所述第二节点集合包括至少一个第二节点,所述至少一个第二节点中的每个第二节点已知所述第二节点对应的私钥分片以及所述第二节点集合对应的公钥,所述公钥根据所述至少一个第二节点分别对应的至少一个公钥分片确定。
  24. 根据权利要求23所述的客户端,其特征在于,在所述发送单元向多个第一节点分别发送请求消息之前,所述发送单元还用于向所述多个第一节点分别发送所述数据;
    所述接收单元还用于分别接收来自所述多个第一节点的验证结果,
    其中,所述验证结果包括基于所述公钥(hk)进行哈希计算并签名的结果。
  25. 一种第二节点,所述区块链中包括第二节点集合,所述第二节点集合包括至少一个第二节点,其特征在于,所述第二节点包括:
    处理单元,用于生成所述第二节点对应的私钥分片和公钥分片;
    发送单元,用于向所述第二节点集合中除所述第二节点之外的其他第二节点发送所述第二节点对应的公钥分片;
    接收单元,用于接收来自所述第二节点集合中除所述第二节点之外的其他第二节点发送的所述其他第二节点分别对应的公钥分片;
    所述处理单元还用于根据所述第二集合中的至少一个第二节点分别对应的公钥分片计算得到所述第二节点集合对应的公钥;
    所述发送单元还用于向所述区块链中的节点发送所述公钥。
  26. 根据权利要求25所述的第二节点,其特征在于,所述接收单元还用于接收来自多个第一节点分别发送的请求消息的背书结果,所述请求消息用于请求对数据进行编辑,所述数据包括交易或区块;
    所述处理单元还用于确定接收到的所述背书结果的数量满足预设值之后,所述第二节点根据所述第二节点对应的私钥分片计算得到所述第二节点对应的第二哈希值和第二随机数;
    所述接收单元还用于接收来自所述第二节点集合中除所述第二节点之外的其他第二节点发送的所述其他第二节点分别对应的第二哈希值和第二随机数;
    所述处理单元还用于根据所述第二集合中的至少一个第二节点分别对应的第二哈希值和第二随机数计算得到第一哈希值和第一随机数;
    所述发送单元还用于向所述区块链中的节点发送所述第一哈希值和第一随机数,
    其中,所述多个节点为所述区块链中对交易进行验证的节点。
  27. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在被处理器运行时,使得所述计算机执行如权利要求1-9中任一项所述的方法,或者使得所述计算机执行如权利要求10或11所述的方法,或者使得所述计算机执行如权利要求12 或13述的方法。
  28. 一种芯片装置,其特征在于,包括处理电路,所述处理电路用于从存储器中调用并运行程序,使得安装有该芯片装置的通信设备执行如权利要求1-9中任一项所述的方法,或者使得所述安装有该芯片装置的通信设备执行如权利要求10或11所述的方法,或者使得所述安装有该芯片装置的通信设备执行如权利要求12或13所述的方法。
PCT/CN2022/084715 2021-05-18 2022-04-01 用于编辑区块链的方法和装置 WO2022242337A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP22803662.0A EP4318287A1 (en) 2021-05-18 2022-04-01 Method and apparatus for blockchain editing
US18/513,014 US20240089132A1 (en) 2021-05-18 2023-11-17 Method and apparatus for editing block chain

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110540087.1 2021-05-18
CN202110540087.1A CN115374450A (zh) 2021-05-18 2021-05-18 用于编辑区块链的方法和装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/513,014 Continuation US20240089132A1 (en) 2021-05-18 2023-11-17 Method and apparatus for editing block chain

Publications (1)

Publication Number Publication Date
WO2022242337A1 true WO2022242337A1 (zh) 2022-11-24

Family

ID=84058264

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/084715 WO2022242337A1 (zh) 2021-05-18 2022-04-01 用于编辑区块链的方法和装置

Country Status (4)

Country Link
US (1) US20240089132A1 (zh)
EP (1) EP4318287A1 (zh)
CN (1) CN115374450A (zh)
WO (1) WO2022242337A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457297A (zh) * 2019-07-10 2019-11-15 北京航空航天大学 基于多授权中心属性加密的可编辑区块链系统及方法
CN110533429A (zh) * 2019-08-30 2019-12-03 北京金山云网络技术有限公司 区块链中的交易背书方法、装置和区块链网络
CN111159306A (zh) * 2020-04-02 2020-05-15 支付宝(杭州)信息技术有限公司 一种基于区块链的信息发布方法、装置及计算机设备
CN111460497A (zh) * 2020-03-30 2020-07-28 中南大学 一种可编辑区块链系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457297A (zh) * 2019-07-10 2019-11-15 北京航空航天大学 基于多授权中心属性加密的可编辑区块链系统及方法
CN110533429A (zh) * 2019-08-30 2019-12-03 北京金山云网络技术有限公司 区块链中的交易背书方法、装置和区块链网络
CN111460497A (zh) * 2020-03-30 2020-07-28 中南大学 一种可编辑区块链系统
CN111159306A (zh) * 2020-04-02 2020-05-15 支付宝(杭州)信息技术有限公司 一种基于区块链的信息发布方法、装置及计算机设备

Also Published As

Publication number Publication date
CN115374450A (zh) 2022-11-22
US20240089132A1 (en) 2024-03-14
EP4318287A1 (en) 2024-02-07

Similar Documents

Publication Publication Date Title
CN111800268B (zh) 用于区块链背书的零知识证明
WO2021179655A1 (zh) 跨区块链的数据迁移方法、装置、设备及存储介质
WO2019205849A1 (zh) 区块链访问的鉴权方法和装置、存储介质、电子装置
US11645632B2 (en) System and method for a decentralized portable information container supporting privacy protected digital information credentialing, remote administration, local validation, access control and remote instruction signaling utilizing blockchain distributed ledger and container wallet technologies
CN108830602B (zh) 一种基于变色龙哈希函数的许可链构造及管控方法
CN115210741B (zh) 部分有序的区块链
JP2021512569A (ja) ブロックチェーンのデータ処理方法、管理側、クライアント側、変換装置及び媒体
KR101658501B1 (ko) 해시함수 기반의 전자서명 서비스 시스템 및 그 방법
Jia et al. Redactable blockchain supporting supervision and self-management
KR20190042567A (ko) 블록체인 상의 동적 액세스 제어
US10887104B1 (en) Methods and systems for cryptographically secured decentralized testing
JP2022541048A (ja) ブロックチェーンを構成するためのセキュリティ層
CN112615847B (zh) 基于区块链的数据共享和隐私保护方法
CN112241919A (zh) 具有数据流控制的多域区块链网络
CN115004625A (zh) 用于区块链分类账的索引结构
CN109981287A (zh) 一种代码签名方法及其存储介质
CN113612770A (zh) 一种跨域安全交互方法、系统、终端以及存储介质
CN112749417A (zh) 基于区块链的电子学位证照数据保护及共享系统
CN116941265A (zh) 区块链网络身份管理使用ssi
EP3817320A1 (en) Blockchain-based system for issuing and validating certificates
Zhang et al. Efficient auditing scheme for secure data storage in fog-to-cloud computing
CN117043772A (zh) 区块链数据分离
CN114329528A (zh) 一种基于区块链的档案数据管理方法及系统
CN109918451A (zh) 基于区块链的数据库管理方法及系统
JP2023530594A (ja) 分散型データベースにおける許可されたイベント処理

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22803662

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022803662

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022803662

Country of ref document: EP

Effective date: 20231102

NENP Non-entry into the national phase

Ref country code: DE