A key generation method, blockchain network service platform and storage medium
By calculating the group key in the blockchain network service platform, the problem of poor security of private data transmission and transaction confirmation after transaction completion is solved, a secure data transmission channel is realized, and the confidentiality and integrity of the data are ensured.
Patent Information
- Application Number
- CN201910039102.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-01-16
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2039-01-16
AI Technical Summary
The existing communication method after the transaction is completed cannot ensure that the communicator is a transaction participant in the blockchain system and lacks an encryption mechanism, resulting in poor security in private data transmission and transaction confirmation.
By calculating the group key using the overlink signature results of at least three nodes in the blockchain network service platform, it is used to encrypt data transmission and realize a secure data transmission channel, avoiding certificate query and additional data storage, and relying solely on The original resources of the blockchain network.
Ensure the security of private data transmission and transaction confirmation after transaction completion, avoid data leakage and tampering, and improve communication security after transaction completion.
Smart Images

Figure CN109617699B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to communication technology, and in particular to a key generation method, a blockchain network service platform and a storage medium. Background Art
[0002] Blockchain technology and its applications are subverting existing business models. All walks of life are actively exploring how to implement their own businesses in the blockchain network, including financial institutions, government departments, traditional enterprises, Internet companies, etc. The blockchain system has the characteristics of being publicly visible, tamper-proof, and unforgeable. It is widely used in the fields of digital currency and supply chain. It can prevent malicious behavior of central nodes, increase the transparency and credibility of transactions, and promote the circulation of digital assets and data information security.
[0003] Cryptographic algorithms and security protocols, as important functional modules of blockchain, effectively guarantee the normal operation and security of blockchain systems. In addition, the protection of communication security after the transaction is completed is also worthy of attention from researchers and designers. After the transaction is completed, the payer, payee and other related parties often need to conduct further information exchange or communication to complete the transmission and transaction confirmation of private data such as paid music, paid movies and TV series. The existing communication methods after the transaction are usually completed with the help of systems other than blockchain, such as instant messaging tools, e-mail, mobile communications and other communication methods. However, these communication methods cannot guarantee that the communicating parties are indeed transaction participants in the blockchain system; at the same time, some of the above methods lack encryption mechanisms, which are easy to leak relevant data content, and the data recipient cannot find out whether the data has been tampered with during the transmission process; therefore, there is a problem of poor security in the transmission and transaction confirmation of private data after the transaction is completed in the relevant technology. Summary of the invention
[0004] The embodiments of the present invention provide a key generation method, a blockchain network service platform and a storage medium to solve the problem of poor security in the transmission of private data and transaction confirmation after the completion of a transaction in the related art.
[0005] The technical solution of the embodiment of the present invention is achieved as follows:
[0006] In a first aspect, an embodiment of the present invention provides a key generation method, the method is applied to a blockchain network service platform, the blockchain network service platform includes a group, the group includes at least three nodes participating in a transaction in the blockchain network platform, the method includes:
[0007] If the transaction involving the at least three nodes is completed, obtain the on-chain signature result corresponding to the group; wherein the on-chain signature result includes the signature result of each of the at least three nodes;
[0008] The group key of the group is calculated based on the uplink signature result by a first node; wherein the group key of the group is used to encrypt data when transmitting data, and the first node is any one of the at least three nodes.
[0009] Optionally, before calculating the group key of the group based on the on-chain signature result by the first node, the method includes:
[0010] Obtaining a first signature result corresponding to the first node from the on-chain signature result;
[0011] Calculate a temporary private key of the first node based on the first signature result;
[0012] Obtaining a second signature result corresponding to the second node and a third signature result corresponding to the third node from the on-chain signature result; wherein the second node and the third node are different, and both the second node and the third node are adjacent to the first node;
[0013] Calculate a first temporary public key of the second node based on the second signature result, and calculate a second temporary public key of the third node based on the third signature result;
[0014] Accordingly, the calculating of the group key of the group based on the on-chain signature result by the first node includes:
[0015] The first node calculates a group key of the group based on the temporary private key of the first node, the first temporary public key, and the second temporary public key.
[0016] Optionally, the calculating, by the first node, the group key of the group based on the temporary private key of the first node, the first temporary public key, and the second temporary public key includes:
[0017] The first node calculates a group key of the group based on a group key exchange protocol, a temporary private key of the first node, the first temporary public key, and the second temporary public key.
[0018] Optionally, the calculating, by the first node based on a group key exchange protocol, a temporary private key of the first node, the first temporary public key, and the second temporary public key, the group key of the group includes:
[0019] Calculating, by the first node, a key material of the first node based on the group key exchange protocol, the temporary private key of the first node, the first temporary public key, and the second temporary public key; wherein the key material is used to generate a group key of the group;
[0020] broadcasting, by the first node, the key material of the first node to nodes other than the first node among the at least three nodes;
[0021] Acquire key material of each of the at least three nodes through the first node;
[0022] The first node calculates a group key of the group based on the group key exchange protocol and key materials of each node.
[0023] Optionally, the calculating the temporary private key of the first node based on the first signature result includes:
[0024] A first random number for signing by the first node is calculated based on the first signature result, and the first random number is determined to be a temporary private key of the first node.
[0025] Optionally, the calculating the first temporary public key of the second node based on the second signature result, and calculating the second temporary public key of the third node based on the third signature result, includes:
[0026] Calculate a second random number required for the second node signature based on the second signature result;
[0027] Calculating the first temporary public key based on the second random number and a base point; wherein the base point is a base point of an elliptic curve associated with the key pairs generated by the at least three nodes;
[0028] Calculate a third random number required for the third node signature based on the third signature result;
[0029] The second temporary public key is calculated based on the third random number and the base point.
[0030] Optionally, the calculating the first temporary public key of the second node based on the second signature result, and calculating the second temporary public key of the third node based on the third signature result, includes:
[0031] Calculate a second random number required for the second node signature based on the second signature result;
[0032] Calculate the first temporary public key based on the second random number and a generator of the group;
[0033] Calculate a third random number required for the third node signature based on the third signature result;
[0034] The second temporary public key is calculated based on the third random number and the generator.
[0035] Optionally, the calculating, by the first node, the group key of the group based on the group key exchange protocol and the key material of each node includes:
[0036] Calculating, by the first node, a shared secret of the group based on the group key exchange protocol and the key material of each node; wherein the shared secret is used to generate a group key of the group;
[0037] A group key of the group is calculated by the first node based on a key derivation function and a shared secret of the group.
[0038] In a second aspect, an embodiment of the present invention provides a blockchain network service platform, the blockchain network service platform comprising:
[0039] A memory for storing executable instructions;
[0040] The processor is used to execute the executable instructions stored in the memory to implement the steps of the above-mentioned key generation method.
[0041] In a third aspect, an embodiment of the present invention provides a storage medium, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the above-mentioned key generation method.
[0042] The following beneficial effects are achieved by applying the embodiments of the present invention: without the need for a Certificate Authority (CA) node or a related management node, a secure data transmission channel can be provided for multiple nodes of the blockchain network service platform. In addition, no other external network or trusted third party is required during the channel construction process, and only the original network channel of the blockchain network service platform and the data in the blockchain are relied on; certificate query, verification and additional data storage are avoided. Several group key exchange protocols in the embodiments of the present invention are authenticated and can bind transaction identities and communication identities. In the embodiments of the present invention, the Burmester-Desmedt (BD) protocol is used, and only one round of interaction is required for each participant to complete the purpose of key exchange. Moreover, the key generation method provided in the embodiments of the present invention can be compatible with the blockchain system that supports the elliptic curve digital signature algorithm ECDSA, the elliptic curve public key cryptography algorithm SM2 and the signature algorithm Schnorr based on the prime number cyclic group in the related technology.
[0043] Because if the transaction is completed with the participation of at least three nodes, the on-chain signature result corresponding to the group is obtained; wherein the on-chain signature result includes the signature result of each of the at least three nodes; the group key of the group is calculated by the first node based on the on-chain signature result; wherein the group key of the group is used to encrypt data when transmitting data, and the first node is any one of the at least three nodes; that is to say, in the embodiment of the present invention, after obtaining the on-chain signature result corresponding to the above-mentioned group, the group key of the above-mentioned group can be calculated based on the on-chain signature result by any node in the group, so that after the transaction is completed, the group key of the above-mentioned group is used to encrypt data during the transmission of private data and transaction confirmation. In this way, a secure data transmission channel is constructed for multiple nodes of the blockchain system. It should be noted that in the embodiment of the present invention, no other external networks or trusted third parties other than the blockchain network service platform are involved in the channel construction process. The group key, i.e., the symmetric key, of the group is generated only by relying on the original network channel of the blockchain network service platform and the data in the blockchain, thereby avoiding certificate query, verification, and additional data storage. In this way, it is ensured that the communication method after the transaction is completed is only based on the original resources of the blockchain network service platform, thereby ensuring that the communicating parties are all transaction participants in the blockchain system, which not only avoids the leakage of relevant data, but also ensures that the data will not be tampered with during the transmission process, solves the problem of poor security of the transmission of private data and transaction confirmation after the transaction is completed in the related technology, and improves the security of the transmission of private data and transaction confirmation after the transaction is completed. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A schematic diagram of the functional architecture of the blockchain network service platform provided by an embodiment of the present invention;
[0045] Figure 2 A schematic diagram of a process for generating a key provided by an embodiment of the present invention;
[0046] Figure 3 A schematic diagram of a flow chart of another key generation method provided by an embodiment of the present invention;
[0047] Figure 4 A schematic diagram of generating a group key based on the DB protocol provided by an embodiment of the present invention;
[0048] Figure 5 A schematic diagram of the structure of a blockchain network service platform provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present invention. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.
[0050] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.
[0051] Before further describing the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations.
[0052] 1) Transaction, equivalent to the computer term "practice", includes three different transaction types: deployment, invocation and query. Deployment transaction is used to install the specified chain code to the node of the blockchain network, and invocation and query type transactions are used to invoke the chain code of the deployment number to implement operations on the relevant data of the target account in the account book, including operations of adding, deleting, checking and modifying the data in the form of key-value pairs in the account, or adding new accounts to the account book. It does not refer to transactions in the business context. In view of the conventional use of the term "transaction" in blockchain technology, the embodiments of the present invention follow this practice.
[0053] 2) Block: A data structure that records the ledger data updated by an exchange over a period of time. It is marked with a timestamp and a unique mark of the previous block (such as a digital fingerprint). After the block is verified by the consensus of the nodes in the blockchain network, it will be appended to the end of the blockchain to become a new block.
[0054] 3) Blockchain: A chain data structure composed of blocks connected in sequence. Each block references the hash value of the previous block or its subset, thereby ensuring that the recorded transactions cannot be tampered with or forged in a cryptographic way.
[0055] 4) Blockchain network, which incorporates new blocks into the blockchain through consensus, a series of decentralized nodes.
[0056] 5) Ledger: The sum of data recorded in the blockchain network in the account dimension, including elements such as ledger data, ledger status, ledger status proof and block index.
[0057] 6) Ledger data, the actual block data storage, that is, a series of orderly and tamper-proof transaction records recorded in the blockchain, which can be expressed in the form of files in the file system. When the smart contract called in the transaction is executed, the account / data in the account is updated.
[0058] 7) Ledger state, also known as state data, is the state of ledger data, which can be expressed in the form of key-value pairs in the database, where the real-time ledger state is used to represent the latest record of key-value pairs updated by consensus exchanges, and the historical ledger state is used to represent the historical record of key-value pairs.
[0059] 8) Consensus is a process in the blockchain network used to reach agreement on transaction results among multiple nodes involved. The mechanisms for achieving consensus include Proof of Work (PoW), Proof of Stake (PoS), Delegated Proof-of-Stake (DPoS), Proof of Elapsed Time (PoET), etc.
[0060] 9) Smart Contracts, also known as chaincode, are programs deployed in the blockchain network that are triggered and executed according to conditions. They are used to operate the ledger by querying, adding, and modifying to query or update the ledger.
[0061] 10) Public Key Infrastructure: It is used to implement functions such as generation, management, storage, distribution and revocation of keys and certificates based on the public key cryptography system.
[0062] 11) Certificate Authority (CA) node, that is, the digital certificate authentication node in the blockchain, is a special node responsible for issuing and managing digital certificates.
[0063] 12) Elliptic Curve Digital Signature Algorithm (ECDSA).
[0064] 13) Elliptic Curve Public Key Cryptography Algorithm (SM2): A signature algorithm recommended by the national cryptography industry standard, also based on elliptic curves.
[0065] 14) Signature algorithm based on prime number cyclic group (Schnorr): A signature algorithm based on prime number cyclic group, one of the most efficient signature algorithms currently.
[0066] The following describes an exemplary functional architecture of the blockchain network service platform that implements an embodiment of the present invention. Figure 1 , Figure 1A functional architecture diagram of a blockchain network service platform provided in an embodiment of the present invention, wherein the blockchain network service platform 100 includes a resource layer 110, a block layer 120, a service layer 130, an interface layer 140 and an application layer 150, which are described below respectively.
[0067] The resource layer 110 encapsulates various forms of resources such as computing resources, storage resources, and network resources on the machine, and is used for the blockchain network deployed by developers according to business needs. The types of resources may include various machines, such as physical machines such as physical hosts, servers, or clusters, or virtual machines such as public clouds or private clouds, or both.
[0068] Computing resources include various forms of processors, such as central processing units (CPUs), application specific integrated circuits (ASICs), application specific integrated circuits, and various forms of processors such as field-programmable gate arrays (FPGAs).
[0069] Storage resources include various types of storage media such as various volatile memories and non-volatile memories. Among them, non-volatile memories can be read-only memories (ROM) and programmable read-only memories (PROM). Volatile memories can be random access memories (RAM), which are used as external cache.
[0070] Network resources include various chips used to implement wired / wireless network communications, such as wired communication processors, wireless communication processors, etc.
[0071] The resource layer 110 is constructed as a cluster consisting of a series of nodes running containers by deploying a management system (e.g., Kubernetes) with a container cluster, shielding the differences in the underlying resources in the resource layer 110 and providing a unified interface to the outside, thereby eliminating the need for various complex calls; the applications of the blockchain network (including various codes that implement the blockchain network) run in an isolated manner in the container, and the container encapsulates the dependencies of the application running so that it can be easily scheduled (for example, when a node fails, or when the application needs to be migrated to a new machine for running) to run on any node in the cluster.
[0072] The block layer 120 encapsulates different solutions for implementing blockchain networks, such as Hyperledger (Fabric), Stellar, Ethereum, and self-developed JD Chain; these solutions standardize the architecture for implementing blockchain networks and the mechanism for achieving consensus, and can be provided as applications in the application store in the blockchain network service platform 100 to support developers to quickly deploy according to needs.
[0073] The service layer 130 encapsulates various services of the blockchain network service platform. Featured services include rapid deployment of blockchain networks, account authentication, enterprise and deployment, unified authentication, microservices and development interfaces; contract management includes upload verification, contract deployment, contract upgrade, contract list, contract library and contract template; monitoring and operation include node management, service upgrade, transaction management, block browsing, account audit and account management.
[0074] The interface layer 140 provides developers with a way to access the blockchain network service platform 100 to deploy and manage the blockchain network, including a web-based approach of a developer's browser and a method of building a software development kit (SDK) / application program interface (API) into the client.
[0075] The application layer 150 encapsulates applications that support different businesses (including traceability, public welfare, evidence storage, electronic invoices, movable property evaluation, transaction calculations, and digital copyrights, etc.), provides modular and reusable applications in the application store, and supports developers to select and deploy them in the blockchain network according to their needs to record various data produced in different business processes. The key generation method provided in the embodiment of the present invention can be implemented based on the application layer 150 in the blockchain network service platform 100.
[0076] In combination with the above, it can be seen that the blockchain network service platform implementing the embodiment of the present invention is realized by deploying a container cluster at the resource layer and running a container encapsulated with a blockchain network application. Therefore, the blockchain network implementing the embodiment of the present invention can be provided in the form of a memory and a processor, and executable instructions are stored in the memory. When the executable instructions are executed by the processor, a container cluster is established on multiple physical machines running the processor and the memory. By running the encapsulated application in the container, the key generation method in the blockchain network service platform of the embodiment of the present invention is implemented.
[0077] The embodiment of the present invention provides a key generation method, which is applied to a blockchain network service platform 100. The blockchain network service platform 100 includes a group, which includes at least three nodes participating in a transaction in the blockchain network platform. In the embodiment of the present invention, the nodes participating in the transaction are also called participants. Figure 2 As shown, the method includes:
[0078] Step 101: If the transaction involving at least three nodes is completed, obtain the corresponding on-chain signature result of the group.
[0079] Among them, the on-chain signature result includes the signature result of each of at least three nodes.
[0080] In an embodiment of the present invention, after the transaction involving the above-mentioned at least three nodes is completed, the blockchain network service platform 100 can obtain the on-chain signature result corresponding to the group including the above-mentioned at least three nodes.
[0081] Step 102: The first node calculates the group key of the group based on the on-chain signature result.
[0082] The group key of the group is used to encrypt data when transmitting data, and the first node is any node among the at least three nodes. Here, the group key of the group is also called a symmetric key.
[0083] In the embodiment of the present invention, after obtaining the on-chain signature result corresponding to the above group, the blockchain network service platform 100 can calculate the group key of the above group based on the on-chain signature result through the first node, so that after the transaction is completed, the group key of the above group is used to encrypt the data in the process of private data transmission and transaction confirmation, so as to build a secure data transmission channel for multiple nodes of the blockchain system. It should be noted that in the embodiment of the present invention, in the process of channel construction, no other external network or trusted third party other than the blockchain network service platform 100 is involved, and the group key of the group, i.e., the symmetric key, is generated only by relying on the original network channel of the blockchain network service platform 100 and the data in the blockchain, thereby avoiding certificate query, verification and additional data storage, so as to ensure that the communication method after the transaction is completed is only based on the original resources of the blockchain network service platform 100, thereby ensuring that the communicating parties are all transaction participants in the blockchain system, so as to avoid the leakage of relevant data, and ensure that the data will not be tampered with during the transmission process, solve the problem of poor security of private data transmission and transaction confirmation after the transaction is completed in the related technology, and improve the security of private data transmission and transaction confirmation after the transaction is completed.
[0084] According to the foregoing embodiment, an embodiment of the present invention provides a key generation method, which is applied to a blockchain network service platform 100. The blockchain network service platform 100 includes a group, which includes at least three nodes participating in a transaction in the blockchain network platform. In the embodiment of the present invention, the nodes participating in the transaction are also called participants, see Figure 3 As shown, the method includes:
[0085] Step 201: If a transaction involving at least three nodes is completed, obtain the corresponding on-chain signature result of the group.
[0086] Among them, the on-chain signature result includes the signature result of each of at least three nodes.
[0087] Step 202: Obtain the first signature result corresponding to the first node from the on-chain signature result.
[0088] In an embodiment of the present invention, after the blockchain network service platform 100 obtains the on-chain signature result corresponding to the above-mentioned group, it can obtain the first signature result corresponding to the first node from the on-chain signature result, and the first signature result is used to restore the temporary private key of the first node.
[0089] Step 203: Calculate a temporary private key of the first node based on the first signature result.
[0090] In the embodiment of the present invention, step 203 of calculating the temporary private key of the first node based on the first signature result can be implemented by the following steps:
[0091] A first random number for signing the first node is calculated based on the first signature result, and the first random number is determined to be a temporary private key of the first node.
[0092] In an embodiment of the present invention, after the blockchain network service platform 100 extracts the first signature result, it calculates the first random number required for the digital signature, and determines that the first random number is a temporary private key of the first node.
[0093] It should be noted that in terms of security, based on the security of the underlying signature algorithm mentioned above, attackers or entities outside the group cannot obtain the corresponding random number, i.e., the temporary private key required in the BD protocol, through the signature value in the blockchain, thereby ensuring the security of the final symmetric key. Moreover, since the signature value on the chain can only be restored by the owner of the private key, the authentication of the protocol is guaranteed.
[0094] Step 204: Obtain the second signature result corresponding to the second node and the third signature result corresponding to the third node from the on-chain signature result.
[0095] The second node and the third node are different, and both the second node and the third node are adjacent to the first node.
[0096] In the embodiment of the present invention, each node, that is, each participant, has a unique ID; illustratively, an ID can be generated for each node according to the order in which the nodes join the blockchain network, and then the adjacent nodes of each node can be determined based on these IDs.
[0097] Step 205: Calculate a first temporary public key of the second node based on the second signature result, and calculate a second temporary public key of the third node based on the third signature result.
[0098] In the embodiment of the present invention, step 205, calculating the first temporary public key of the second node based on the second signature result, and calculating the second temporary public key of the third node based on the third signature result can be implemented by the following steps:
[0099] Step 205a1: Calculate the second random number required for the second node signature based on the second signature result.
[0100] In an embodiment of the present invention, after the blockchain network service platform 100 extracts the second signature result, it calculates the second random number required for the digital signature of the second node, and determines the second random number as the temporary private key of the second node.
[0101] Step 205a2: Calculate a first temporary public key based on the second random number and the base point.
[0102] In an embodiment of the present invention, after the blockchain network service platform 100 obtains the second random number corresponding to the second node, it can obtain the first temporary public key based on the calculation result of the second random number and the base point.
[0103] The base point is a base point of an elliptic curve associated with a key pair generated by at least three nodes.
[0104] In the embodiment of the present invention, the blockchain network service platform 100 can determine the target parameters required for calculating the temporary public key according to the relevant parameters when the signer generates the key pair. Exemplarily, when the relevant parameters when the signer generates the key pair are the base points of the elliptic curve, then the target parameters required for calculating the temporary public key include the base points of the elliptic curve and the random number.
[0105] It should be noted that the relevant parameters when the signer generates the key pair are related to the signature algorithm adopted by the signer; illustratively, when the adopted signature algorithm is ECDSA or SM2, the relevant parameter is the base point of the elliptic curve.
[0106] Step 205a3: Calculate the third random number required for the third node signature based on the third signature result.
[0107] In an embodiment of the present invention, after the blockchain network service platform 100 extracts the third signature result, it calculates the third random number required for the digital signature of the third node, and determines that the third random number is the temporary private key of the third node.
[0108] Step 205a4: Calculate a second temporary public key based on the third random number and the base point.
[0109] In an embodiment of the present invention, after the blockchain network service platform 100 obtains the third random number corresponding to the node, it can obtain the second temporary public key based on the calculation result of the third random number and the base point.
[0110] In another embodiment of the present invention, step 205, calculating the first temporary public key of the second node based on the second signature result, and calculating the second temporary public key of the third node based on the third signature result can be implemented by the following steps:
[0111] Step 205b1: Calculate the second random number required for the second node signature based on the second signature result.
[0112] It should be noted that the operation of step 205b1 in this embodiment is the same as that of step 205a1 in other embodiments, and the description in other embodiments may be referred to, which will not be repeated here.
[0113] Step 205b2: Calculate a first temporary public key based on the second random number and the generator of the group.
[0114] In an embodiment of the present invention, after the blockchain network service platform 100 obtains the second random number corresponding to the second node, it can obtain the first temporary public key based on the calculation result of the second random number and the generator of the group.
[0115] In the embodiment of the present invention, the target parameters required for calculating the temporary public key are determined according to the relevant parameters when the signer generates the key pair. Exemplarily, when the relevant parameters when the signer generates the key pair are the generators of the group, then the target parameters required for calculating the temporary public key include the generators of the group and the random number.
[0116] It should be noted that the relevant parameters when the signer generates the key pair are related to the signature algorithm adopted by the signer; illustratively, when the adopted signature algorithm is Schnorr, the relevant parameters are the generators of the group.
[0117] Step 205b3: Calculate the third random number required for the third node signature based on the third signature result.
[0118] It should be noted that the operation performed in step 205b3 of this embodiment is the same as that performed in step 205a3 of other embodiments, and the description in other embodiments may be referred to, which will not be repeated here.
[0119] Step 205b4: Calculate a second temporary public key based on the third random number and the generator.
[0120] In an embodiment of the present invention, after the blockchain network service platform 100 obtains the third random number corresponding to the node, it can obtain the second temporary public key based on the calculation result of the third random number and the generator.
[0121] Step 206: The first node calculates a group key of the group based on the temporary private key of the first node, the first temporary public key, and the second temporary public key.
[0122] In the embodiment of the present invention, step 206 can be implemented by the first node calculating the group key of the group based on the temporary private key of the first node, the first temporary public key and the second temporary public key by the following steps:
[0123] Step 206A: The first node calculates a group key of the group based on a group key exchange protocol, the temporary private key of the first node, the first temporary public key, and the second temporary public key.
[0124] Here, the group key exchange protocol includes a BD protocol. The blockchain network service platform 100 calculates the group key of the group through the first node based on the BD protocol, the temporary private key of the first node, the first temporary public key and the second temporary public key.
[0125] Here, we briefly explain the BD protocol: The BD protocol is a group key exchange protocol named after two cryptographers, Burmester and Desmedt. The protocol allows n equal participants in a group to generate a shared session key through two rounds of interaction. Since the relationship between the n participants is equal, here we take one participant U in the group as i (U i The BD protocol is briefly described by taking the operation flow of U1 as an example. Assume that n participants are sorted according to the order of their identification (ID), and let U1 = U n+1 , see Figure 4 As shown, the detailed steps of the BD protocol can include the following three stages:
[0126] Phase 1: From Z q Randomly select a positive integer k from i As a temporary private key; calculate As a temporary public key, where Z q represents a non-negative integer less than the prime number q, g is the generator of the cyclic group, and i is a natural number greater than 0. i Send to the two adjacent participants U i-1 and U i+1, and receive temporary public keys Q from both participants i-1 and Q i+1 , then calculate the key material
[0127] Phase 2: Broadcast key material to other participants and receive key material from other participants.
[0128] Phase 2: Based on the data sent to U by other participants i The key material of participant U i Calculate the shared secret K, which is expressed as follows:
[0129]
[0130]
[0131] It should be noted that the blockchain network service platform 100 in the embodiment of the present invention uses the BD protocol as the basic component, and with the help of the characteristics of signature algorithms such as ECDSA, SM2 and Schnorr, a blockchain-based group key generation method is constructed.
[0132] In the embodiment of the present invention, step 206A can be implemented by the first node calculating the group key of the group based on the group key exchange protocol, the temporary private key of the first node, the first temporary public key and the second temporary public key by the following steps:
[0133] Step 206a1: The first node calculates the key material of the first node based on the group key exchange protocol, the temporary private key of the first node, the first temporary public key and the second temporary public key.
[0134] The key material is used to generate a group key of the group.
[0135] In an embodiment of the present invention, the blockchain network service platform 100 substitutes the temporary private key, the first temporary public key and the second temporary public key of the first node into the BD protocol through the first node to obtain the key material of the first node.
[0136] Step 206a2: broadcast the key material of the first node to nodes other than the first node among the at least three nodes through the first node.
[0137] In an embodiment of the present invention, after the blockchain network service platform 100 obtains the key material of the first node through the first node, it broadcasts the key material of the first node to at least three nodes other than the first node through the first node, so that other participants receive the key material of the first node.
[0138] Step 206a3: Obtain key material of each of the at least three nodes through the first node.
[0139] In the embodiment of the present invention, the blockchain network service platform 100 broadcasts its own key material through the first node, that is, broadcasts its own key material through any node in the group. In this way, each node, that is, each participant, can obtain the key material of all participants through only one round of concurrent interaction.
[0140] Step 206a4: The first node calculates a group key of the group based on the group key exchange protocol and the key material of each node.
[0141] In the embodiment of the present invention, step 206a4, calculating the group key of the group by the first node based on the group key exchange protocol and the key material of each node, can be implemented by the following steps:
[0142] In the first step, the first node calculates the group's shared secret based on the group key exchange protocol and the key material of each node.
[0143] The shared secret is used to generate a group key for the group.
[0144] In an embodiment of the present invention, after the blockchain network service platform 100 obtains the key material of each node through the first node, the first node calculates the shared secret of the group based on the group key exchange protocol and the key material of each node.
[0145] In the second step, the first node calculates a group key of the group based on the key derivation function and the shared secret of the group.
[0146] It should be noted here that in the blockchain system, group key exchange technology can be used, and multiple participants can establish a group transmission channel so that information can be exchanged within the group, and provide authentication between entities, confidentiality and integrity of transaction data and other security guarantees. However, some blockchain systems lack special nodes that can provide public key infrastructure, store shared passwords, sign certificates, etc., so it is impossible to use existing algorithms such as ECDSA, SM2 and Schnorr to complete the establishment of a secure channel. However, the key generation method provided in the embodiment of the present invention can be based on the BD protocol and any of the existing algorithms ECDSA, SM2 and Schnorr to meet the functional requirements of secure transmission of group data after multi-party transactions, thereby achieving compatibility with the signature schemes that currently support ECDSA, SM2 and Schnorr. In order to facilitate the understanding of the key generation method provided in the embodiment of the present invention, the key generation method provided by the present invention is further illustrated by the following three examples.
[0147] Example 1, taking the key generation method provided by the embodiment of the present invention based on the ECDSA and BD protocols as an example, the key generation method provided by the embodiment of the present invention is described in detail:
[0148] Briefly introduce the ECDSA signature algorithm: (1) Signer A generates a public-private key pair (d A ,P A =d A G), where G is the base point of the elliptic curve.
[0149] (2) Signer A generates message M A The signature value (r A ,s A ): Calculate e A =H(M A ), H represents the response to message M A Perform hash operation; generate random number k A , calculate (x A ,y A )=[k A ]G; let r A =x A ;calculate
[0150] (3) Verifier B verifies message M A The signature value (r A ,s A ): Calculate e A =H(M A );calculate Verify that r is satisfied A =x A , to determine whether the signature is valid, where r represents the commitment value in the signature result and s represents the proof value in the signature result.
[0151] The group key generation method based on BD protocol and ECDSA includes: (1) Participant U i The corresponding signature result is (r i ,s i ), first, calculate your own temporary private key,
[0152] (2) Based on the on-chain signature results of other participants, extract the temporary public keys of the two adjacent participants in the group, i.e. the signature result (r i-1 ,s i-1 ) and (r i+1 ,s i+1 ), the corresponding temporary public key can be recovered, that is, the elliptic curve point Q i-1 =(x i-1 ,±y i-1 ) and Qi+1 =(x i+1 ,±y i+1 ), where x i-1 =r i-1 and x i+1 =r i+1 , and the ordinate is substituted into the elliptic curve equation y by the abscissa 2 =x 3 +ax+b (a and b are related parameters), so there are both positive and negative values.
[0153] (3) k i and Q i-1 and Q i+1 As input, it is brought into the BD protocol to obtain X i =k i (Q i+1 -Q i-1 ), in the second phase, broadcast x i , and obtain the key material values of other participants to calculate the shared secret K = nk i (Q i-1 )+(n-1)X i +…+X i-2 , the obtained K is a point on the elliptic curve, denoted as (x K ,±y K ); finally calculate sK=KDF(x K ), where KDF is the key derivation function defined in Part 3 of the national cryptographic standard "SM2 Elliptic Curve Public Key Cryptography Algorithm", which can be implemented using a secure hash function, where sK represents the group key.
[0154] Example 2, taking the key generation method provided by the embodiment of the present invention based on the SM2 and BD protocols as an example, the key generation method provided by the embodiment of the present invention is described in detail:
[0155] Briefly introduce the SM2 signature algorithm: (The specific parameter values in the SM2 algorithm can refer to the algorithm flow, recommended curves and parameters in Part 2 and Part 5 of the National Secret Standard "SM2 Elliptic Curve Public Key Cryptography Algorithm"):
[0156] (1) Signer A generates a public-private key pair (d A ,P A =d A G), where G is the base point of the elliptic curve.
[0157] (2) Signer A generates message M A The signature value (r A ,s A ):make Where Z AIt is the SM3 hash value of the identity, curve parameters, base point parameters and signer public key, and || represents the connection between the left and right data; calculation Generate a random number k A , calculate (x A ,y A )=[k A ]G. Calculate r A =(e A +x A ); calculate s A =((1+d A ) -1 ·(k A -r A d A )).
[0158] (3) Verifier B verifies message M A Signature (r A ,s A ):make calculate Calculate t A =r A +s A ; Calculate (x A +y A )=[s A ]G+[t A ]P A ; Calculate R A =e A +x A , test R A =r A Whether it is established, to determine whether the signature is valid.
[0159] The group key generation method based on the BD protocol and SM2 includes: (1) Participant U i The corresponding signature result is (r i ,s i ), first calculate your own temporary private key, k i =s i ·(1+d i )+r i d i .
[0160] (2) Based on the on-chain signature results of other participants (r i-1 ,s i-1 ) and (r i+1 ,s i+1 ), the corresponding temporary public key can be recovered, Q i-1 =(x i-1 ,±y i-1 ) and Q i+1=(x i+1 ,±y i+1 ), where x i-1 =r i-1 -e i-1 , x i+1 =r i+1 -e i+1 ,
[0161] (3) k i and Q i-1 and Q i+1 As input, it is brought into the BD protocol to obtain X i =k i (Q i+1 -Q i-1 ), in the second phase, broadcast X i , and obtain the key material values of other participants, and calculate the shared secret K = nk in the third stage i (Q i-1 )+(n-1)X i +…+X i-2 , the obtained K is the elliptic curve point, denoted as (x K ,±y K ); finally calculate sK=KDF(x K ), where sK represents the group key and KDF is the key derivation function defined in Part 3 of the national cryptographic standard SM2 Elliptic Curve Public Key Cryptography Algorithm.
[0162] Example 3, taking the Schnorr and BD protocols to implement the key generation method provided by the embodiment of the present invention as an example, the key generation method provided by the embodiment of the present invention is described in detail:
[0163] Briefly introduce the Schnorr signature algorithm: (1) Signer A generates a public-private key pair where g is the group generator.
[0164] (2) Signer A uses private key x A and message m A As input, generate the signature value (s A ,e A ), where e A =H(r A ||m A ), s A =k A -e A x A , k A is a random value chosen by the signer and H is the hash function.
[0165] (3) Verifier B uses the signature value (s A ,e A ) and the public key y of signer A A For input, verify whether it satisfies To determine whether the signature is valid.
[0166] The group key generation method based on the BD protocol and Schnorr includes: (1) Participant U i The corresponding signature result is (s i ,e i ), first calculate your own temporary private key, k i =s i +e i x i .
[0167] (2) Based on the on-chain signature results of other participants (s i-1 ,e i-1 ) and (s i+1 ,e i+1 ), the corresponding temporary public key can be recovered. and
[0168] (3) k i and Q i-1 and Q i+1 As input, it is brought into the BD protocol and we get In phase 2, broadcast X i , and obtain the key material values of other participants, and calculate the shared secret in phase 3 Finally, calculate sK=KDF(x K ), where KDF is a key derivation function that can be implemented by a hash function.
[0169] From the above content, it can be seen that in the embodiment of the present invention, the random number required for calculating the digital signature is used as a temporary private key, and the operation result of the random number and the base point (or generator) is used as a temporary public key. With the help of the BD protocol, each participant can generate a group session key, that is, a symmetric key.
[0170] In the embodiment of the present invention, in terms of security, according to the security of the above-mentioned underlying signature algorithm, an attacker (or an entity outside the group) cannot obtain the corresponding random number through the signature value in the blockchain, that is, the temporary private key required in the BD protocol, thereby ensuring the security of the final session key; since the signature value on the chain can only be restored by the owner of the private key, the authentication of the protocol is guaranteed.
[0171] In the embodiment of the present invention, in terms of communication efficiency, the two parties only need to broadcast one round of information to each other before generating the session key, which is not affected by the number of group members; in terms of computing efficiency, the more participants there are, the longer the computing time will be.
[0172] The present invention makes full use of the structural characteristics of digital signature algorithms such as ECDSA, SM2 and Schnorr, so that multi-party transaction participants can recover their own temporary private keys and other parties' temporary public keys by querying the signature records in the blockchain account book after the transaction. Using the BD protocol, each participant can generate a group key with only one round of interaction.
[0173] It should be noted that, for the description of the same steps and the same contents in this embodiment as those in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.
[0174] Based on the foregoing embodiments, an embodiment of the present invention provides a blockchain network service platform, the blockchain network service platform includes a group, the group includes at least three nodes participating in a transaction in the blockchain network platform, and the blockchain network service platform can be applied to Figures 2-3 In a key generation method provided in a corresponding embodiment, referring to Figure 5 As shown, the blockchain network service platform 5 (the blockchain network service platform 5 corresponds to the blockchain network service platform 100) includes: a processor 51, a memory 52 and a communication bus 53, wherein:
[0175] The communication bus 53 is used to implement the communication connection between the processor 51 and the memory 52 .
[0176] The processor 51 is used to execute the key generation program stored in the memory 52 to implement the following steps:
[0177] If the transaction involving the at least three nodes is completed, obtain the on-chain signature result of the group; wherein the on-chain signature result includes the signature result of each of the at least three nodes;
[0178] The group key of the group is calculated based on the uplink signature result by a first node; wherein the group key of the group is used to encrypt data when transmitting data, and the first node is any one of the at least three nodes.
[0179] In other embodiments of the present invention, the processor 51 is used to execute the key generation program stored in the memory 52 to implement the following steps:
[0180] Obtaining a first signature result corresponding to the first node from the on-chain signature result;
[0181] Calculate a temporary private key of the first node based on the first signature result;
[0182] Obtaining a second signature result corresponding to the second node and a third signature result corresponding to the third node from the on-chain signature result; wherein the second node and the third node are different, and both the second node and the third node are adjacent to the first node;
[0183] Calculate a first temporary public key of the second node based on the second signature result, and calculate a second temporary public key of the third node based on the third signature result;
[0184] Accordingly, the calculating of the group key of the group based on the on-chain signature result by the first node includes:
[0185] The first node calculates a group key of the group based on the temporary private key of the first node, the first temporary public key, and the second temporary public key.
[0186] In other embodiments of the present invention, the processor 51 is used to execute the key generation program stored in the memory 52 to implement the following steps:
[0187] The first node calculates a group key of the group based on a group key exchange protocol, a temporary private key of the first node, the first temporary public key, and the second temporary public key.
[0188] In other embodiments of the present invention, the processor 51 is used to execute the key generation program stored in the memory 52 to implement the following steps:
[0189] Calculating, by the first node, a key material of the first node based on the group key exchange protocol, the temporary private key of the first node, the first temporary public key, and the second temporary public key; wherein the key material is used to generate a group key of the group;
[0190] broadcasting, by the first node, the key material of the first node to participating nodes other than the first node among the at least three nodes;
[0191] Acquire key material of each of the at least three nodes through the first node;
[0192] The first node calculates a group key of the group based on the group key exchange protocol and key materials of each node.
[0193] In other embodiments of the present invention, the processor 51 is used to execute the key generation program stored in the memory 52 to implement the following steps:
[0194] A first random number for signing by the first node is calculated based on the first signature result, and the first random number is determined to be a temporary private key of the first node.
[0195] In other embodiments of the present invention, the processor 51 is used to execute the key generation program stored in the memory 52 to implement the following steps:
[0196] Calculate a second random number required for the second node signature based on the second signature result;
[0197] Calculating the first temporary public key based on the second random number and a base point; wherein the base point is a base point of an elliptic curve associated with the key pairs generated by the at least three nodes;
[0198] Calculate a third random number required for the third node signature based on the third signature result;
[0199] The second temporary public key is calculated based on the third random number and the base point.
[0200] In other embodiments of the present invention, the processor 51 is used to execute the key generation program stored in the memory 52 to implement the following steps:
[0201] Calculate a second random number required for the second node signature based on the second signature result;
[0202] Calculate the first temporary public key based on the second random number and a generator of the group;
[0203] Calculate a third random number required for the third node signature based on the third signature result;
[0204] The second temporary public key is calculated based on the third random number and the generator.
[0205] In other embodiments of the present invention, the processor 51 is used to execute the key generation program stored in the memory 52 to implement the following steps:
[0206] Calculating, by the first node, a shared secret of the group based on the group key exchange protocol and the key material of each node; wherein the shared secret is used to generate a group key of the group;
[0207] A group key of the group is calculated by the first node based on a key derivation function and a shared secret of the group.
[0208] It should be noted that the specific implementation process of the steps executed by the processor in this embodiment can refer to Figures 2-3 The implementation process of the key generation method provided in the corresponding embodiment will not be repeated here.
[0209] Based on the foregoing embodiments, an embodiment of the present invention provides a storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following steps:
[0210] If the transaction involving the at least three nodes is completed, obtain the on-chain signature result of the group; wherein the on-chain signature result includes the signature result of each of the at least three nodes;
[0211] The group key of the group is calculated based on the uplink signature result by a first node; wherein the group key of the group is used to encrypt data when transmitting data, and the first node is any one of the at least three nodes.
[0212] In other embodiments of the present invention, the one or more programs may be executed by one or more processors to implement the following steps:
[0213] Obtaining a first signature result corresponding to the first node from the on-chain signature result;
[0214] Calculate a temporary private key of the first node based on the first signature result;
[0215] Obtaining a second signature result corresponding to the second node and a third signature result corresponding to the third node from the on-chain signature result; wherein the second node and the third node are different, and both the second node and the third node are adjacent to the first node;
[0216] Calculate a first temporary public key of the second node based on the second signature result, and calculate a second temporary public key of the third node based on the third signature result;
[0217] Accordingly, the calculating of the group key of the group based on the on-chain signature result by the first node includes:
[0218] The first node calculates a group key of the group based on the temporary private key of the first node, the first temporary public key, and the second temporary public key.
[0219] In other embodiments of the present invention, the one or more programs may be executed by one or more processors to implement the following steps:
[0220] The first node calculates a group key of the group based on a group key exchange protocol, a temporary private key of the first node, the first temporary public key, and the second temporary public key.
[0221] In other embodiments of the present invention, the one or more programs may be executed by one or more processors to implement the following steps:
[0222] Calculating, by the first node, a key material of the first node based on the group key exchange protocol, the temporary private key of the first node, the first temporary public key, and the second temporary public key; wherein the key material is used to generate a group key of the group;
[0223] broadcasting, by the first node, the key material of the first node to participating nodes other than the first node among the at least three nodes;
[0224] Acquire key material of each of the at least three nodes through the first node;
[0225] The first node calculates a group key of the group based on the group key exchange protocol and key materials of each node.
[0226] In other embodiments of the present invention, the one or more programs may be executed by one or more processors to implement the following steps:
[0227] A first random number for signing by the first node is calculated based on the first signature result, and the first random number is determined to be a temporary private key of the first node.
[0228] In other embodiments of the present invention, the one or more programs may be executed by one or more processors to implement the following steps:
[0229] Calculate a second random number required for the second node signature based on the second signature result;
[0230] Calculating the first temporary public key based on the second random number and a base point; wherein the base point is a base point of an elliptic curve associated with the key pairs generated by the at least three nodes;
[0231] Calculate a third random number required for the third node signature based on the third signature result;
[0232] The second temporary public key is calculated based on the third random number and the base point.
[0233] In other embodiments of the present invention, the one or more programs may be executed by one or more processors to implement the following steps:
[0234] Calculate a second random number required for the second node signature based on the second signature result;
[0235] Calculate the first temporary public key based on the second random number and a generator of the group;
[0236] Calculate a third random number required for the third node signature based on the third signature result;
[0237] The second temporary public key is calculated based on the third random number and the generator.
[0238] In other embodiments of the present invention, the one or more programs may be executed by one or more processors to implement the following steps:
[0239] Calculating, by the first node, a shared secret of the group based on the group key exchange protocol and the key material of each node; wherein the shared secret is used to generate a group key of the group;
[0240] A group key of the group is calculated by the first node based on a key derivation function and a shared secret of the group.
[0241] It should be noted that the specific implementation process of the steps executed by the processor in this embodiment can refer to Figures 2-3 The implementation process of the key generation method provided in the corresponding embodiment will not be repeated here.
[0242] The above description is only an embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement and improvement made within the spirit and scope of the present invention are included in the protection scope of the present invention.
Claims
1. A key generation method, It is characterized in that The method is applied to a blockchain network service platform, the blockchain network service platform includes a group, the group includes at least three nodes participating in a transaction in the blockchain network platform, and the method includes: If the transaction involving the at least three nodes is completed, obtain the on-chain signature result corresponding to the group; wherein the on-chain signature result includes the signature result of each of the at least three nodes; Calculating a group key of the group based on the uplink signature result by a first node; wherein the group key of the group is used to encrypt data when transmitting data, and the first node is any one of the at least three nodes; The calculating of the group key of the group based on the on-chain signature result by the first node includes: The group key of the group is calculated by the first node based on the temporary private key of the first node, the first temporary public key of the second node and the second temporary public key of the third node; wherein the second node and the third node are different, and the second node and the third node are both adjacent to the first node.
2. The method according to claim 1, It is characterized in that Before calculating the group key of the group based on the uplink signature result by the first node, the method includes: Obtaining a first signature result corresponding to the first node from the on-chain signature result; Calculate a temporary private key of the first node based on the first signature result; Obtain the second signature result corresponding to the second node and the third signature result corresponding to the third node from the on-chain signature result; A first temporary public key of the second node is calculated based on the second signature result, and a second temporary public key of the third node is calculated based on the third signature result.
3. The method according to claim 1, It is characterized in that The calculating, by the first node, a group key of the group based on the temporary private key of the first node, the first temporary public key of the second node, and the second temporary public key of the third node comprises: The first node calculates a group key of the group based on a group key exchange protocol, a temporary private key of the first node, the first temporary public key, and the second temporary public key.
4. The method according to claim 3, It is characterized in that The calculating, by the first node, a group key of the group based on a group key exchange protocol, a temporary private key of the first node, the first temporary public key, and the second temporary public key, comprises: Calculating, by the first node, a key material of the first node based on the group key exchange protocol, the temporary private key of the first node, the first temporary public key, and the second temporary public key; wherein the key material is used to generate a group key of the group; broadcasting, by the first node, the key material of the first node to nodes other than the first node among the at least three nodes; Acquire key material of each of the at least three nodes through the first node; The first node calculates a group key of the group based on the group key exchange protocol and key materials of each node.
5. The method according to claim 4, It is characterized in that The calculating, by the first node, a group key of the group based on the group key exchange protocol and the key material of each node comprises: Calculating, by the first node, a shared secret of the group based on the group key exchange protocol and the key material of each node; wherein the shared secret is used to generate a group key of the group; A group key of the group is calculated by the first node based on a key derivation function and a shared secret of the group.
6. The method according to claim 2, It is characterized in that The calculating the temporary private key of the first node based on the first signature result includes: A first random number for signing by the first node is calculated based on a first signature result corresponding to the first node, and the first random number is determined to be a temporary private key of the first node.
7. The method according to claim 2, It is characterized in that The calculating the first temporary public key of the second node based on the second signature result, and calculating the second temporary public key of the third node based on the third signature result, includes: Calculate a second random number required for signing the second node based on the second signature result corresponding to the second node; Calculating the first temporary public key based on the second random number and a base point; wherein the base point is a base point of an elliptic curve associated with the key pairs generated by the at least three nodes; Calculate a third random number required for the third node signature based on the third signature result; The second temporary public key is calculated based on the third random number and the base point.
8. The method according to claim 2, It is characterized in that The calculating the first temporary public key of the second node based on the second signature result, and calculating the second temporary public key of the third node based on the third signature result, comprises: Calculate a second random number required for signing the second node based on the second signature result corresponding to the second node; Calculate the first temporary public key based on the second random number and a generator of the group; Calculate a third random number required for the third node signature based on the third signature result; The second temporary public key is calculated based on the third random number and the generator.
9. A blockchain network service platform, It is characterized in that The blockchain network service platform includes: A memory for storing executable instructions; A processor, configured to execute the executable instructions stored in the memory to implement the key generation method according to any one of claims 1 to 8.
10. A storage medium, It is characterized in that Executable instructions are stored, and when the executable instructions are executed, they are used to cause a processor to execute the key generation method according to any one of claims 1 to 8.
