WO2022089518A1 - 地址的生成方法、区块链信息的处理方法以及相关设备 - Google Patents

地址的生成方法、区块链信息的处理方法以及相关设备 Download PDF

Info

Publication number
WO2022089518A1
WO2022089518A1 PCT/CN2021/126962 CN2021126962W WO2022089518A1 WO 2022089518 A1 WO2022089518 A1 WO 2022089518A1 CN 2021126962 W CN2021126962 W CN 2021126962W WO 2022089518 A1 WO2022089518 A1 WO 2022089518A1
Authority
WO
WIPO (PCT)
Prior art keywords
blockchain node
public key
key
private key
blockchain
Prior art date
Application number
PCT/CN2021/126962
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 EP21885245.7A priority Critical patent/EP4216486A4/en
Publication of WO2022089518A1 publication Critical patent/WO2022089518A1/zh
Priority to US18/308,786 priority patent/US20230259926A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/02Payment architectures, schemes or protocols involving a neutral party, e.g. certification authority, notary or trusted third party [TTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • G06Q20/0655Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash e-cash managed centrally
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0838Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these
    • H04L9/0841Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these involving Diffie-Hellman or related key agreement protocols
    • 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/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/085Secret sharing or secret splitting, e.g. threshold schemes
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/42Anonymization, e.g. involving pseudonyms

Definitions

  • the present application relates to the field of computer technology, and in particular, to a method for generating an address, a method for processing blockchain information, and related equipment.
  • the blockchain is essentially a decentralized database. It relies on ingenious distributed algorithms of cryptography and mathematics. On the Internet where trust relationships cannot be established, participants can reach a consensus without the intervention of any third-party center. It solves the problem of reliable delivery of trust and value at a very low cost.
  • the distributed identity and data management platform based on blockchain is the development trend of the future digital world.
  • blockchain is trusted by everyone because of its openness, transparency, and immutability, it is precisely because of its openness and transparency that its privacy issue has become the most concerned issue.
  • the transaction content disclosed on the blockchain will involve buyers and sellers and commodity information, which are all sensitive information. A manufacturer does not want others to know who his retailers are, and a retailer does not want others to know who his customers are.
  • the recipient of the product can use a new public key address in each transaction process, so that from a third party, it is impossible to associate multiple public key addresses with one person, so that protection can be achieved.
  • the effect of privacy requires the receiver to store and manage multiple public and private key pairs, which is difficult to manage.
  • the embodiments of the present application provide a method for generating an address, a method for processing blockchain information, and related equipment, and the shared key used for verification can also be obtained through the public key of the first blockchain node and the second blockchain node.
  • the first private key is generated by the receiver, that is, the receiver can also generate a shared key to verify the transaction information, and the receiver does not need to store and manage multiple public and private key pairs, which reduces the difficulty of management.
  • the embodiments of the present application provide an address generation method, which can be used in the blockchain field.
  • the method includes: the first blockchain node generates a shared key according to the private key of the first blockchain node and the first public key of the second blockchain node; wherein the private key of the first blockchain node is the first The fixed key of the blockchain node, and the first public key of the second blockchain node is the fixed key of the second blockchain node.
  • the first blockchain node generates a temporary first public key address of the second blockchain node according to the shared key and the first transaction content, because the first public key address is only sent from the first blockchain node to the second area.
  • the block chain node is used when sending the first transaction information, so the first public key address is called a temporary public key address, and can also be called a one-time public key address.
  • the first blockchain node writes the first transaction information into the blockchain, that is, the first blockchain node uploads the first transaction information to the chain, and the first transaction information includes the public key address (also known as the public key address of the first blockchain node). That is, the public key address of the transaction sender), the first public key address (that is, the public key address of the transaction recipient), and the first transaction content.
  • the first transaction content is the content of the current transaction between the first blockchain node and the second blockchain node, and the first transaction content includes a timestamp, which is used to indicate the time of the transaction pointed to by the first transaction content .
  • the first blockchain node's The public key addresses are all generated according to the long-term public key of the first blockchain node. If the transaction pointed to by the first transaction content is transferred from the third blockchain node to the first blockchain node, the public key address of the first blockchain node is similar to the first public key address, which is the third area
  • the block chain node is a temporary public key address generated by the first block chain node.
  • the first transaction information written into the blockchain is verified by the second blockchain node according to the first public key address, and the first public key address needs to be verified using the shared key, which is at the second blockchain node Generated by the public key of the first blockchain node and the first private key of the second blockchain node.
  • the public key address of the first transaction information is generated according to the shared key and the first transaction content, and the transaction content in different transactions is different
  • the public key address of each transaction information on the blockchain The key addresses are all one-time, which can well protect the privacy of the recipient; and the shared key can also be generated by the public key of the first blockchain node and the first private key of the second blockchain node. That is, the recipient can also generate a shared key, and generate the public key address of the first transaction information according to the shared key and the first transaction content to verify the transaction information. The recipient does not need to store and manage multiple public-private key pairs, reducing the need for management difficulty.
  • the first blockchain node generates the first public key address of the first transaction information according to the shared key and the first transaction content, including: the first blockchain node according to the shared secret key and the first transaction content to generate a temporary second private key; among them, since the transaction content corresponding to different transactions is different, the private key generated according to different transaction content is different, so the second private key is one-time, or The second private key is temporary, not fixed.
  • the second private key is a key generated in the process of generating the one-time public key address of the second blockchain node, and does not belong to the first blockchain node or the second area.
  • the blockchain node does not need to decrypt any transaction information.
  • the first blockchain node generates a temporary third public key according to the second private key and the second public key of the second blockchain node, and generates a temporary third public key of the second blockchain node according to the temporary third public key.
  • the first public key address It should be noted that the function of the third public key is similar to that of the second private key, and both are keys generated in the process of generating the one-time public key address of the second blockchain node, and do not belong to the first key.
  • the blockchain node does not belong to the second blockchain node, nor does it need to decrypt any transaction information. Regardless of whether the second blockchain node has one set of fixed keys or two sets of fixed keys, the second public key of the second blockchain node is the long-term public key of the second blockchain node.
  • the first public key address is generated according to the second private key and the second public key of the second blockchain node, and the third private key of the second blockchain node can be used to generate the first public key address.
  • the private key used when trading the products in the information, so as to prevent the first blockchain node from being able to spend the products in the first transaction information after transferring the products in the first transaction information to the second blockchain node , to ensure the security of the property of the second blockchain node, including the stability of transactions on the blockchain.
  • the first blockchain node generates the second private key according to the shared key and the first transaction content, including: the first blockchain node generates the second private key according to the shared key and the first transaction content. Perform a combination to obtain a first combination result, and perform a hash operation on the first combination result to generate a second private key.
  • Combination methods include but are not limited to splicing, XOR operation, addition, etc.; the adopted hash functions include but are not limited to SHA256, SHA512 or other hash functions.
  • a specific implementation manner of generating the second private key is provided, which is simple to operate and easy to implement.
  • the first blockchain node generates the first public key address according to the second private key and the second public key of the second blockchain node, including: the first blockchain node In the elliptic curve public key cryptosystem, a temporary third public key is generated according to the temporary second private key and the second public key of the second blockchain node; and under the constraints of the elliptic curve public key cryptosystem , and generate a temporary first public key address according to the temporary third public key.
  • the first blockchain node generates a temporary third public key according to the temporary second private key and the second public key of the second blockchain node in the discrete logarithm public key cryptosystem; Under the constraints of the logarithmic public key cryptosystem, a temporary first public key address is generated according to the temporary third public key.
  • the first blockchain node generates a temporary second private key according to the temporary second private key and the second public key of the second blockchain node in an elliptic curve public key cryptosystem.
  • the third public key of the Generate a temporary public key R, and then add the temporary public key R to the second public key B of the second blockchain node to generate a temporary third public key T, that is, the temporary third public key T R+B.
  • the first blockchain node generates a temporary second private key according to the temporary second private key and the second public key of the second blockchain node in an elliptic curve public key cryptosystem.
  • the third public key of the Generate a temporary public key R, and then subtract the temporary public key R from the second public key B of the second blockchain node to generate a temporary third public key T, that is, the temporary third public key T R-B.
  • the first blockchain node generates a temporary second private key according to the temporary second private key and the second public key of the second blockchain node in an elliptic curve public key cryptosystem.
  • the first blockchain node generates a temporary second private key according to the temporary second private key and the second public key of the second blockchain node in an elliptic curve public key cryptosystem.
  • the third public key of the A temporary third public key T is generated.
  • the first blockchain node in a discrete logarithmic public key cryptosystem, the first blockchain node generates a second private key based on the temporary second private key and the second public key of the second blockchain node.
  • the temporary third public key includes: the first blockchain node performs an exponential operation on the temporary second private key r and the second public key B of the second blockchain node according to the temporary second private key r, to obtain A temporary third public key T is generated; wherein, the second public key B of the second blockchain node is the base of the aforementioned exponentiation operation, and the temporary second private key r is the exponent of the aforementioned exponentiation operation.
  • the first blockchain node generates a shared key according to the private key of the first blockchain node and the first public key of the second blockchain node, including the following two items Any one of: In the elliptic curve public key cryptosystem, the first blockchain node performs point multiplication between the private key of the first blockchain node and the first public key of the second blockchain node to obtain the shared secret. key.
  • the first blockchain node performs an exponential operation according to the private key of the first blockchain node and the first public key of the second blockchain node to obtain the shared key , the first public key of the second blockchain node is the base in the exponential operation, and the private key of the first blockchain node is the exponent in the exponential operation.
  • both the first blockchain node and the second blockchain node have only one set of fixed keys, and the set of fixed keys includes a long-term private key and a long-term public key ;
  • the private key of the first blockchain node refers to the long-term private key of the first blockchain node
  • the first public key of the second blockchain node refers to the long-term public key of the second blockchain node
  • the first public key of the second blockchain node refers to the long-term public key of the second blockchain node.
  • the public key of a blockchain node refers to the long-term public key of the first blockchain node
  • the first private key of the second blockchain node refers to the long-term private key of the second blockchain node.
  • both the first blockchain node and the second blockchain node have two sets of fixed keys
  • the two sets of fixed keys include the first set of fixed keys and the second set of fixed keys
  • the first set of fixed keys includes A long-term private key and a long-term public key
  • the second set of fixed keys includes a scanning private key and a scanning public key
  • the private key of the first blockchain node is the long-term private key of the first blockchain node
  • the second set of fixed keys includes a scanning private key and a scanning public key.
  • the first public key of the blockchain node is the scanning public key of the second blockchain node
  • the public key of the first blockchain node is the long-term public key of the first blockchain node
  • the first public key of the second blockchain node is the public key of the first blockchain node.
  • a private key is the scanning private key of the second blockchain node.
  • the provided processing method for blockchain information is not only applicable to the situation that the blockchain node has only one set of fixed keys, but also to the situation that the blockchain has two sets of fixed keys.
  • the application scenarios of this scheme are presented.
  • the embodiments of the present application provide a method for processing blockchain information, which can be used in the blockchain field.
  • the method includes: the second blockchain node generates a shared key according to the public key of the first blockchain node and the first private key of the second blockchain node; wherein the public key of the first blockchain node is the first The fixed key of the blockchain node, and the first private key of the second blockchain node is the fixed key of the second blockchain node.
  • the second blockchain node reads at least one transaction information on the blockchain, and in the case where the first transaction information exists in the at least one transaction information, it is determined that the transaction pointed to by the first transaction content is a successful transaction; that is, the first transaction
  • the second blockchain node needs to read each transaction information on the blockchain to determine whether each transaction information on the blockchain is the first transaction information one by one.
  • the first transaction information includes the public key address of the first blockchain node, the first transaction content, and the first public key address of the second blockchain node; the public key address of the first blockchain node belongs to the first blockchain node, the first transaction content is the content of the transaction between the first blockchain node and the second blockchain node, and the first public key address can be generated according to the shared key and the first transaction content.
  • the second blockchain node After reading a transaction information, the second blockchain node will obtain the transaction content in the transaction information, and generate a temporary public key address according to the generated shared key and the obtained transaction content.
  • the specific generation method It is consistent with the way of generating the temporary first public key address. Then determine whether the first public key address is consistent with the public key address of the recipient carried in the transaction information. If they are consistent, the transaction information is deemed to be the first transaction information. If they are inconsistent, the transaction information is deemed not to be the first transaction information. 1. Transaction information.
  • the second blockchain node generates a shared key according to the public key of the first blockchain node and the first private key of the second blockchain node, including: the second area In the public key cryptosystem of the elliptic curve, the blockchain node performs point multiplication of the public key of the first blockchain node and the first private key of the second blockchain node to obtain a shared key.
  • the second blockchain node performs an exponential operation according to the public key of the first blockchain node and the first private key of the second blockchain node, and the first block
  • the public key of the chain node is the base in the exponential operation
  • the first private key of the second blockchain node is the exponent in the exponential operation.
  • the method further includes: when the second blockchain node determines that the transaction pointed to by the first transaction information is a successful transaction, when the second blockchain node needs to spend the first transaction
  • the second blockchain node When the product is in the information, the second blockchain node generates the second private key according to the shared key and the first transaction content, and generates the second private key according to the second private key and the third private key of the second blockchain node.
  • a temporary fourth private key of the blockchain node, the fourth private key is used to spend the product in the first transaction message.
  • the third private key of the second blockchain node is the fixed key of the second blockchain node.
  • the second blockchain node Whether the second blockchain node includes one set of fixed keys or two sets of fixed keys, the second blockchain node’s
  • the third private key is the long-term private key of the second blockchain node.
  • a specific generation method for generating the private key for spending the product in the first transaction information is provided, which expands the application of this solution. scene, and increase the integrity of this scheme.
  • the second blockchain node generates a fourth private key of the second blockchain node according to the second private key and the third private key of the second blockchain node, including :
  • the second blockchain node generates a fourth private key of the second blockchain node according to the second private key and the third private key of the second blockchain node, including :
  • the second blockchain node generates a fourth private key of the second blockchain node according to the second private key and the third private key of the second blockchain node, including : In the public key cryptosystem of the elliptic curve, the second blockchain node multiplies the third private key b of the second blockchain node according to the temporary second private key r, the reciprocal of the second private key r and the second blockchain node. A remainder operation is performed on the multiplication result and the order q of the generator to obtain the temporary fourth private key of the second blockchain node.
  • the second blockchain node generates a fourth private key of the second blockchain node according to the second private key and the third private key of the second blockchain node, including :
  • the second blockchain node performs an exponential operation on the temporary second private key r and the third private key b of the second blockchain node to obtain the first operation result;
  • the third private key b is the base of the aforementioned exponentiation operation, and the second private key r is the exponent of the aforementioned exponentiation operation.
  • the second blockchain node performs a remainder operation on the first operation result and the order q of the generator to obtain a temporary fourth private key of the second blockchain node.
  • both the first blockchain node and the second blockchain node only have a set of fixed keys, and the set of fixed keys includes a long-term private key and a long-term public key , the public key of the first blockchain node is the long-term public key of the first blockchain node, and the first private key of the second blockchain node is the long-term private key of the second blockchain node.
  • both the first blockchain node and the second blockchain node have two sets of fixed keys
  • the two sets of fixed keys include the first set of fixed keys and the second set of fixed keys
  • the first set of fixed keys includes A long-term private key and a long-term public key
  • the second set of fixed keys includes a scanning private key and a scanning public key
  • the public key of the first blockchain node is the long-term public key of the first blockchain node
  • the second set of fixed keys includes a scanning private key and a scanning public key.
  • the first private key of the blockchain node is the scanning private key of the second blockchain node.
  • the embodiments of the present application provide an address generation method, which can be used in the blockchain field.
  • the method includes: the first blockchain node generates a shared key according to the private key of the first blockchain node and the first public key of the second blockchain node; the first blockchain node randomly generates a temporary fifth private key , and generate the temporary second public key address of the second blockchain node according to the temporary fifth private key; the fifth private key is the private key generated in the process of generating the one-time public key address of the second blockchain node It does not belong to the first blockchain node, nor does it belong to the second blockchain node, and it does not need to decrypt any transaction information; because the second public key address is only sent to the first blockchain node to the The second blockchain node is used when sending the second transaction information, so the second public key address is called a temporary public key address, and it can also be called a one-time public key address.
  • the first blockchain node uses the shared key to symmetrically encrypt the fifth private key to obtain the encrypted fifth private key; the symmetric encryption algorithm includes but is not limited to the data encryption standard, the 3 data encryption standard, and the advanced encryption standard.
  • the first blockchain node writes the second transaction information into the blockchain, and the second transaction information includes the public key address of the first blockchain node (that is, the public key address of the transaction sender), the second public key address ( That is, the public key address of the transaction recipient), the first transaction content, and the encrypted fifth private key.
  • the first transaction content is the content of the transaction between the first blockchain node and the second blockchain node, and the second transaction information written into the blockchain is performed by the second blockchain node according to the second public key address.
  • the second public key is generated according to the fifth private key
  • the encrypted fifth private key needs to be symmetrically decrypted using the shared key
  • the shared key passes through the public key of the first blockchain node at the second blockchain node.
  • key and the first private key of the second blockchain node are generated.
  • the first blockchain node generates a shared key according to the private key of the first blockchain node and the first public key of the second blockchain node, including one of the following two Any of: the first blockchain node performs point multiplication of the private key of the first blockchain node and the first public key of the second blockchain node in the elliptic curve public key cryptosystem to obtain the shared secret. key.
  • the first blockchain node performs an exponential operation according to the private key of the first blockchain node and the first public key of the second blockchain node, and the second block
  • the first public key of the chain node is the base in the exponential operation
  • the private key of the first blockchain node is the exponent in the exponential operation.
  • the first blockchain node generates the second public key address of the second blockchain node according to the fifth private key, including: the first blockchain node according to the fifth private key and the second public key of the second blockchain node to generate a temporary fourth private key, and generate a temporary second public key address of the second blockchain according to the temporary fourth private key; the temporary fourth public key
  • the key generated in the process of generating the second public key address of the second blockchain node does not belong to the first blockchain node, nor to the second blockchain node, and does not require any transaction information is decrypted.
  • the embodiments of the present application provide a method for processing blockchain information, which can be used in the blockchain field.
  • the method includes: the second block chain node generates a shared key according to the public key of the first block chain node and the first private key of the second block chain node;
  • the transaction information is read, and in the case where the second transaction information exists in at least one transaction information, it is determined that the transaction pointed to by the first transaction content is a successful transaction, that is, the second blockchain node needs to
  • the transaction information is read to determine whether each transaction information on the blockchain is the second transaction information one by one.
  • the second transaction information includes the public key address of the first blockchain node, the second public key address of the second blockchain node, the first transaction content and the encrypted fifth private key; the first blockchain node
  • the public key address belongs to the first blockchain node, the first transaction content is the content of the transaction between the first blockchain node and the second blockchain node, and the encrypted fifth private key can be decrypted by the shared key,
  • the second public key address can be generated from the fifth private key. Specifically, it is directed to the process of judging whether one transaction information is the second transaction information.
  • the second blockchain node After reading a transaction information, the second blockchain node will use the generated shared key to decrypt the encrypted key, and then generate a temporary public key address according to the decryption result, and the method of generating a temporary public key address It is consistent with the method of generating the temporary second public key address, and judges whether the generated public key address is consistent with the public key address of the transaction recipient included in the obtained transaction information. If they are consistent, it proves that the read transaction information is If the second transaction information is inconsistent, it proves that the read transaction information is not the second transaction information.
  • the second blockchain node generates a shared key according to the public key of the first blockchain node and the first private key of the second blockchain node, including: the second area In the public key cryptosystem of the elliptic curve, the blockchain node performs point multiplication of the public key of the first blockchain node and the first private key of the second blockchain node to obtain a shared key.
  • the second blockchain node performs an exponential operation according to the public key of the first blockchain node and the first private key of the second blockchain node, and the first block
  • the public key of the chain node is the base in the exponential operation
  • the first private key of the second blockchain node is the exponent in the exponential operation.
  • the method further includes: the second blockchain node generating the second blockchain node's A temporary sixth private key, the sixth private key is used to spend the product in the second transaction message.
  • the embodiments of the present application provide an apparatus for generating an address, which can be used in the blockchain field.
  • the device for generating the address is applied to the first blockchain node, and the device includes: a generating module for generating a shared key according to the private key of the first blockchain node and the first public key of the second blockchain node; the generating module , and is also used to generate the first public key address of the second blockchain node according to the shared key and the first transaction content; the writing module is used to write the first transaction information into the blockchain, and the first transaction information includes the first transaction information.
  • the public key address of the first blockchain node belongs to the first blockchain node, and the first transaction content is the content of the transaction between the first blockchain node and the second blockchain node, which is written into the blockchain
  • the first transaction information is verified by the second blockchain node according to the first public key address, and the first public key address needs to be verified using the shared key, and the shared key passes through the first block at the second blockchain node
  • the public key of the chain node and the first private key of the second blockchain node are generated.
  • the apparatus for generating an address may also perform the steps performed by the first blockchain node in the first aspect and various possible implementations of the first aspect.
  • the apparatus for generating an address may also perform the steps performed by the first blockchain node in the first aspect and various possible implementations of the first aspect.
  • the concepts of nouns, specific implementation steps, and the beneficial effects brought by each of the possible implementations can be referred to the descriptions in the various possible implementations in the first aspect, and will not be repeated here. .
  • the embodiments of the present application provide an apparatus for processing blockchain information, which can be used in the blockchain field.
  • the block chain information processing device is applied to the second block chain node, and the device includes: a generating module for generating a shared key according to the public key of the first block chain node and the first private key of the second block chain node
  • the reading module is used to read at least one transaction information on the blockchain; the determining module is used to determine the transaction pointed to by the first transaction content when the first transaction information exists in the at least one transaction information.
  • the first transaction information includes the public key address of the first blockchain node, the first transaction content, and the first public key address of the second blockchain node.
  • the public key address of the first blockchain node belongs to the first blockchain node, the first transaction content is the content of the transaction between the first blockchain node and the second blockchain node, and the first public key address can be Generated according to the shared key and the first transaction content.
  • the apparatus for processing blockchain information may also perform the steps performed by the second blockchain node in the second aspect and various possible implementations of the second aspect.
  • the concepts of nouns, specific implementation steps, and the beneficial effects brought by each of the possible implementations of the sixth aspect may refer to the descriptions of the various possible implementations in the second aspect, and will not be described here. Repeat them one by one.
  • an embodiment of the present application provides an address generation device, which can be used in the blockchain field.
  • the device is applied to the first block chain node, and the device includes: a generating module for generating a shared key according to the private key of the first block chain node and the first public key of the second block chain node; the generating module, which further uses The fifth private key is randomly generated, and the second public key address of the second blockchain node is generated according to the fifth private key; the encryption module is used to symmetrically encrypt the fifth private key with the shared key, and obtain the encrypted the fifth private key; the writing module is used to write the second transaction information into the blockchain, where the second transaction information includes the public key address of the first blockchain node, the second public key address, the first transaction content and the encrypted After the fifth private key.
  • the public key address of the first blockchain node belongs to the first blockchain node
  • the first transaction content is the content of the transaction between the first blockchain node and the second blockchain node
  • the encrypted fifth private The key needs to be decrypted using the shared key, which is generated at the second blockchain node by using the public key of the first blockchain node and the first private key of the second blockchain node.
  • the address generating apparatus may also perform the steps performed by the first blockchain node in the third aspect and various possible implementations of the third aspect.
  • the address generating apparatus may also perform the steps performed by the first blockchain node in the third aspect and various possible implementations of the third aspect.
  • the concepts of terms, specific implementation steps, and the beneficial effects brought by each of the possible implementations can be referred to the descriptions in the various possible implementations in the third aspect, and will not be repeated here. .
  • the embodiments of the present application provide an apparatus for processing blockchain information, which can be used in the blockchain field.
  • the block chain information processing device is applied to the second block chain node, and the device includes: a generating module for generating a shared key according to the public key of the first block chain node and the first private key of the second block chain node
  • the reading module is used to read at least one transaction information on the blockchain; the determining module is used to determine the transaction pointed to by the first transaction content when the second transaction information exists in the at least one transaction information. If the transaction is successful, the second transaction information includes the public key address of the first blockchain node, the second public key address of the second blockchain node, the first transaction content, and the encrypted fifth private key.
  • the public key address of the first blockchain node belongs to the first blockchain node
  • the first transaction content is the content of the transaction between the first blockchain node and the second blockchain node
  • the content written in the blockchain The second transaction information is verified by the second blockchain node according to the second public key address
  • the encrypted fifth private key can be decrypted by the shared key
  • the second public key address can be generated according to the fifth private key.
  • the apparatus for processing blockchain information may also perform the steps performed by the second blockchain node in various possible implementations of the fourth aspect.
  • the concepts of nouns, specific implementation steps, and the beneficial effects brought by each of the possible implementations of the eighth aspect may refer to the descriptions of the various possible implementations in the fourth aspect, and will not be repeated here. Repeat them one by one.
  • an embodiment of the present application provides a computer program that, when running on a computer, causes the computer to execute the method for generating an address described in the first aspect or the third aspect, or causes the computer to execute the second method described above.
  • an embodiment of the present application provides a blockchain node, including a processor, where the processor is coupled with the memory; the memory is used to store a program; and the processor is used to execute the A program in the memory that causes the blockchain node to execute the method for generating an address as described in the first aspect or the third aspect above, or causes the blockchain node to execute the address generation method described in the second aspect or the fourth aspect above The processing method of the blockchain information described above.
  • an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when it runs on a computer, causes the computer to execute the above-mentioned first aspect or the third
  • an embodiment of the present application provides a circuit system, where the circuit system includes a processing circuit, and the processing circuit is configured to execute the address generation method described in the first aspect or the third aspect, or, the The processing circuit is configured to execute the blockchain information processing method described in the second aspect or the fourth aspect.
  • an embodiment of the present application provides a chip system, where the chip system includes a processor, configured to support implementing the functions involved in the above aspects, for example, sending or processing the data involved in the above method and/or information.
  • the chip system further includes a memory for storing necessary program instructions and data of the server or the communication device.
  • the chip system may be composed of chips, or may include chips and other discrete devices.
  • FIG. 1 is a schematic flowchart of a method for processing blockchain information provided by an embodiment of the present application
  • FIG. 2 is another schematic flowchart of a method for processing blockchain information provided by an embodiment of the present application
  • FIG. 3 is another schematic flowchart of a method for processing blockchain information provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of still another method for processing blockchain information provided by an embodiment of the present application.
  • FIG. 5 is another schematic flowchart of a method for processing blockchain information provided by an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of still another method for processing blockchain information provided by an embodiment of the present application.
  • FIG. 7 is another schematic flowchart of a method for processing blockchain information provided by an embodiment of the present application.
  • FIG. 8 is a schematic flowchart of still another method for processing blockchain information provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an apparatus for generating an address according to an embodiment of the present application.
  • FIG. 10 is a schematic flowchart of an apparatus for processing blockchain information provided by an embodiment of the present application.
  • FIG. 11 is another schematic structural diagram of an apparatus for generating an address according to an embodiment of the present application.
  • FIG. 12 is another schematic flowchart of the apparatus for processing blockchain information provided by the embodiment of the application.
  • FIG. 13 is a schematic structural diagram of a blockchain node provided by an embodiment of the present application.
  • the embodiments of the present application provide a method for generating an address, a method for processing blockchain information, and related equipment, and the shared key used for verification can also be obtained through the public key of the first blockchain node and the second blockchain node.
  • the first private key is generated by the receiver, that is, the receiver can also generate a shared key to verify the transaction information, and the receiver does not need to store and manage multiple public and private key pairs, which reduces the difficulty of management.
  • the embodiments of the present application can be applied to the blockchain technology, especially in the scenario where the transaction sender wants to hide the real identity of the transaction receiver.
  • the manufacturer does not want others to know who his retailers are, and for example, the retailer does not want others to know who his customers are, etc.
  • the application scenarios of the embodiments of the present application are not exhaustively enumerated here.
  • Blockchain technology is a technical solution that does not rely on third parties and uses its own distributed nodes to store, verify, transmit and communicate network data.
  • the blockchain is capable of recording data in a peer-to-peer network, and each participant can use a consensus algorithm to view the data on the blockchain and verify/reject the data.
  • the verified data will be entered into the ledger as "blocks" and stored on a "chain” that is arranged in chronological order and cannot be changed.
  • blockchain is divided into three types: public chain, private chain and consortium chain.
  • the public chain is open to everyone. Users can access the network and blocks anonymously without registration and authorization. Teen can join and exit the network freely, and participate in bookkeeping and transactions.
  • the public chain is a truly decentralized blockchain. It ensures the security and immutability of transactions through cryptography (asymmetric encryption) algorithms, and establishes mutual trust and consensus mechanisms in unfamiliar network environments. Consensus mechanisms in public chains are generally Proof of Work (POW) and Proof of Stake (POS).
  • POW Proof of Work
  • POS Proof of Stake
  • the public chain is also known as a permissionless chain, that is, you can participate in all network activities without verifying your identity.
  • Bitcoin, Ethereum, most altcoins and smart contracts are built on the public chain, of which the ancestor of the public chain is the Bitcoin blockchain.
  • the public chain is suitable for digital currency, e-commerce, Internet finance, intellectual property and other application scenarios.
  • the private chain is open to individual individuals or entities, and is only used in private organizations (such as within a company). For example, internal office approval and financial auditing, government industry budget and execution, etc.
  • the alliance chain is limited to alliance members. Since all or part of the functions are only open to members, the read and write permissions and accounting rules on the alliance chain are "privately customized" according to the alliance rules.
  • the consensus process on the alliance chain is controlled by pre-selected nodes. Generally speaking, it is suitable for B2B scenarios such as inter-institutional transactions, settlement, or clearing. For example, the People's Bank of China has developed a settlement and clearing system based on the consortium chain. Banks such as ICBC, Zhongnong and Nong join the system as consortium members, and after obtaining the corresponding authorization, they can conduct real-time settlement and clearing between different banks in real time.
  • the consortium chain hardly uses the proof-of-work consensus mechanism but adopts consensus algorithms such as proof-of-stake or practical byzantine fault tolerance (PBTF).
  • PBTF proof-of-stake or practical byzantine fault tolerance
  • the alliance chain is jointly maintained by participating member institutions, and provides a full set of security management functions such as management, authentication, authorization, monitoring, and auditing of participating members.
  • Smart contracts are self-enforcing agreements based on blockchain technology; actions or payments can be triggered automatically once conditions are met.
  • a smart contract is a collection of code and data that can be deployed to run on a blockchain.
  • Smart contracts are more like JAVA programs. JAVA programs are executed by interpreting code bytes through the JAVA virtual machine. Ethereum smart contracts are executed by interpreting bytecodes through the Ethereum Virtual Machine (EVM). Smart contracts have their own accounts, and can automatically perform some functions driven by time or events, such as transferring information between each other and modifying the state of the blockchain such as account information.
  • Asymmetric encryption is a type of cryptographic algorithm in which a pair of keys, a public key and a private key, are required.
  • the aforementioned two keys are mathematically related, and the information obtained by encrypting with a user's key can only be decrypted with the user's decryption key.
  • the public key is known, the private key cannot be calculated.
  • the private key is held by the owner of the key pair and cannot be published, while the public key is published by the owner of the key pair to others.
  • the public key is used to encrypt data, and data encrypted with the public key can only be decrypted using the private key.
  • the embodiments of the present application provide a method for processing blockchain information, which can generate a temporary public key address for the transaction receiver.
  • the transaction sender conducts different transactions with the same transaction receiver, the transaction
  • the public key addresses of the recipients are all different, so that the real identity of the transaction recipient cannot be pointed to by the public key address of the transaction recipient, so as to achieve the purpose of hiding the real identity of the transaction recipient.
  • the transaction receiver does not need to store the temporary public key address for a long time, so as to avoid increasing the management difficulty of the transaction receiver.
  • FIG. 1 and FIG. 2 are two schematic flow charts of the method for processing blockchain information provided by the embodiments of the present application, respectively.
  • FIG. 1 and FIG. 2 it is taken as an example that the transaction sender and the transaction receiver only have one set of fixed keys.
  • FIG. 1 please refer to FIG. 1 first.
  • the implementation manner shown in FIG. 1 is to use a shared key to generate a temporary public key address of the second blockchain node.
  • the first blockchain node (that is, the transaction sender) generates a shared secret according to the private key of the first blockchain node and the first public key of the second blockchain node (that is, the transaction recipient). key.
  • the first block chain node In each transaction, the first block chain node generates a temporary temporary public key address.
  • the first blockchain node uploads the first transaction information, and the first transaction information includes the public key address of the first blockchain node, the first public key address, and the first transaction content.
  • the second blockchain node generates a shared key according to the first private key of the second blockchain node and the public key of the first blockchain node.
  • the second blockchain node reads a plurality of transaction information on the blockchain to judge whether there is first transaction information in the plurality of transaction information according to the shared key; wherein, the first transaction information includes the first transaction information.
  • the public key address, first public key address and first transaction content of a blockchain node the public key address of the first blockchain node belongs to the first blockchain node, and the first transaction content is the first blockchain node
  • the content of the transaction with the second blockchain node, the first public key address needs to be verified using the shared key and the first transaction content.
  • the second blockchain node determines that the first transaction information exists in the multiple transaction information, it is determined that the transaction pointed to by the first transaction information is successful; if the second blockchain node determines that the multiple transaction information does not exist the first transaction information In the case of one transaction information, it is determined that the transaction pointed to by the first transaction information fails. Since the temporary public key address generated for the second blockchain node in each transaction process is generated according to the first transaction content, and the transaction content in different transactions is different, it is guaranteed that the temporary public key address is One-time use, cannot point to a specific transaction recipient. And the second blockchain can complete the verification of transaction information without storing redundant temporary public keys or temporary private keys, and avoid increasing the management difficulty of the transaction recipient.
  • the first blockchain node receives the transaction according to the private key of the first blockchain node and the second blockchain node (that is, the transaction sender). the first public key of the party) to generate a shared key.
  • the first blockchain node randomly generates a temporary fifth private key, and generates the public key address of the second blockchain node according to the temporary fifth private key.
  • the first blockchain node uses the shared key to encrypt the fifth private key to generate an encrypted fifth private key.
  • the first blockchain node uploads the second transaction information
  • the second transaction information includes the public key address of the first blockchain node, the second public key address of the second blockchain node, the first transaction content and The encrypted fifth private key.
  • the second blockchain node generates a shared key according to the first private key of the second blockchain node and the public key of the first blockchain node.
  • the second blockchain node reads multiple transaction information on the blockchain, so as to judge whether there is second transaction information in the multiple transaction information one by one according to the shared key; wherein, the second transaction information includes the first transaction information.
  • the second blockchain node determines that the second transaction information exists in the plurality of transaction information, it is determined that the transaction pointed to by the second transaction information is successful. Since the temporary public key address generated for the second blockchain node in each transaction process is generated according to the randomly generated fifth private key, it is guaranteed that the temporary public key address is one-time and cannot point to a certain A specific transaction recipient. And the second blockchain can complete the verification of transaction information without storing redundant temporary public keys or temporary private keys, and avoid increasing the management difficulty of the transaction recipient.
  • the shared key is used to generate the first public key address
  • FIG. 3 is a schematic flowchart of a method for processing blockchain information provided by an embodiment of the present application.
  • the method for processing blockchain information provided by an embodiment of the present application may include:
  • the first blockchain node generates a shared key according to the private key of the first blockchain node and the first public key of the second blockchain node.
  • the first blockchain node can obtain the private key of the first blockchain node and the first public key of the second blockchain node, according to the private key of the first blockchain node and the second public key of the second blockchain node.
  • the first public key of the blockchain node generates a derived shared key.
  • the first blockchain node and the second blockchain node are two blockchain nodes on the blockchain, the first blockchain node is the sender of the transaction, and the second blockchain node is the receiver of the transaction square.
  • the shared key may also be called a symmetric key or a symmetric shared key, and the second blockchain node can also be generated according to the public key of the first blockchain node and the first private key of the second blockchain node.
  • both the first blockchain node and the second blockchain node only have a set of fixed keys (single-key scheme), and the set of fixed keys includes a long-term private key and a Long-term public key;
  • the private key of the first blockchain node refers to the long-term private key of the first blockchain node, and the first public key of the second blockchain node refers to the long-term public key of the second blockchain node.
  • the public key of the first blockchain node refers to the long-term public key of the first blockchain node, and the first private key of the second blockchain node refers to the long-term private key of the second blockchain node.
  • both the first blockchain node and the second blockchain node have two sets of fixed keys (Dual-Key scheme), and the two sets of fixed keys include the first set of fixed keys and the second set of fixed keys Fixed keys, the first set of fixed keys includes a long-term private key and a long-term public key, and the second set of fixed keys includes a scanning private key and a scanning public key.
  • the long-term private key is also It can be called the spending private key
  • the long-term public key can also be called the spending public key
  • the private key of the first blockchain node is the long-term private key of the first blockchain node
  • the private key of the second blockchain node A public key is the scanning public key of the second blockchain node
  • the public key of the first blockchain node refers to the long-term public key of the first blockchain node
  • the first private key of the second blockchain node refers to is the scanned private key of the second blockchain node.
  • the provided processing method for blockchain information is not only applicable to the situation that the blockchain node has only one set of fixed keys, but also to the situation that the blockchain has two sets of fixed keys. The application scenarios of this scheme are presented.
  • the first blockchain node is based on a static Diffie-Hellman algorithm, and the first blockchain node's The private key is dot-multiplied with the first public key of the second blockchain node to obtain the shared key.
  • the following takes the second blockchain node having two sets of fixed keys as an example, and discloses the formula for the first blockchain node to generate a shared key in the elliptic curve public key cryptosystem An example of:
  • S represents the shared key
  • a represents the private key of the first blockchain node
  • D represents the first public key of the second blockchain node (that is, the scanning public key of the second blockchain node)
  • D is the It is obtained by multiplying the first private key d of the second blockchain node (that is, the scanning private key of the second blockchain node) and the generator (generator, G).
  • G represents the generator of the elliptic curve group. is called the base point on the elliptic curve.
  • the first blockchain node performs an exponent according to the private key of the first blockchain node and the first public key of the second blockchain node operation to get the shared key.
  • the first public key of the second blockchain node is the base in the exponential operation
  • the private key of the first blockchain node is the exponent in the exponential operation.
  • the first public key of the second blockchain node is obtained by performing an exponential operation on the first private key of the second blockchain node and the generator G, and the generator G is obtained. is the base in the exponential operation, and the first private key of the second blockchain node is the exponent in the exponential operation.
  • the generator G represents the generator of the integer group or the generator of the prime number group.
  • the first blockchain node generates a second private key according to the shared key and the first transaction content.
  • the first blockchain node may generate a temporary second private key (generate temporary private key) according to the shared key and the first transaction content.
  • the second private key is one-time, or the second private key is temporary rather than fixed.
  • the second private key is a key generated in the process of generating the one-time public key address of the second blockchain node, and does not belong to the first blockchain node or the second area. The blockchain node does not need to decrypt any transaction information.
  • the first blockchain node combines the shared key and the first transaction content (Txcontents) to obtain a first combination result; performs a hash operation on the first combination result to generate the second private key.
  • the first transaction content refers to the transaction content of the current transaction between the first blockchain node and the second blockchain node, and the first transaction content includes a timestamp, which is used to indicate the time of the transaction pointed to by the first transaction content , as an example, for example, the first transaction content may be "transfer 3 bitcoins", "sell two boxes of kiwifruit", “sell a car”, etc., which will not be exhaustive here.
  • the combination methods include but are not limited to splicing, XOR operation, addition, etc.; the adopted hash functions include but are not limited to SHA256, SHA512, etc., and the combination methods and the adopted hash functions are not exhaustive here.
  • a specific implementation manner of generating the second private key is provided, which is simple to operate and easy to implement.
  • r represents the second private key
  • Txcontents represents the first transaction content
  • S represents the shared key
  • Txcontents S represents the splicing of the first transaction content and the shared key.
  • the first blockchain node generates a first public key address of the second blockchain node according to the second private key.
  • the first blockchain node may generate a temporary third public key (generate temporary public key) according to the temporary second private key, and then according to the temporary third public key , and generate a temporary first public key address of the second blockchain node.
  • the function of the third public key is similar to that of the second private key, and both are keys generated in the process of generating the one-time public key address of the second blockchain node, and do not belong to the first key.
  • the blockchain node does not belong to the second blockchain node, nor does it need to decrypt any transaction information. Since the first public key address is only used when the first blockchain node sends the first transaction information to the second blockchain node, the first public key address is called a temporary public key address, which can also be called a one-time public key address. public key address.
  • the first blockchain node generates the first public key address of the second blockchain node according to the second private key and the second public key of the second blockchain node.
  • the second public key of the second blockchain node Both are the long-term public keys of the second blockchain node.
  • the first public key of the second blockchain node and the second public key of the second blockchain node may be the same key.
  • the first public key of the second blockchain node and the second public key of the second blockchain node can be different keys, and the second blockchain node
  • the first public key of the node is the scanning public key of the second blockchain node
  • the second public key of the second blockchain node is the long-term public key of the second blockchain node.
  • the first public key address is generated according to the second private key and the second public key of the second blockchain node, and the third private key of the second blockchain node can be used to generate the first public key address.
  • the private key used when trading the products in the information, so as to prevent the first blockchain node from being able to spend the products in the first transaction information after transferring the products in the first transaction information to the second blockchain node , to ensure the security of the property of the second blockchain node, including the stability of transactions on the blockchain.
  • step 303 may include: in an elliptic curve public key cryptosystem, the first blockchain node according to the temporary second private key and the second public key of the second blockchain node , generate a temporary third public key, and generate a temporary first public key address according to the temporary third public key.
  • the first blockchain node associates the temporary second private key r with the generator G (that is, according to the temporary second private key r)
  • the first blockchain node associates the temporary second private key r with the generator G (that is, the elliptic curve) according to the temporary second private key r.
  • the first blockchain node associates the temporary second private key r with the second temporary private key r of the second blockchain node according to the temporary second private key r
  • a first public key address is generated.
  • the first blockchain node associates the reciprocal of the temporary second private key r with the second blockchain node according to the temporary second private key r Multiply the second public key B to generate a temporary third public key T, and then, under the constraints of the public key cryptosystem of the elliptic curve, generate the first public key address according to the temporary third public key T, and so on.
  • the method for generating the first public key address in the elliptic curve public key cryptosystem is not exhaustive, and it should be understood that the examples here are only for further understanding of the scheme, and are not used to limit the scheme.
  • step 303 may include: in a discrete logarithmic public key cryptosystem, the first blockchain node generates a second public key based on the temporary second private key and the second public key of the second blockchain node A temporary third public key, and a temporary first public key address is generated according to the temporary third public key.
  • the first blockchain node performs an exponential operation on the temporary second private key r and the second public key B of the second blockchain node according to the temporary second private key r, To generate a temporary third public key T; wherein, the second public key B of the second blockchain node is the base of the aforementioned exponentiation operation, and the temporary second private key r is the exponent of the aforementioned exponentiation operation. Then, under the constraints of the discrete logarithm public key cryptosystem, the first public key address is generated according to the temporary third public key T, etc. Here, it is not necessary to generate the first public key in the discrete logarithm public key cryptosystem.
  • the method of addressing is exhaustive, and it should be understood that the examples here are only for further understanding of the solution, and are not used to limit the solution.
  • the first blockchain node writes first transaction information into the blockchain, where the first transaction information includes the public key address, the first public key address, and the first transaction content of the first blockchain node.
  • the first blockchain node after generating a one-time first public key address for the second blockchain node, the first blockchain node writes the first transaction information into the blockchain, that is, the first transaction information is added to the blockchain. chain.
  • the first transaction information includes the public key address of the first blockchain node (that is, the content of the field Input is the public key address of the transaction sender), the first public key address (that is, the content of the field Output is the transaction receiver. 's public key address) and the first transaction content.
  • the public key address of the first blockchain node belongs to the first blockchain node. If the transaction pointed to by the first transaction content is initiated by the first blockchain node, no matter whether the first blockchain node has One set of fixed keys, or two sets of fixed keys, the public key address of the first blockchain node is generated according to the long-term public key of the first blockchain node. If the transaction pointed to by the first transaction content is transferred from the third blockchain node to the first blockchain node, the public key address of the first blockchain node is the third blockchain node and the first blockchain node.
  • the temporary public key address generated by the node for the specific generation method of the temporary public key address, reference may be made to the descriptions in the above steps 301 to 303, which will not be repeated here.
  • the meaning of the first transaction content reference may be made to the description in the foregoing step 302, which is not repeated here.
  • the first transaction information written into the blockchain is verified by the second blockchain node according to the first public key address, and the first public key address needs to be verified using the shared key, which can pass the first blockchain node.
  • the public key of the second blockchain node and the third private key of the second blockchain node are generated, that is, the second blockchain node can independently generate the aforementioned shared key.
  • the second blockchain node generates a shared key according to the public key of the first blockchain node and the first private key of the second blockchain node.
  • the second blockchain node can obtain the public key of the first blockchain node and the first private key of the second blockchain node, and the second blockchain node can obtain the first blockchain node according to the first blockchain node.
  • the public key of the second blockchain node and the first private key of the second blockchain node generate a shared key.
  • both the first blockchain node and the second blockchain node have only one set of fixed keys, and a set of fixed keys includes a long-term private key and a long-term public key, then the first The public key of the blockchain node refers to the long-term public key of the first blockchain node, and the first private key of the second blockchain node refers to the long-term private key of the second blockchain node.
  • both the first blockchain node and the second blockchain node have two sets of fixed keys
  • the two sets of fixed keys include the first set of fixed keys and the second set of fixed keys
  • the first set of fixed keys includes a long-term private key and a long-term public key
  • the second set of fixed keys includes a scan private key and a scan public key.
  • the public key of the first blockchain node is the long-term public key of the first blockchain node
  • the first private key of the second blockchain node is the scanning private key of the second blockchain node.
  • the second blockchain node is based on the static Diffie-Hellman algorithm, and the first blockchain node The public key of , and the first private key of the second blockchain node are dot-multiplied to obtain the shared key.
  • the following takes the second blockchain node owning two sets of private keys as an example, and discloses an example of the formula for the second blockchain node to generate a shared key in the elliptic curve public key cryptosystem :
  • S represents the shared key
  • d represents the first private key of the second blockchain node (that is, the scanning private key of the second blockchain node)
  • A represents the public key of the first blockchain node
  • A is the It is obtained by multiplying the private key a of the first blockchain node with the generator (generator, G), where G represents the generator of the elliptic curve group, which can also be called the base point on the elliptic curve, then the second blockchain node is also The shared key can be generated.
  • G represents the generator of the elliptic curve group, which can also be called the base point on the elliptic curve
  • an exponential operation is performed according to the public key of the first blockchain node and the first private key of the second blockchain node, and the first block
  • the public key of the chain node is the base in the exponential operation
  • the first private key of the second blockchain node is the exponent in the exponential operation.
  • the public key of the first blockchain node is obtained by performing an exponential operation with the private key of the first blockchain node and the generator G, and the generator G is in the exponential operation.
  • the base of , the private key of the first blockchain node is the exponent in the exponential operation.
  • the generator G represents the generator of the integer group or the generator of the prime number group.
  • the second blockchain node reads at least one transaction information on the blockchain, and determines whether there is first transaction information in at least one transaction information on the blockchain, and if so, determines the content of the first transaction
  • the pointed transaction is a successful transaction; if it does not exist, it is determined that the transaction pointed to by the first transaction content is a transaction failure.
  • the second blockchain node needs to traverse all the transaction information on the blockchain node, that is, it needs to read each transaction information on the blockchain, so as to judge each transaction information on the blockchain one by one.
  • Whether the piece of transaction information is the first transaction information that is, it is determined whether the first transaction information exists in at least one transaction information on the blockchain. In the case where the first transaction information exists in at least one transaction information on the blockchain, it is determined that the transaction pointed to by the first transaction content is a successful transaction; if there is no first transaction information in at least one transaction information on the blockchain In this case, it is determined that the transaction pointed to by the first transaction content is a transaction failure.
  • each transaction information on the blockchain node includes the public key address of the transaction sender (that is, the content in the field Input), the transaction content, and the public key address of the transaction recipient (that is, the content in the field Output) ).
  • the first transaction information includes the public key address of the first blockchain node, the first transaction content, and the first public key address of the second blockchain node; the public key address of the first blockchain node belongs to the first blockchain node, the first transaction content is the content of the transaction between the first blockchain node and the second blockchain node, and the first public key address can be generated according to the shared key and the first transaction content. That is, the first transaction information is characterized in that the second blockchain node can generate the public key address of the transaction recipient according to the generated shared key and the transaction content in the transaction information.
  • the second blockchain node After reading a transaction information, the second blockchain node will acquire the transaction content in the transaction information, and generate a temporary public key address according to the shared key generated in step 305 and the acquired transaction content,
  • the specific generation method is the same as the method for generating the first public key address in steps 302 and 303, and details are not described here.
  • First transaction information After reading a transaction information, the second blockchain node will acquire the transaction content in the transaction information, and generate a temporary public key address according to the shared key generated in step 305 and the acquired transaction content.
  • the specific generation method is the same as the method for generating the first public key address in steps 302 and 303, and details are not described here.
  • the second block chain node performs the above operations on each transaction information on the block chain to determine whether each transaction information on the block chain is the first transaction information.
  • the second blockchain node generates a second private key according to the shared key and the first transaction content.
  • the temporary fourth private key corresponds to the temporary first public key address, that is, the fourth private key needs to be able to use the elliptic curve public key cryptography Under the constraints of the system, or, under the constraints of the discrete logarithm public key cryptography system, the temporary first public key address can be directly generated.
  • the manner in which the second blockchain node generates the temporary fourth private key corresponds to the manner in which the first blockchain node generates the temporary first public key address.
  • the second blockchain node needs to first generate the second private key according to the shared key and the first transaction content.
  • the specific implementation method is consistent with the step of generating the second private key by the first blockchain node in step 302, and the meaning of the second private key is the same as the meaning of the second private key in step 302, both can refer to the description in the above step 302, It is not repeated here.
  • the second blockchain node generates a fourth private key of the second blockchain node according to the second private key, where the fourth private key is used to spend the product in the first transaction information.
  • the second blockchain node generates a temporary fourth private key of the second blockchain node according to the second private key, because the temporary fourth private key needs to be connected with the temporary first public key address
  • the manner in which the second blockchain node generates the fourth private key needs to correspond to the manner in which the first blockchain node generates the first public key address in step 303 .
  • the second blockchain node generates a temporary fourth private key of the second blockchain node according to the second private key and the third private key of the second blockchain node.
  • step 308 may include: in an elliptic curve public key cryptosystem, the second blockchain node according to the temporary second private key and the third private key of the second blockchain node (that is, the long-term private key of the second blockchain node), and generate a temporary fourth private key of the second blockchain node.
  • the second blockchain node includes one set of fixed keys or two sets of fixed keys
  • the third private key of the second blockchain node refers to the long-term private key of the second blockchain node.
  • the second blockchain node uses the temporary second private key r, the second private key r and the second block according to the temporary second private key r.
  • the third private key b of the chain node is added to obtain the first addition result, and a remainder operation is performed on the first addition result and q to obtain the temporary fourth private key of the second blockchain node.
  • the second blockchain node uses the temporary second private key r, the reciprocal of the second private key r and the third Multiply the private key b, and perform a remainder operation on the multiplication result and q to obtain the temporary fourth private key of the second blockchain node, and so on.
  • step 308 may include: in a discrete logarithmic public key cryptosystem, the second blockchain node according to the temporary second private key and the second blockchain node's third private key (also That is, the long-term private key of the second blockchain node) to generate a temporary fourth private key of the second blockchain node.
  • the second blockchain node includes one set of fixed keys or two sets of fixed keys
  • the third private key of the second blockchain node refers to the long-term private key of the second blockchain node.
  • the second blockchain node associates the temporary second private key r with the third
  • the private key b performs an exponent operation to obtain the first operation result
  • the third private key b is the base of the foregoing exponent operation
  • the second private key r is the exponent of the foregoing exponent operation.
  • the second blockchain node performs a remainder operation on the first operation result and q to obtain a temporary fourth private key of the second blockchain node.
  • q represents the order of the generator.
  • FIG. 4 and FIG. 5 respectively show two schematic flowcharts of the method for processing blockchain information provided by the embodiments of the present application.
  • Both Figures 4 and 5 take the elliptic curve public key cryptosystem as an example; the difference between Figure 4 and Figure 5 is that Figure 4 shows that both the first blockchain node and the second blockchain node have only one set of fixed Taking the key as an example, Figure 5 takes as an example that both the first blockchain node and the second blockchain node have two sets of fixed keys.
  • the first blockchain node is configured with a long-term private key a and a long-term public key A
  • the second blockchain node is configured with a long-term private key b and a long-term public key B.
  • C1 The first blockchain node generates a shared key S by performing point multiplication of a and B.
  • the first blockchain node splices the first transaction content with S, and performs a hash operation on the splicing result to generate a temporary second private key r.
  • the temporary third public key T is used to generate the temporary first public key address of the second blockchain node.
  • the first blockchain node uploads the first transaction information to the chain, and the first transaction information includes the public key address of the first blockchain node (that is, the public key address of the transaction sender), the public key address of the second blockchain node The temporary first public key address (that is, the public key address of the transaction recipient) and the first transaction content.
  • the second blockchain node generates a shared key S by performing point multiplication of b and A.
  • C6 The second blockchain node generates a shared key S by performing point multiplication of b and A.
  • the second blockchain node After reading a transaction information on the blockchain, the second blockchain node splices the read transaction content (Txcontents1) with S, and performs a hash operation on the splicing result to generate a temporary Private key r1. It should be noted that if the currently read transaction information is the first transaction information, then Txcontents1 is the same as Txcontents, and r1 is the same as r; if the currently read transaction information is not the first transaction information, then Txcontents1 is different from Txcontents, and r1 is not the same as r. C7.
  • the second blockchain node performs point multiplication of r1 and G, and adds the point multiplication result to B to obtain the addition result, and compares the calculated addition result with the transaction receiver carried in the read transaction information Compare the public key address of the transaction to determine whether the calculated addition result is the same as the read public key address of the transaction recipient. If they are the same, it proves that the read transaction information is the first transaction information, that is, the proof The transaction pointed to by the first transaction information is successful; if all the transaction information on the blockchain is not the first transaction information, it proves that the transaction executed by the first transaction information fails.
  • the second blockchain node In the case that the transaction pointed to by the first transaction information is successful, when the second blockchain node wants to spend the product in the first transaction information, it will also generate the second blockchain node according to the second private key.
  • the first blockchain node is configured with a long-term private key a and a long-term public key A
  • the second blockchain node is configured with a long-term private key b, long-term public key B, scan private key d and scan public key key D.
  • D1 The first blockchain node generates a shared key S by multiplying a and D by a dot.
  • the first blockchain node splices the first transaction content with S, and performs a hash operation on the splicing result to generate a temporary second private key r.
  • the first blockchain node performs point multiplication of r and B to generate a temporary third public key T, and the temporary third public key T is used to generate the temporary first public key address of the second blockchain node .
  • the first blockchain node uploads the first transaction information, and the first transaction information includes the public key address of the first blockchain node (that is, the public key address of the transaction sender), the public key address of the second blockchain node The temporary first public key address (that is, the public key address of the transaction recipient) and the first transaction content.
  • the second blockchain node generates the shared key S by performing dot product of d and A. D6.
  • the second blockchain node After reading a transaction information on the blockchain, the second blockchain node splices the read transaction content (Txcontents1) with S, and performs a hash operation on the splicing result to generate a temporary Private key r1. D7.
  • the second blockchain node performs point multiplication of r1 and B, and judges whether the calculated point multiplication result is the same as the read public key address of the transaction recipient. If they are the same, it proves that the read transaction information is
  • the first transaction information means that the transaction pointed to by the first transaction information is successful; if all the transaction information on the blockchain is not the first transaction information, it proves that the transaction executed by the first transaction information fails. D8.
  • the public key address of the first transaction information is generated based on the shared key and the first transaction content, and the transaction content in different transactions is different
  • the The public key addresses are all one-time, so that the privacy of the recipient can be well protected
  • the shared key can also be generated by the public key of the first blockchain node and the first private key of the second blockchain node. That is to say, the receiver can also generate a shared key, and generate the public key address of the first transaction information according to the shared key and the first transaction content to verify the transaction information, and the receiver does not need to store and manage multiple public and private key pairs, Reduce the difficulty of management. And there is no need to change the format of the transaction information written into the blockchain, which reduces the difficulty of technical updates brought about by this solution.
  • the shared key is used to encrypt the fifth private key
  • FIG. 6 is a schematic flowchart of a method for processing blockchain information provided by an embodiment of the present application.
  • the method for processing blockchain information provided by an embodiment of the present application may include:
  • the first blockchain node generates a shared key according to the private key of the first blockchain node and the first public key of the second blockchain node.
  • the specific implementation manner of the first blockchain node executing step 601 is similar to the specific implementation manner of step 301 in the embodiment corresponding to FIG. 3 , and reference may be made to the description in FIG. 3 , which will not be repeated here.
  • the first blockchain node randomly generates a fifth private key.
  • the first blockchain node randomly generates the fifth private key.
  • the fifth private key is also a temporary one-time private key
  • the function of the fifth private key is similar to that of the second private key in the embodiment corresponding to FIG. 3
  • the fifth private key is a one-time generation of the second blockchain node.
  • the private key generated in the process of identifying the public key address does not belong to the first blockchain node, nor does it belong to the second blockchain node, and there is no need to decrypt any transaction information.
  • Step 601 may be executed first, and then step 602 may be executed, or step 602 may be executed first, and then step 601 may be executed, or steps 601 and 601 may be executed simultaneously. 602.
  • the first blockchain node generates a second public key address of the second blockchain node according to the fifth private key.
  • the first blockchain node after randomly generating the fifth private key, the first blockchain node generates a temporary fourth public key according to the fifth private key, and then generates a second blockchain node according to the temporary fourth public key temporary second public key address.
  • the meaning of the temporary fourth public key is similar to the meaning of the temporary third public key in the embodiment corresponding to FIG. 3, and the function is the same. It is the password generated in the process of generating the second public key address of the second blockchain node. The key does not belong to the first blockchain node, nor to the second blockchain node, nor does it need to decrypt any transaction information.
  • the first blockchain node generates a temporary fourth public key according to the fifth private key and the second public key of the second blockchain node, and then generates a temporary fourth public key according to the temporary fourth public key.
  • Temporary second public key address is a temporary fourth public key according to the fifth private key and the second public key of the second blockchain node.
  • the concept of the second public key address of the second blockchain node and the concept of the second public key of the second blockchain node can refer to the descriptions of the corresponding embodiments in FIG. 3 .
  • the first blockchain node executes the steps
  • the specific implementation of 603 is similar to the specific implementation of step 303 in the embodiment corresponding to FIG. 3 , the difference is only that the second private key in step 303 in the corresponding embodiment of FIG. 3 is replaced with the fifth private key in step 603 .
  • the first blockchain node uses the shared key to symmetrically encrypt the fifth private key to obtain the encrypted fifth private key.
  • the first blockchain node will use the shared key generated in step 601 to symmetrically encrypt the fifth private key to obtain the encrypted fifth private key.
  • the encrypted fifth private key can be represented as En(h, S), h represents the randomly generated fifth private key, S represents the shared key, and En(h, S) represents the use of the shared key to symmetric to h encryption.
  • Symmetric encryption algorithms refer to encryption algorithms that use the same key for encryption and decryption. Symmetric encryption algorithms include but are not limited to data encryption standard (DES, data encryption standard), 3 data encryption standard (3DES, triple data encryption standard), Advanced encryption standard (AES, advanced encryption standard) or other symmetric encryption algorithms, etc., are not listed here. Which symmetric encryption algorithm to use can be flexibly selected according to the actual situation, which is not limited here.
  • Step 603 may be executed first, and then step 604 may be executed, or step 604 may be executed first, and then step 603 may be executed, or steps 603 and 603 may be executed simultaneously. 604.
  • the first blockchain node writes the second transaction information into the blockchain, where the second transaction information includes the public key address of the first blockchain node, the second public key address, the first transaction content, and the encrypted first transaction information. Five private keys.
  • the first block chain node writes the second transaction information into the block chain, that is, the second transaction information is uploaded to the chain.
  • the second transaction information includes the public key address of the first blockchain node, the second public key address (that is, the temporary public key address of the second blockchain node), the first transaction content, and the encrypted fifth private key.
  • the key, that is, the format of the second transaction information is that the content of the field Input is the public key address of the first blockchain node (that is, the public key address of the transaction sender), and the content of the field Output is the second blockchain node.
  • the second public key address that is, the public key address of the transaction recipient
  • the content of the field transaction content is the first transaction content and the encrypted fifth private key
  • the field transaction content can be expressed as (Txcontents, En(h, S )).
  • the public key address of the first blockchain node belongs to the first blockchain node
  • the first transaction content is the content of the transaction between the first blockchain node and the second blockchain node, which is written into the blockchain.
  • the second transaction information is verified by the second blockchain node according to the second public key address.
  • the second public key address is generated according to the fifth private key.
  • the encrypted fifth private key needs to be decrypted using the shared key.
  • the key is generated at the second blockchain node from the public key of the first blockchain node and the first private key of the second blockchain node.
  • the second blockchain node generates a shared key according to the public key of the first blockchain node and the first private key of the second blockchain node.
  • step 606 performed by the first blockchain node is similar to the specific implementation of step 305 in the embodiment corresponding to FIG. 3 , and reference may be made to the description in FIG.
  • the second blockchain node reads at least one transaction information on the blockchain, and determines whether there is second transaction information in the at least one transaction information on the blockchain, and if so, determines the content of the first transaction
  • the pointed transaction is a successful transaction; if it does not exist, it is determined that the transaction pointed to by the first transaction content is a transaction failure.
  • the second blockchain node needs to traverse all the transaction information on the blockchain node, that is, it needs to read each transaction information on the blockchain, so as to judge each transaction information on the blockchain one by one. Whether the piece of transaction information is the second transaction information, that is, it is determined whether the second transaction information exists in at least one transaction information on the blockchain. In the case where the second transaction information exists in at least one transaction information on the blockchain, it is determined that the transaction pointed to by the first transaction content is a successful transaction; if there is no second transaction information in at least one transaction information on the blockchain In this case, it is determined that the transaction pointed to by the first transaction content is a transaction failure.
  • each transaction information on the blockchain node includes the public key address of the transaction sender (that is, the content in the field Input), the public key address of the transaction receiver (that is, the content in the field Output), the transaction The transaction content between the sender and the transaction receiver and the encrypted fifth private key.
  • the second transaction information includes the public key address of the first blockchain node, the second public key address of the second blockchain node, the first transaction content, and the encrypted fifth private key.
  • the encrypted fifth private key can be By decrypting the shared key generated by the second blockchain node, the second public key address can be generated according to the fifth private key.
  • the second blockchain node After reading a transaction information, the second blockchain node will use the generated shared key to decrypt the encrypted key, and then use the method in step 603 to generate a public key address according to the decryption result, and determine whether to generate a public key address. Whether the public key address of the received transaction information is consistent with the public key address of the transaction recipient included in the obtained transaction information. If they are consistent, it proves that the read transaction information is the second transaction information. If not, it proves that the read transaction information is the second transaction information. Not second transaction information.
  • the second blockchain node performs the above operations on each transaction information on the blockchain to determine whether each transaction information on the blockchain is the second transaction information.
  • the second blockchain node generates a sixth private key of the second blockchain node according to the fifth private key, where the sixth private key is used to spend the product in the second transaction information.
  • the temporary sixth private key corresponds to the temporary second public key address, that is, the sixth private key needs to be able to use the elliptic curve public key cryptography Under the constraints of the system, or, under the constraints of the discrete logarithm public key cryptography system, the temporary second public key address can be directly generated.
  • the second blockchain node generates a temporary sixth private key of the second blockchain node according to the fifth private key and the third private key of the second blockchain node.
  • step 608 may include: in an elliptic curve public key cryptosystem, the second blockchain node according to the temporary fifth private key and the third private key of the second blockchain node (that is, the long-term private key of the second blockchain node), and generate a temporary sixth private key of the second blockchain node.
  • the second private key in step 308 is replaced with the fifth private key in step 608, it should be noted that the public key in the elliptic curve In the cryptosystem, it needs to be satisfied that after the generated temporary sixth private key is dot-multiplied by the generator G, it needs to be equal to the temporary fourth public key generated in step 603 .
  • step 608 may include: in a discrete logarithmic public key cryptosystem, the second blockchain node according to the temporary fifth private key and the second blockchain node's third private key (also That is, the long-term private key of the second blockchain node) to generate a temporary sixth private key of the second blockchain node.
  • the second private key in step 308 is replaced with the fifth private key in step 608.
  • FIG. 7 and FIG. 8 respectively show two schematic flowcharts of the method for processing blockchain information provided by the embodiments of the present application.
  • Both Figures 7 and 8 take the elliptic curve public key cryptosystem as an example; the difference between Figure 7 and Figure 8 is that Figure 7 shows that both the first blockchain node and the second blockchain node have only one set of fixed Taking the key as an example, Figure 8 takes the first blockchain node and the second blockchain node both possessing two sets of fixed keys as an example.
  • the first blockchain node is configured with a long-term private key a and a long-term public key A
  • the second blockchain node is configured with a long-term private key b and a long-term public key B.
  • the first blockchain node generates a shared key S by performing point multiplication of a and B.
  • the first blockchain node randomly generates a temporary fifth private key h.
  • the first blockchain node performs point multiplication of h and G, and adds the point multiplication result to B to generate a temporary third public key M, which is used to generate the second block
  • the temporary second public key address of the chain node E4.
  • the first blockchain node uses the shared key to symmetrically encrypt the fifth private key to obtain the encrypted fifth private key.
  • the first blockchain node uploads the second transaction information on the chain, and the second transaction information includes the public key address of the first blockchain node (that is, the public key address of the transaction sender), the public key address of the second blockchain node The temporary second public key address (that is, the public key address of the transaction recipient), the first transaction content, and the encrypted fifth private key.
  • the second blockchain node generates a shared key S by performing point multiplication of b and A.
  • E7 After reading a transaction information on the blockchain, the second blockchain node decrypts the encrypted private key in the read transaction information through the shared key, and obtains the decryption result h1.
  • the second blockchain node performs point multiplication of h1 and G, and adds the point multiplication result to B to obtain the addition result, and compares the calculated addition result with the transaction receiver carried in the read transaction information. Compare the public key address of the transaction to determine whether the calculated addition result is the same as the read public key address of the transaction recipient.
  • the second blockchain node in Figure 8 is configured with a long-term private key b, a long-term public key B, a scanning private key d, and a scanning public key D.
  • the first blockchain node generates a shared key S by multiplying a and D by a dot; in step F6, the second blockchain node generates a shared key by multiplying d and A by a dot. key S.
  • the first blockchain node performs point multiplication of h and B to generate a temporary fourth public key M.
  • the second blockchain node points h1 and B.
  • FIG. 9 is a schematic structural diagram of an apparatus for generating an address according to an embodiment of the present application.
  • the address generating apparatus 900 is applied to the first blockchain node, and the address generating apparatus 900 includes a generating module 901 and a writing module 902 .
  • the generation module 901 is used to generate the shared key according to the private key of the first blockchain node and the first public key of the second blockchain node; the generation module 901 is also used to generate the shared key according to the shared key and the first transaction The content generates the first public key address of the second blockchain node; the writing module 902 is used to write the first transaction information into the blockchain, where the first transaction information includes the public key address of the first blockchain node, the first transaction information a public key address and the first transaction content.
  • the first transaction content is the content of the transaction between the first blockchain node and the second blockchain node, and the first transaction information written into the blockchain is stored by the second blockchain node according to the first public key address
  • the first public key address needs to be verified using the shared key, which is generated at the second blockchain node by the public key of the first blockchain node and the first private key of the second blockchain node .
  • the generating module 901 is specifically configured to generate the second private key according to the shared key and the first transaction content, and generate the first private key according to the second private key and the second public key of the second blockchain node public key address.
  • the generating module 901 is specifically configured to combine the shared key and the first transaction content to obtain a first combination result, and perform a hash operation on the first combination result to generate the second private key.
  • the generating module 901 is specifically configured to: in the public key cryptosystem of the elliptic curve, generate the third public key according to the second private key and the second public key of the second blockchain node, and generate the first public key address according to the third public key; or, in the discrete logarithm public key cryptosystem, generate the third public key according to the second private key and the second public key of the second blockchain node , and generate the first public key address according to the third public key.
  • the generating module 901 is specifically configured to perform any one of the following two items: in the public key cryptosystem of elliptic curve, the private key of the first blockchain node is combined with the second block The first public key of the chain node is dot-multiplied to obtain the shared key; or, in the discrete logarithm public key cryptosystem, according to the private key of the first blockchain node and the first public key of the second blockchain node
  • the first public key of the second block chain node is the base in the exponent operation
  • the private key of the first block chain node is the exponent in the exponent operation.
  • both the first blockchain node and the second blockchain node have only one set of fixed keys, and the set of fixed keys includes a long-term private key and a long-term public key, and the first block
  • the private key of the blockchain node is the long-term private key of the first blockchain node
  • the first public key of the second blockchain node is the long-term public key of the second blockchain node
  • the public key of the first blockchain node is the long-term public key of the first blockchain node
  • the first private key of the second blockchain node is the long-term private key of the second blockchain node.
  • both the first blockchain node and the second blockchain node have two sets of fixed keys
  • the two sets of fixed keys include the first set of fixed keys and the second set of fixed keys
  • the first set of fixed keys includes A long-term private key and a long-term public key
  • the second set of fixed keys includes a scanning private key and a scanning public key
  • the private key of the first blockchain node is the long-term private key of the first blockchain node
  • the second set of fixed keys includes a scanning private key and a scanning public key.
  • the first public key of the blockchain node is the scanning public key of the second blockchain node
  • the public key of the first blockchain node is the long-term public key of the first blockchain node
  • the first public key of the second blockchain node is the public key of the first blockchain node.
  • a private key is the scanning private key of the second blockchain node.
  • FIG. 10 is a schematic structural diagram of the apparatus for processing blockchain information provided by an embodiment of the present application.
  • the block chain information processing apparatus 1000 is applied to the second block chain node, and the block chain information processing apparatus 1000 includes a generating module 1001 , a reading module 1002 and a determining module 1003 .
  • the generating module 1001 is used for generating a shared key according to the public key of the first blockchain node and the first private key of the second blockchain node;
  • the reading module 1002 is used for at least one The transaction information is read;
  • the determination module 1003 is configured to determine that the transaction pointed to by the first transaction content is a successful transaction when the first transaction information exists in at least one transaction information, and the first transaction information includes the first blockchain node.
  • the public key address of the first blockchain node belongs to the first blockchain node, the first transaction content is the content of the transaction between the first blockchain node and the second blockchain node, and the first public key address can be Generated according to the shared key and the first transaction content.
  • the generating module 1001 is specifically used for: in the public key cryptosystem of elliptic curve, the public key of the first blockchain node and the first private key of the second blockchain node are encrypted Multiply to obtain the shared key; or, in the discrete logarithm public key cryptosystem, perform exponential operation according to the public key of the first blockchain node and the first private key of the second blockchain node, the first area
  • the public key of the blockchain node is the base in the exponential operation
  • the first private key of the second blockchain node is the exponent in the exponential operation.
  • the generating module 1001 is further configured to generate the second private key according to the shared key and the first transaction content; the generating module 1001 is further configured to generate the second private key according to the second private key and the second blockchain node The third private key of the second blockchain node is generated, and the fourth private key is used to spend the products in the first transaction information.
  • both the first blockchain node and the second blockchain node have only one set of fixed keys, and the set of fixed keys includes a long-term private key and a long-term public key, and the first block
  • the public key of the blockchain node is the long-term public key of the first blockchain node
  • the first private key of the second blockchain node is the long-term private key of the second blockchain node.
  • both the first blockchain node and the second blockchain node have two sets of fixed keys
  • the two sets of fixed keys include the first set of fixed keys and the second set of fixed keys
  • the first set of fixed keys includes A long-term private key and a long-term public key
  • the second set of fixed keys includes a scanning private key and a scanning public key
  • the public key of the first blockchain node is the long-term public key of the first blockchain node
  • the second set of fixed keys includes a scanning private key and a scanning public key.
  • the first private key of the blockchain node is the scanning private key of the second blockchain node.
  • FIG. 11 is a schematic structural diagram of an apparatus for generating an address provided by an embodiment of the present application.
  • the address generating apparatus 1100 is applied to the first blockchain node, and the address generating apparatus 1100 includes a generating module 1101 , an encryption module 1102 , and a writing module 1103 .
  • the generation module 1101 is used to generate a shared key according to the private key of the first blockchain node and the first public key of the second blockchain node; the generation module 1101 is also used to randomly generate a fifth private key, and The second public key address of the second blockchain node is generated according to the fifth private key; the encryption module 1102 is used for symmetrically encrypting the fifth private key by using the shared key to obtain the encrypted fifth private key; the writing module 1103, for writing second transaction information into the blockchain, where the second transaction information includes the public key address of the first blockchain node, the second public key address, the first transaction content, and the encrypted fifth private key.
  • the public key address of the first blockchain node belongs to the first blockchain node
  • the first transaction content is the content of the transaction between the first blockchain node and the second blockchain node
  • the content written in the blockchain The second transaction information is verified by the second blockchain node according to the second public key address.
  • the second public key address is generated according to the fifth private key.
  • the encrypted fifth private key needs to be decrypted using the shared key.
  • the key is generated at the second blockchain node from the public key of the first blockchain node and the first private key of the second blockchain node.
  • the generation module 1101 is specifically configured to execute any one of the following two items: in the public key cryptosystem of elliptic curve, the private key of the first blockchain node is combined with the second block The first public key of the chain node is dot-multiplied to obtain the shared key; or, in the discrete logarithm public key cryptosystem, according to the private key of the first blockchain node and the first public key of the second blockchain node
  • the first public key of the second block chain node is the base in the exponent operation
  • the private key of the first block chain node is the exponent in the exponent operation.
  • the generating module 1101 is specifically configured to generate the second public key address according to the fifth private key and the second public key of the second blockchain node.
  • FIG. 12 is a schematic structural diagram of the apparatus for processing blockchain information provided by an embodiment of the present application.
  • the block chain information processing apparatus 1200 is applied to the second block chain node, and the block chain information processing apparatus 1200 includes a generating module 1201 , a reading module 1202 and a determining module 1203 .
  • the generating module 1201 is used to generate a shared key according to the public key of the first blockchain node and the first private key of the second blockchain node; the reading module 1202 is used to generate a shared key for at least one The transaction information is read; the determination module 1203 is used to determine that the transaction pointed to by the first transaction content is a successful transaction when the second transaction information exists in at least one transaction information, and the second transaction information includes the first blockchain node. , the second public key address of the second blockchain node, the first transaction content, and the encrypted fifth private key.
  • the public key address of the first blockchain node belongs to the first blockchain node
  • the first transaction content is the content of the transaction between the first blockchain node and the second blockchain node
  • the encrypted fifth private The key can be decrypted by the shared key, and the second public key address can be generated from the fifth private key.
  • the generating module 1201 is specifically configured to perform any one of the following two items: in the public key cryptosystem of the elliptic curve, the public key of the first blockchain node and the second block
  • the first private key of the chain node is dot-multiplied to obtain the shared key; or, in the discrete logarithm public key cryptosystem, according to the public key of the first blockchain node and the first private key of the second blockchain node
  • the public key of the first blockchain node is the base in the exponential operation
  • the first private key of the second blockchain node is the exponent in the exponential operation.
  • the generating module 1201 is further configured to generate the sixth private key and the sixth private key of the second blockchain node according to the fifth private key and the third private key of the second blockchain node Used to spend the product in the second transaction information.
  • An embodiment of the present application also provides a blockchain node.
  • FIG. 13 is a schematic structural diagram of a blockchain node provided by an embodiment of the present application.
  • the first blockchain node described in the embodiments corresponding to FIG. 3 to FIG. 5 may be deployed on the blockchain node 1300 to implement the function of the address generating apparatus 900 in the embodiment corresponding to FIG. 9 .
  • the second blockchain node described in the embodiments corresponding to FIG. 3 to FIG. 5 may be deployed on the blockchain node 1300 to implement the functions of the blockchain information processing apparatus 1000 in the embodiment corresponding to FIG. 10 .
  • the blockchain node 1300 may be deployed on the blockchain node 1300 to implement the function of the address generating apparatus 1100 in the corresponding embodiment of FIG. 11 .
  • the second blockchain node described in the embodiments corresponding to FIG. 6 to FIG. 8 may be deployed on the blockchain node 1300 to implement the functions of the blockchain information processing apparatus 1200 in the embodiment corresponding to FIG. 12 .
  • the blockchain node 1300 includes: a receiver 1301, a transmitter 1302, a processor 1303, and a memory 1304 (wherein the number of processors 1303 in the blockchain node 1300 can be one or more, and in FIG.
  • the processor 1303 may include an application processor 13031 and a communication processor 13032.
  • the receiver 1301, the transmitter 1302, the processor 1303, and the memory 1304 may be connected through a bus or other means.
  • Memory 1304 may include read-only memory and random access memory, and provides instructions and data to processor 1303 .
  • a portion of memory 1304 may also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the memory 1304 stores processors and operating instructions, executable modules or data structures, or a subset thereof, or an extended set thereof, wherein the operating instructions may include various operating instructions for implementing various operations.
  • the processor 1303 controls the operation of the data generating means.
  • various components of the data generating apparatus are coupled together through a bus system, where the bus system may include a power bus, a control bus, a status signal bus, and the like in addition to the data bus.
  • the various buses are referred to as bus systems in the figures.
  • the methods disclosed in the above embodiments of the present application may be applied to the processor 1303 or implemented by the processor 1303 .
  • the processor 1303 may be an integrated circuit chip, which has signal processing capability. In the implementation process, each step of the above-mentioned method can be completed by an integrated logic circuit of hardware in the processor 1303 or an instruction in the form of software.
  • the above-mentioned processor 1303 can be a general-purpose processor, a digital signal processor (digital signal processing, DSP), a microprocessor or a microcontroller, and may further include an application specific integrated circuit (ASIC), a field programmable Field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP digital signal processing
  • ASIC application specific integrated circuit
  • FPGA field programmable Field-programmable gate array
  • the processor 1303 may implement or execute the methods, steps, and logical block diagrams disclosed in the embodiments of this application.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory 1304, and the processor 1303 reads the information in the memory 1304, and completes the steps of the above method in combination with its hardware.
  • the receiver 1301 can be used to receive input numerical or character information, and generate signal input related to the relevant settings and function control of the data generating device.
  • the transmitter 1302 can be used to output digital or character information through the first interface, and the transmitter 1302 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group, and the transmitter 1302 can also include a display device such as a display screen .
  • the application processor 13031 is configured to implement the function of the first blockchain node in the embodiments corresponding to FIG. 3 to FIG. 5 .
  • the application processor 13031 performing the function of the first blockchain node in the embodiments corresponding to FIG. 3 to FIG. 5 and the beneficial effects brought about, reference may be made to the method embodiments corresponding to FIG. 3 to FIG. 5 . The description will not be repeated here.
  • the application processor 13031 is configured to implement the function of the second blockchain node in the embodiment corresponding to FIG. 3 to FIG. 5 .
  • the application processor 13031 performing the function of the second blockchain node in the embodiments corresponding to FIG. 3 to FIG. 5 and the beneficial effects brought about, reference may be made to the respective method embodiments corresponding to FIG. 3 to FIG. 5 . The description will not be repeated here.
  • the application processor 13031 is configured to implement the function of the first blockchain node in the embodiment corresponding to FIG. 6 to FIG. 8 .
  • the application processor 13031 performing the function of the first blockchain node in the embodiments corresponding to FIG. 6 to FIG. 8 and the beneficial effects brought about, reference may be made to the respective method embodiments corresponding to FIG. 6 to FIG. 8 . The description will not be repeated here.
  • the application processor 13031 is configured to implement the function of the second blockchain node in the embodiment corresponding to FIG. 6 to FIG. 8 .
  • the application processor 13031 executing the function of the second blockchain node in the embodiments corresponding to FIG. 6 to FIG. The description will not be repeated here.
  • Embodiments of the present application further provide a computer-readable storage medium, where a program is stored in the computer-readable storage medium, and when the computer-readable storage medium runs on a computer, the computer causes the computer to execute the operations described in the foregoing embodiments shown in FIG. 3 to FIG. 5 .
  • the steps performed by the first blockchain node in the method, or, the steps performed by the second blockchain node in the methods described in the embodiments shown in FIG. 3 to FIG. 5 are performed.
  • Embodiments of the present application further provide a computer-readable storage medium, where a program is stored in the computer-readable storage medium, and when the computer-readable storage medium runs on a computer, the computer executes the above-described embodiments shown in FIG. 6 to FIG. 8 .
  • the steps performed by the first blockchain node in the method, or, the steps performed by the second blockchain node in the method described in the embodiments shown in the foregoing FIG. 6 to FIG. 8 are performed.
  • Embodiments of the present application further provide a computer program, which, when run on a computer, causes the computer to execute the steps executed by the first blockchain node in the methods described in the embodiments shown in the foregoing FIG. 3 to FIG. 5 , or , and perform the steps performed by the second blockchain node in the method described in the foregoing embodiments shown in FIG. 3 to FIG. 5 .
  • Embodiments of the present application also provide a computer program, which, when running on a computer, causes the computer to execute the steps executed by the first blockchain node in the methods described in the foregoing embodiments shown in FIG. 6 to FIG. 8 , or , and perform the steps performed by the second blockchain node in the method described in the embodiments shown in FIG. 6 to FIG. 8 .
  • Embodiments of the present application further provide a circuit system, where the circuit system includes a processing circuit, and the processing circuit is configured to execute the method performed by the first blockchain node in the methods described in the foregoing embodiments shown in FIG. 3 to FIG. 5 . , or, perform the steps performed by the second blockchain node in the method described in the embodiments shown in FIG. 3 to FIG. 5 .
  • An embodiment of the present application further provides a circuit system, where the circuit system includes a processing circuit, and the processing circuit is configured to execute the method performed by the first blockchain node in the methods described in the foregoing embodiments shown in FIG. 6 to FIG. 8 . , or, perform the steps performed by the second blockchain node in the method described in the embodiments shown in FIG. 6 to FIG. 8 .
  • the relevant device provided by the embodiment of the present application may be a chip, and the chip includes: a processing unit and a communication unit.
  • the processing unit may be, for example, a processor, and the communication unit may be, for example, an input/output interface, a pin, or a circuit.
  • the processing unit can execute the computer-executed instructions stored in the storage unit, so that the chip executes the steps executed by the first blockchain node in the methods described in the foregoing embodiments shown in FIG. 3 to FIG.
  • the steps performed by the second blockchain node in the method described in the embodiment shown in FIG. 5, or the steps performed by the first blockchain node in the method described in the foregoing embodiments shown in FIG. 6 to FIG. 8 are performed.
  • the storage unit is a storage unit in the chip, such as a register, a cache, etc.
  • the storage unit may also be a storage unit located outside the chip in the wireless access device, such as only Read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM), etc.
  • ROM Read-only memory
  • RAM random access memory
  • the processor mentioned in any one of the above may be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the program of the above method.
  • the device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be A physical unit, which can be located in one place or distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.
  • U disk mobile hard disk
  • ROM read-only memory
  • RAM magnetic disk or optical disk
  • a computer device which may be a personal computer, server, or network device, etc.
  • the computer program includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center is by wire (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
  • wire eg, coaxial cable, fiber optic, digital subscriber line (DSL)
  • wireless eg, infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that can be stored by a computer, or a data storage device such as a server, data center, etc., which includes one or more available media integrated.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk (SSD)), and the like.

Abstract

本申请实施例公开一种地址的生成方法、区块链信息的处理方法以及相关设备,可用于区块链领域中。方法包括:第一区块链节点根据第一区块链节点的私钥和第二区块链节点的第一公钥生成共享密钥,根据共享密钥和第一交易内容生成第二区块链节点的临时的第一公钥地址,将第一交易信息写入区块链,第一交易信息包括第一区块链节点的公钥地址、第一公钥地址和第一区块链节点和第二区块链节点之间的第一交易内容;第一公钥地址需要利用共享密钥进行验证,接收方也可以通过第一区块链节点的公钥和第二区块链节点的第一私钥生成共享密钥,以对交易信息进行验证,接收方无需存储并管理多个公私钥对,降低了管理难度。

Description

地址的生成方法、区块链信息的处理方法以及相关设备
本申请要求于2020年10月31日提交中国专利局、申请号为202011196897.1、发明名称为“地址的生成方法、区块链信息的处理方法以及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种地址的生成方法、区块链信息的处理方法以及相关设备。
背景技术
区块链本质上是一个去中心化的数据库,它依靠密码学和数学巧妙的分布式算法,在无法建立信任关系的互联网上,无需借助任何第三方中心的介入就可以使参与者达成共识,以极低的成本解决了信任与价值的可靠传递难题,基于区块链的分布式身份和数据管理平台是未来数字世界的发展趋势。
区块链虽然以其公开、透明、不可篡改的特性备受大家的信赖,但是正是由于其公开、透明的性质,使得其隐私问题成为了最受大家关注的问题。例如对于基于区块链的供应链应用,公开于区块链上的交易内容会涉及买卖双方和商品信息,这些信息都是敏感信息。一个生产商并不想别人知道他的零售商都是谁,一个零售商不想别人知道他的客户是谁。
为了解决上述问题,可以在每次交易过程中,商品的接收方均使用一个新的公钥地址,这样从第三方来看,就无法将多个公钥地址关联到一个人,从而能够达到保护隐私的效果。但这需要接收方存储并管理多个公私钥对,管理难度高。
发明内容
本申请实施例提供了一种地址的生成方法、区块链信息的处理方法以及相关设备,用于验证的共享密钥也可以通过第一区块链节点的公钥和第二区块链节点的第一私钥生成,也即接收方也可以生成共享密钥,以对交易信息进行验证,接收方无需存储并管理多个公私钥对,降低了管理难度。
为解决上述技术问题,本申请实施例提供以下技术方案:
第一方面,本申请实施例提供一种地址的生成方法,可用于区块链领域中。方法包括:第一区块链节点根据第一区块链节点的私钥和第二区块链节点的第一公钥生成共享密钥;其中,第一区块链节点的私钥为第一区块链节点的固定密钥,第二区块链节点的第一公钥为第二区块链节点的固定密钥。第一区块链节点根据共享密钥和第一交易内容生成第二区块链节点的临时的第一公钥地址,由于该第一公钥地址仅在第一区块链节点向第二区块链节点发送第一交易信息时使用,所以将第一公钥地址称为临时的公钥地址,也可以称为一次性的公钥地址。第一区块链节点将第一交易信息写入区块链,也即第一区块链节点将第一交易信息上链,第一交易信息包括第一区块链节点的公钥地址(也即交易发送方的公钥地址)、第一公钥地址(也即交易接收方的公钥地址)和第一交易内容。其中,第一交易内 容为第一区块链节点和第二区块链节点之间的当前交易的内容,第一交易内容中包括时间戳,用于指示第一交易内容所指向的交易的时间。若第一交易内容所指向的交易是由第一区块链节点首创的,则无论第一区块链节点拥有一套固定密钥,还是拥有两套固定密钥,第一区块链节点的公钥地址均为根据第一区块链节点的长期公钥生成的。若第一交易内容所指向的交易为第三区块链节点转移给第一区块链节点的,则第一区块链节点的公钥地址与该第一公钥地址类似,为第三区块链节点为第一区块链节点生成的临时公钥地址。写入区块链的第一交易信息由第二区块链节点根据第一公钥地址进行验证,第一公钥地址需要利用共享密钥进行验证,共享密钥在第二区块链节点处通过第一区块链节点的公钥和第二区块链节点的第一私钥生成。
本实现方式中,由于第一交易信息的公钥地址是根据共享密钥和第一交易内容生成的,而不同交易中的交易内容是不同的,则区块链上的每个交易信息的公钥地址都是一次性的,从而可以很好的保护接收方的隐私;且共享密钥也可以通过第一区块链节点的公钥和第二区块链节点的第一私钥生成,也即接收方也可以生成共享密钥,并根据共享密钥和第一交易内容生成第一交易信息的公钥地址,以对交易信息进行验证,接收方无需存储并管理多个公私钥对,降低了管理难度。
在第一方面的一种可能实现方式中,第一区块链节点根据共享密钥和第一交易内容生成第一交易信息的第一公钥地址,包括:第一区块链节点根据共享密钥和第一交易内容生成临时的第二私钥;其中,由于与不同交易对应的交易内容不同,则根据不同的交易内容生成的私钥不同,所以第二私钥为一次性的,或者说第二私钥为临时的,而不是固定的。需要说明的是,第二私钥为生成第二区块链节点的一次性公钥地址的过程中所产生的密钥,并不归属于第一区块链节点,也不归属于第二区块链节点,也不需要对任何交易信息进行解密。第一区块链节点根据第二私钥和第二区块链节点的第二公钥生成临时的第三公钥,并根据该临时的第三公钥生成第二区块链节点的临时的第一公钥地址。需要说明的是,第三公钥的作用与第二私钥的功能类似,均为生成第二区块链节点的一次性公钥地址的过程中所生成的密钥,并不归属于第一区块链节点,也不归属于第二区块链节点,也不需要对任何交易信息进行解密。无论第二区块链节点拥有一套固定密钥还是两套固定密钥,第二区块链节点的第二公钥均为第二区块链节点的长期公钥。
本申请实施例中,根据第二私钥和第二区块链节点的第二公钥生成第一公钥地址,则需要借助第二区块链节点的第三私钥才能够生成花费第一交易信息中的产品时所使用的私钥,从而避免了第一区块链节点在将第一交易信息中的产品转移给第二区块链节点之后,还能够花费第一交易信息中的产品,以保证了第二区块链节点的财产的安全性,也包括了区块链上交易的稳定性。
在第一方面的一种可能实现方式中,第一区块链节点根据共享密钥和第一交易内容生成第二私钥,包括:第一区块链节点将共享密钥和第一交易内容进行组合,得到第一组合结果,对第一组合结果进行哈希运算,以生成第二私钥。组合的方式包括但不限于拼接、异/或运算、相加等;采用的哈希函数包括但不限于SHA256、SHA512或其他哈希函数。本申请实施例中,提供了生成第二私钥的具体实现方式,操作简单,易于实现。
在第一方面的一种可能实现方式中,第一区块链节点根据第二私钥和第二区块链节点的第二公钥生成第一公钥地址,包括:第一区块链节点在椭圆曲线的公钥密码体系中,根据临时的第二私钥和第二区块链节点的第二公钥,生成临时的第三公钥;并在椭圆曲线的公钥密码体系的约束下,根据临时的第三公钥,生成临时的第一公钥地址。或者,第一区块链节点在离散对数的公钥密码体系中,根据临时的第二私钥和第二区块链节点的第二公钥,生成临时的第三公钥;并在离散对数的公钥密码体系的约束下,根据临时的第三公钥,生成临时的第一公钥地址。
本申请实施例中,无论是在椭圆曲线的公钥密码体系下,还是在离散对数的公钥密码体系下,均能根据临时的第二私钥和第二区块链节点的第二公钥,生成临时的第三公钥,并根据临时的第三公钥,生成临时的第一公钥地址,扩展了本方案的应用场景。
在第一方面的一种可能实现方式中,第一区块链节点在椭圆曲线的公钥密码体系中,根据临时的第二私钥和第二区块链节点的第二公钥,生成临时的第三公钥,包括:第一区块链节点根据临时的第二私钥r,将临时的第二私钥r与生成元G(也即椭圆曲线群的生成元)进行点乘,可以生成临时的公钥R,进而将临时的公钥R与第二区块链节点的第二公钥B相加,以生成临时的第三公钥T,也即临时的第三公钥T=R+B。
在第一方面的一种可能实现方式中,第一区块链节点在椭圆曲线的公钥密码体系中,根据临时的第二私钥和第二区块链节点的第二公钥,生成临时的第三公钥,包括:第一区块链节点根据临时的第二私钥r,将临时的第二私钥r与生成元G(也即椭圆曲线群的生成元)进行点乘,可以生成临时的公钥R,进而将临时的公钥R与第二区块链节点的第二公钥B相减,以生成临时的第三公钥T,也即临时的第三公钥T=R-B。
在第一方面的一种可能实现方式中,第一区块链节点在椭圆曲线的公钥密码体系中,根据临时的第二私钥和第二区块链节点的第二公钥,生成临时的第三公钥,包括:第一区块链节点根据临时的第二私钥r,将临时的第二私钥r与第二区块链节点的第二公钥B相乘,以生成临时的第三公钥T,也即临时的第三公钥T=r.B。
在第一方面的一种可能实现方式中,第一区块链节点在椭圆曲线的公钥密码体系中,根据临时的第二私钥和第二区块链节点的第二公钥,生成临时的第三公钥,包括:第一区块链节点根据临时的第二私钥r,将临时的第二私钥r的倒数与第二区块链节点的第二公钥B相乘,以生成临时的第三公钥T。
在第一方面的一种可能实现方式中,第一区块链节点在离散对数的公钥密码体系中,根据临时的第二私钥和第二区块链节点的第二公钥,生成临时的第三公钥,包括:第一区块链节点根据临时的第二私钥r,将临时的第二私钥r与第二区块链节点的第二公钥B进行指数运算,以生成临时的第三公钥T;其中,第二区块链节点的第二公钥B为前述指数运算的底数,临时的第二私钥r为前述指数运算的指数。
在第一方面的一种可能实现方式中,第一区块链节点根据第一区块链节点的私钥和第二区块链节点的第一公钥生成共享密钥,包括以下两项中的任一项:在椭圆曲线的公钥密码体系中,第一区块链节点将第一区块链节点的私钥与第二区块链节点的第一公钥进行点乘,得到共享密钥。或者,在离散对数的公钥密码体系中,第一区块链节点根据第一区块 链节点的私钥和第二区块链节点的第一公钥,进行指数运算,得到共享密钥,第二区块链节点的第一公钥为指数运算中的底数,第一区块链节点的私钥为指数运算中的指数。
本申请实施例中,分别公开了在椭圆曲线的公钥密码体系和离散对数的公钥密码体系下,共享密钥的生成方式,扩展了本方案的应用场景。
在第一方面的一种可能实现方式中,第一区块链节点和第二区块链节点均仅拥有一套固定密钥,一套固定密钥中包括一个长期私钥和一个长期公钥;第一区块链节点的私钥指的是第一区块链节点的长期私钥,第二区块链节点的第一公钥指的是第二区块链节点的长期公钥,第一区块链节点的公钥指的是第一区块链节点的长期公钥,第二区块链节点的第一私钥指的是第二区块链节点的长期私钥。或者,第一区块链节点和第二区块链节点均拥有两套固定密钥,两套固定密钥包括第一套固定密钥和第二套固定密钥,第一套固定密钥包括一个长期私钥和一个长期公钥,第二套固定密钥包括一个扫描私钥和一个扫描公钥,第一区块链节点的私钥为第一区块链节点的长期私钥,第二区块链节点的第一公钥为第二区块链节点的扫描公钥,第一区块链节点的公钥为第一区块链节点的长期公钥,第二区块链节点的第一私钥为第二区块链节点的扫描私钥。
本申请实施例中,提供的区块链信息的处理方法不仅可以适用于区块链节点仅拥有一套固定密钥的情况,而且还适用于区块链拥有两套固定密钥的情况,扩展了本方案的应用场景。
第二方面,本申请实施例提供了一种区块链信息的处理方法,可用于区块链领域中。方法包括:第二区块链节点根据第一区块链节点的公钥和第二区块链节点的第一私钥生成共享密钥;其中,第一区块链节点的公钥为第一区块链节点的固定密钥,第二区块链节点的第一私钥为第二区块链节点的固定密钥。第二区块链节点对区块链上的至少一个交易信息进行读取,在至少一个交易信息中存在第一交易信息的情况下,确定第一交易内容指向的交易为交易成功;也即第二区块链节点需要对区块链上的每个交易信息进行读取,以逐个判断区块链上的每个交易信息中是否为第一交易信息。第一交易信息包括第一区块链节点的公钥地址、第一交易内容和第二区块链节点的第一公钥地址;第一区块链节点的公钥地址属于第一区块链节点,第一交易内容为第一区块链节点和第二区块链节点之间交易的内容,第一公钥地址能够根据共享密钥和第一交易内容生成。具体的,针对判断一个交易信息是否为第一交易信息的过程。第二区块链节点在读取到一个交易信息之后,会获取该交易信息中的交易内容,并根据生成的共享密钥和获取到的交易内容,生成一个临时的公钥地址,具体生成方式与生成临时的第一公钥地址的方式一致。进而判断第一公钥地址与该交易信息中的携带的接收方的公钥地址是否一致,若一致,则视为该交易信息为第一交易信息,若不一致,则视为该交易信息不是第一交易信息。
在第二方面的一种可能实现方式中,第二区块链节点根据第一区块链节点的公钥和第二区块链节点的第一私钥生成共享密钥,包括:第二区块链节点在椭圆曲线的公钥密码体系中,将第一区块链节点的公钥和第二区块链节点的第一私钥进行点乘,得到共享密钥。或者,第二区块链节点在离散对数的公钥密码体系中,根据第一区块链节点的公钥和第二区块链节点的第一私钥,进行指数运算,第一区块链节点的公钥为指数运算中的底数,第 二区块链节点的第一私钥为指数运算中的指数。
在第二方面的一种可能实现方式中,方法还包括:第二区块链节点在确定第一交易信息指向的交易为交易成功的情况下,当第二区块链节点需要花费第一交易信息中的产品时,第二区块链节点根据共享密钥和第一交易内容,生成第二私钥,根据第二私钥和第二区块链节点的第三私钥,生成第二区块链节点的临时的第四私钥,第四私钥用于花费第一交易信息中的产品。第二区块链节点的第三私钥是第二区块链节点的固定密钥,无论第二区块链节点包括一套固定密钥还是两套固定密钥,第二区块链节点的第三私钥均为第二区块链节点的长期私钥。本申请实施例中,提供了当第二区块链节点想要花费第一交易信息中的产品时,生成花费第一交易信息中的产品的私钥的具体生成方式,扩展了本方案的应用场景,且增加了本方案的完整性。
在第二方面的一种可能实现方式中,第二区块链节点根据第二私钥和第二区块链节点的第三私钥,生成第二区块链节点的第四私钥,包括:在椭圆曲线的公钥密码体系中,第二区块链节点根据将第二私钥r与第二区块链节点的第三私钥b相加,得到第一相加结果,将第一相加结果与生成元的阶q进行求余运算,得到第二区块链节点的临时的第四私钥,也即临时的第四私钥t=(r+b)mod q。
在第二方面的一种可能实现方式中,第二区块链节点根据第二私钥和第二区块链节点的第三私钥,生成第二区块链节点的第四私钥,包括:在椭圆曲线的公钥密码体系中,第二区块链节点将第二私钥r与第二区块链节点的第三私钥b相减,得到第一相减结果,将第一相减结果与生成元的阶q进行求余运算,得到第二区块链节点的临时的第四私钥,也即临时的第四私钥t=(r-b)mod q。
在第二方面的一种可能实现方式中,第二区块链节点根据第二私钥和第二区块链节点的第三私钥,生成第二区块链节点的第四私钥,包括:在椭圆曲线的公钥密码体系中,第二区块链节点将第二私钥r与第二区块链节点的第三私钥b相乘,将前述相乘结果与生成元的阶q进行求余运算,得到第二区块链节点的临时的第四私钥,也即临时的第四私钥t=(rb)mod q。
在第二方面的一种可能实现方式中,第二区块链节点根据第二私钥和第二区块链节点的第三私钥,生成第二区块链节点的第四私钥,包括:在椭圆曲线的公钥密码体系中,第二区块链节点根据临时的第二私钥r,第二私钥r的倒数与第二区块链节点的第三私钥b相乘,将相乘结果与生成元的阶q进行求余运算,得到第二区块链节点的临时的第四私钥。
在第二方面的一种可能实现方式中,第二区块链节点根据第二私钥和第二区块链节点的第三私钥,生成第二区块链节点的第四私钥,包括:在离散对数的公钥密码体系中,第二区块链节点将临时的第二私钥r与第二区块链节点的第三私钥b进行指数运算,得到第一运算结果;第三私钥b为前述指数运算的底数,第二私钥r为前述指数运算的指数。第二区块链节点将第一运算结果与生成元的阶q进行求余运算,得到第二区块链节点的临时的第四私钥。
在第二方面的一种可能实现方式中,第一区块链节点和第二区块链节点均仅拥有一套固定密钥,一套固定密钥中包括一个长期私钥和一个长期公钥,第一区块链节点的公钥为 第一区块链节点的长期公钥,第二区块链节点的第一私钥为第二区块链节点的长期私钥。或者,第一区块链节点和第二区块链节点均拥有两套固定密钥,两套固定密钥包括第一套固定密钥和第二套固定密钥,第一套固定密钥包括一个长期私钥和一个长期公钥,第二套固定密钥包括一个扫描私钥和一个扫描公钥,第一区块链节点的公钥为第一区块链节点的长期公钥,第二区块链节点的第一私钥为第二区块链节点的扫描私钥。
对于本申请实施例第二方面以及第二方面的各种可能实现方式中名词的概念、具体实现步骤以及每种可能实现方式所带来的有益效果,均可以参考第一方面中各种可能的实现方式中的描述,此处不再一一赘述。
第三方面,本申请实施例提供了一种地址的生成方法,可用于区块链领域中。方法包括:第一区块链节点根据第一区块链节点的私钥和第二区块链节点的第一公钥生成共享密钥;第一区块链节点随机生成临时的第五私钥,并根据临时的第五私钥生成第二区块链节点的临时的第二公钥地址;第五私钥为生成第二区块链节点的一次性公钥地址的过程中所产生的私钥,并不归属于第一区块链节点,也不归属于第二区块链节点,也不需要对任何交易信息进行解密;由于该第二公钥地址仅在第一区块链节点向第二区块链节点发送第二交易信息时使用,所以将第二公钥地址称为临时的公钥地址,也可以称为一次性的公钥地址。第一区块链节点采用共享密钥对第五私钥进行对称加密,得到加密后的第五私钥;对称加密的算法包括但不限于数据加密标准、3数据加密标准、高级加密标准等。第一区块链节点将第二交易信息写入区块链,第二交易信息包括第一区块链节点的公钥地址(也即交易发送方的公钥地址)、第二公钥地址(也即交易接收方的公钥地址)、第一交易内容和加密后的第五私钥。其中,第一交易内容为第一区块链节点和第二区块链节点之间交易的内容,写入区块链的第二交易信息由第二区块链节点根据第二公钥地址进行验证,第二公钥为根据第五私钥生成,加密后的第五私钥需要利用共享密钥进行对称解密,共享密钥在第二区块链节点处通过第一区块链节点的公钥和第二区块链节点的第一私钥生成。
本申请实施例中,在隐藏交易接收方的真实地址的前提下,提供了交易接收方无需存储并管理多个公私钥对的又一实现方案,提高了本方案的实现灵活性。
在第三方面的一种可能实现方式中,第一区块链节点根据第一区块链节点的私钥和第二区块链节点的第一公钥生成共享密钥,包括以下两项中的任一项:第一区块链节点在椭圆曲线的公钥密码体系中,将第一区块链节点的私钥与第二区块链节点的第一公钥进行点乘,得到共享密钥。或者,第一区块链节点在离散对数的公钥密码体系中,根据第一区块链节点的私钥和第二区块链节点的第一公钥,进行指数运算,第二区块链节点的第一公钥为指数运算中的底数,第一区块链节点的私钥为指数运算中的指数。
在第三方面的一种可能实现方式中,第一区块链节点根据第五私钥生成第二区块链节点的第二公钥地址,包括:第一区块链节点根据第五私钥和第二区块链节点的第二公钥,生成临时的第四私钥,根据临时的第四私钥,生成第二区块链的临时的第二公钥地址;临时的第四公钥为生成第二区块链节点的第二公钥地址的过程中产生的密钥,既不归属于第一区块链节点,也不归属于第二区块链节点,也不需要对任何交易信息进行解密。
对于本申请实施例第三方面以及第三方面的各种可能实现方式中名词的概念、具体实 现步骤以及每种可能实现方式所带来的有益效果,均可以参考第一方面中各种可能的实现方式中的描述,此处不再一一赘述。
第四方面,本申请实施例提供了一种区块链信息的处理方法,可用于区块链领域中。方法包括:第二区块链节点根据第一区块链节点的公钥和第二区块链节点的第一私钥生成共享密钥;第二区块链节点对区块链上的至少一个交易信息进行读取,在至少一个交易信息中存在第二交易信息的情况下,确定第一交易内容指向的交易为交易成功,也即第二区块链节点需要对区块链上的每个交易信息进行读取,以逐个判断区块链上的每个交易信息中是否为第二交易信息。其中,第二交易信息包括第一区块链节点的公钥地址、第二区块链节点的第二公钥地址、第一交易内容和加密后的第五私钥;第一区块链节点的公钥地址属于第一区块链节点,第一交易内容为第一区块链节点和第二区块链节点之间交易的内容,加密后的第五私钥能够通过共享密钥解密,第二公钥地址能够根据第五私钥生成。具体的,针对判断一个交易信息是否为第二交易信息的过程。第二区块链节点在读取到一个交易信息之后,会利用生成的共享密钥对加密后的密钥进行解密,进而根据解密结果生成临时的公钥地址,生成临时的公钥地址的方式与生成临时的第二公钥地址的方式一致,并判断生成的公钥地址是否与获取的交易信息中包括的交易接收方的公钥地址一致,若一致,则证明读取到的交易信息为第二交易信息,若不一致,则证明读取到的交易信息不是第二交易信息。
在第四方面的一种可能实现方式中,第二区块链节点根据第一区块链节点的公钥和第二区块链节点的第一私钥生成共享密钥,包括:第二区块链节点在椭圆曲线的公钥密码体系中,将第一区块链节点的公钥和第二区块链节点的第一私钥进行点乘,得到共享密钥。或者,第二区块链节点在离散对数的公钥密码体系中,根据第一区块链节点的公钥和第二区块链节点的第一私钥,进行指数运算,第一区块链节点的公钥为指数运算中的底数,第二区块链节点的第一私钥为指数运算中的指数。
在第四方面的一种可能实现方式中,方法还包括:第二区块链节点根据临时的第五私钥和第二区块链节点的第三私钥,生成第二区块链节点的临时的第六私钥,第六私钥用于花费第二交易信息中的产品。
对于本申请实施例第四方面以及第四方面的各种可能实现方式中名词的概念、具体实现步骤以及每种可能实现方式所带来的有益效果,均可以参考第二方面中各种可能的实现方式中的描述,此处不再一一赘述。
第五方面,本申请实施例提供了一种地址的生成装置,可用于区块链领域中。地址的生成装置应用于第一区块链节点,装置包括:生成模块,用于根据第一区块链节点的私钥和第二区块链节点的第一公钥生成共享密钥;生成模块,还用于根据共享密钥和第一交易内容生成第二区块链节点的第一公钥地址;写入模块,用于将第一交易信息写入区块链,第一交易信息包括第一区块链节点的公钥地址、第一公钥地址和第一交易内容。其中,第一区块链节点的公钥地址属于第一区块链节点,第一交易内容为第一区块链节点和第二区块链节点之间的交易的内容,写入区块链的第一交易信息由第二区块链节点根据第一公钥地址进行验证,第一公钥地址需要利用共享密钥进行验证,共享密钥在第二区块链节点处 通过第一区块链节点的公钥和第二区块链节点的第一私钥生成。
本申请实施例的第五方面中,地址的生成装置还可以执行第一方面以及第一方面的各种可能实现方式中由第一区块链节点执行的步骤,对于第五方面以及第五方面的部分可能实现方式中名词的概念、具体实现步骤以及每种可能实现方式所带来的有益效果,均可以参考第一方面中各种可能的实现方式中的描述,此处不再一一赘述。
第六方面,本申请实施例提供了一种区块链信息的处理装置,可用于区块链领域中。区块链信息的处理装置应用于第二区块链节点,装置包括:生成模块,用于根据第一区块链节点的公钥和第二区块链节点的第一私钥生成共享密钥;读取模块,用于对区块链上的至少一个交易信息进行读取;确定模块,用于在至少一个交易信息中存在第一交易信息的情况下,确定第一交易内容指向的交易为交易成功,第一交易信息包括第一区块链节点的公钥地址、第一交易内容和第二区块链节点的第一公钥地址。其中,第一区块链节点的公钥地址属于第一区块链节点,第一交易内容为第一区块链节点和第二区块链节点之间交易的内容,第一公钥地址能够根据共享密钥和第一交易内容生成。
本申请实施例的第六方面中,区块链信息的处理装置还可以执行第二方面以及第二方面的各种可能实现方式中由第二区块链节点执行的步骤,对于第六方面以及第六方面的部分可能实现方式中名词的概念、具体实现步骤以及每种可能实现方式所带来的有益效果,均可以参考第二方面中各种可能的实现方式中的描述,此处不再一一赘述。
第七方面,本申请实施例提供了一种地址的生成装置,可用于区块链领域中。装置应用于第一区块链节点,装置包括:生成模块,用于根据第一区块链节点的私钥和第二区块链节点的第一公钥生成共享密钥;生成模块,还用于随机生成第五私钥,并根据第五私钥生成第二区块链节点的第二公钥地址;加密模块,用于采用共享密钥对第五私钥进行对称加密,得到加密后的第五私钥;写入模块,用于将第二交易信息写入区块链,第二交易信息包括第一区块链节点的公钥地址、第二公钥地址、第一交易内容和加密后的第五私钥。其中,第一区块链节点的公钥地址属于第一区块链节点,第一交易内容为第一区块链节点和第二区块链节点之间交易的内容,加密后的第五私钥需要利用共享密钥进行解密,共享密钥在第二区块链节点处通过第一区块链节点的公钥和第二区块链节点的第一私钥生成。
本申请实施例的第七方面中,地址的生成装置还可以执行第三方面以及第三方面的各种可能实现方式中由第一区块链节点执行的步骤,对于第七方面以及第七方面的部分可能实现方式中名词的概念、具体实现步骤以及每种可能实现方式所带来的有益效果,均可以参考第三方面中各种可能的实现方式中的描述,此处不再一一赘述。
第八方面,本申请实施例提供了一种区块链信息的处理装置,可用于区块链领域中。区块链信息的处理装置应用于第二区块链节点,装置包括:生成模块,用于根据第一区块链节点的公钥和第二区块链节点的第一私钥生成共享密钥;读取模块,用于对区块链上的至少一个交易信息进行读取;确定模块,用于在至少一个交易信息中存在第二交易信息的情况下,确定第一交易内容指向的交易为交易成功,第二交易信息包括第一区块链节点的公钥地址、第二区块链节点的第二公钥地址、第一交易内容和加密后的第五私钥。其中,第一区块链节点的公钥地址属于第一区块链节点,第一交易内容为第一区块链节点和第二 区块链节点之间交易的内容,写入区块链的第二交易信息由第二区块链节点根据第二公钥地址进行验证,加密后的第五私钥能够通过共享密钥解密,第二公钥地址能够根据第五私钥生成。
本申请实施例的第八方面中,区块链信息的处理装置还可以执行第四方面的各种可能实现方式中由第二区块链节点执行的步骤,对于本申请实施例第八方面以及第八方面的部分可能实现方式中名词的概念、具体实现步骤以及每种可能实现方式所带来的有益效果,均可以参考第四方面中各种可能的实现方式中的描述,此处不再一一赘述。
第九方面,本申请实施例提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面或第三方面所述的地址的生成方法,或者,使得计算机执行上述第二方面或第四方面所述的区块链信息的处理方法。
第十方面,本申请实施例提供了一种区块链节点,包括处理器,所述处理器与所述存储器耦合;所述存储器,用于存储程序;所述处理器,用于执行所述存储器中的程序,使得所述区块链节点执行如上述第一方面或第三方面所述的地址的生成方法,或者,使得所述区块链节点执行如上述第二方面或第四方面所述的区块链信息的处理方法。
第十一方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面或第三方面所述的地址的生成方法,或者,使得计算机执行上述第二方面或第四方面所述的区块链信息的处理方法。
第十二方面,本申请实施例提供了一种电路系统,所述电路系统包括处理电路,所述处理电路配置为执行上述第一方面或第三方面所述的地址的生成方法,或者,所述处理电路配置为执行上述第二方面或第四方面所述的区块链信息的处理方法。
第十三方面,本申请实施例提供了一种芯片系统,该芯片系统包括处理器,用于支持实现上述方面中所涉及的功能,例如,发送或处理上述方法中所涉及的数据和/或信息。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器,用于保存服务器或通讯设备必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。
附图说明
图1为本申请实施例提供的区块链信息的处理方法的一种流程示意图;
图2为本申请实施例提供的区块链信息的处理方法的另一种流程示意图;
图3为本申请实施例提供的区块链信息的处理方法的又一种流程示意图;
图4为本申请实施例提供的区块链信息的处理方法的再一种流程示意图;
图5为本申请实施例提供的区块链信息的处理方法的又一种流程示意图;
图6为本申请实施例提供的区块链信息的处理方法的再一种流程示意图;
图7为本申请实施例提供的区块链信息的处理方法的又一种流程示意图;
图8为本申请实施例提供的区块链信息的处理方法的再一种流程示意图;
图9为本申请实施例提供的地址的生成装置的一种结构示意图;
图10为本申请实施例提供的区块链信息的处理装置的一种流程示意图;
图11为本申请实施例提供的地址的生成装置的另一种结构示意图;
图12为本申请实施例提供的区块链信息的处理装置的另一种流程示意图;
图13为本申请实施例提供的区块链节点的一种结构示意图。
具体实施方式
本申请实施例提供了一种地址的生成方法、区块链信息的处理方法以及相关设备,用于验证的共享密钥也可以通过第一区块链节点的公钥和第二区块链节点的第一私钥生成,也即接收方也可以生成共享密钥,以对交易信息进行验证,接收方无需存储并管理多个公私钥对,降低了管理难度。
本申请的说明书和权利要求书及上述附图中的术语“第一”、第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分方式。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,以便包含一系列单元的过程、方法、系统、产品或设备不必限于那些单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它单元。
下面结合附图,对本申请的实施例进行描述。本领域普通技术人员可知,随着技术的发展和新场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
本申请实施例可应用于区块链技术中,特别是交易发送方想要隐藏交易接收方的真实身份的场景中。作为示例,例如生产商并不想别人知道他的零售商都是谁,再例如零售商不想别人知道他的客户是谁等,此处不对本申请实施例的应用场景进行穷举。在对本申请实施例提供的区块链信息的处理方法的详细实现方案进行介绍之前,先对本申请实施例涉及到的一些基本概念进行介绍。
1、区块链技术
区块链技术是一种不依赖第三方、通过自身分布式节点进行网络数据的存储、验证、传递和交流的一种技术方案。区块链能够记录点对点网络中的数据,每个参与方都可以使用共识算法,查看区块链上的数据并验证/拒绝数据。被验证通过的数据将作为一个个“区块”进入账本,储存在按时间顺序排列且无法更改的“链条”上。区块链严格定义上被划分为3种类型:公有链、私有链和联盟链。
公有链是对所有人公开,用户不需要注册和授权就能够匿名访问网络和区块,任何人都可以自由加入和退出网络,并参与记账和交易。公有链是真正完全意义上的去中心化区块链,它通过密码学(非对称加密)算法保证了交易的安全性和不可篡改性,在陌生的网络环境中,建立了互信和共识机制。在公有链中共识机制一般是工作量证明(POW)和权益证明(POS)。公有链又被称为非许可链,即不需要验证身份即可参与一切网络活动。目前比特币、以太坊、大多数山寨币以及智能合约都是建立在公有链上,其中公有链的始祖是比特币区块链。公有链适用于数字货币、电子商务、互联网金融、知识产权等应用场景。
私有链对单独的个人或实体开放,仅在私有组织(例如公司内部)使用,私有链上的 读写权限,参与记账的权限都由私有组织来制定。例如企业内部的办公审批和财务审计、政府行业的预算和执行等。
联盟链仅限于联盟成员,因其只针对成员开放全部或部分功能,所以联盟链上的读写权限、以及记账规则都按联盟规则来“私人定制”。联盟链上的共识过程由预先选好的节点控制,一般来说,他适用于机构间的交易、结算、或清算等B2B场景。例如人民银行开发一个基于联盟链的结算、清算系统,工建中农等银行作为联盟成员加入这个系统,获得相应的授权,就可以实时进行不同银行之间的实时结算、清算。联盟链几乎不采用工作量证明共识机制而是采用权益证明或实用拜占庭容错(practical byzantine fault tolerance,PBTF)等共识算法。联盟链由参与成员机构共同维护,并提供了对参与成员的管理、认证、授权、监控、审计等全套安全管理功能。
2、智能合约
智能合约是以区块链技术为基础,能够自我执行的条约;一旦满足条件,就可以自动触发行为或付款。智能合约是一段代码和数据的集合,可以部署在区块链上运行。智能合约更像是JAVA程序,JAVA程序通过JAVA虚拟机将代码解释字节进行执行,以太坊的智能合约通过以太坊虚拟机(EVM)解释成字节码进行执行。智能合约有自己的账户,在时间或事件的驱动下能自动执行一些功能,如可以在相互之间传递信息,修改区块链的状态例如账户信息等。
3、非对称加密(asymmetric cryptography)
非对称加密是一种密码学算法类型,在这种密码学方法中,需要一对密钥,分别为公钥和私钥。前述两个密钥数学相关,用某用户密钥加密后所得的信息,只能用该用户的解密密钥才能解密。如果知道了公钥,并不能计算出私钥。私钥由密钥对所有者持有,不可公布,公钥是密钥对持有者公布给他人的。公钥用来给数据加密,用公钥加密的数据只能使用私钥解密。
为了解决上述问题,本申请实施例提供了一种区块链信息的处理方法,能够为交易接收方生成临时的公钥地址,交易发送方在与相同的交易接收方进行不同的交易时,交易接收方的公钥地址均不同,从而无法通过交易接收方的公钥地址来指向交易接收方的真实身份,以实现隐藏交易接收方的真实身份的场景的目的。且交易接收方无需长期存储该临时的公钥地址,以避免提高交易接收方的管理难度。
本申请实施例中,先结合图1和图2对本申请实施例提供的区块链信息的处理方法进行大体介绍。图1和图2分别为本申请实施例提供的区块链信息的处理方法的两种流程示意图,图1和图2中均以交易发送方和交易接收方仅拥有一套固定密钥为例。在一种实现方式中,请先参阅图1,图1中示出的实现方式为利用共享密钥来生成第二区块链节点的临时的公钥地址。具体的,A1、第一区块链节点(也即交易发送方)根据第一区块链节点的私钥和第二区块链节点(也即交易接收方)的第一公钥生成共享密钥。A2、在每次交易中,第一区块链节点根据该共享密钥和第一交易内容(也即交易发送方和交易接收方之间的交易内容),生成第二区块链节点的临时的公钥地址。A3、第一区块链节点将第一交易信息上链,第一交易信息包括第一区块链节点的公钥地址、第一公钥地址和第一交易内容。 A4、第二区块链节点根据第二区块链节点的第一私钥和第一区块链节点的公钥生成共享密钥。A5、第二区块链节点读取区块链上的多个交易信息,以根据该共享密钥,逐个判断该多个交易信息中是否存在第一交易信息;其中,第一交易信息包括第一区块链节点的公钥地址、第一公钥地址和第一交易内容,第一区块链节点的公钥地址属于第一区块链节点,第一交易内容为第一区块链节点和第二区块链节点之间的交易的内容,第一公钥地址需要利用共享密钥和第一交易内容进行验证。A6、在第二区块链节点确定多个交易信息中存在第一交易信息的情况下,确定第一交易信息指向的交易成功;在第二区块链节点确定多个交易信息中不存在第一交易信息的情况下,确定第一交易信息指向的交易失败。由于每次交易过程中为第二区块链节点生成的临时的公钥地址为根据第一交易内容生成的,而不同交易中的交易内容是不同的,所以保证了该临时的公钥地址为一次性的,不能够指向某个特定的交易接收方。且第二区块链无需存储多余的临时公钥或临时私钥等,就可以完成对交易信息的验证,避免提高交易接收方的管理难度。
在另一种实现方式中,请参阅图2,B1、第一区块链节点(也即交易发送方)根据第一区块链节点的私钥和第二区块链节点(也即交易接收方)的第一公钥生成共享密钥。B2、在每次交易中,第一区块链节点随机生成一个临时的第五私钥,并根据临时的第五私钥生成第二区块链节点的公钥地址。B3、第一区块链节点利用共享密钥对第五私钥进行加密,以生成加密后的第五私钥。B4、第一区块链节点将第二交易信息上链,第二交易信息包括第一区块链节点的公钥地址、第二区块链节点的第二公钥地址、第一交易内容和加密后的第五私钥。B5、第二区块链节点根据第二区块链节点的第一私钥和第一区块链节点的公钥生成共享密钥。B6、第二区块链节点读取区块链上的多个交易信息,以根据该共享密钥,逐个判断该多个交易信息中是否存在第二交易信息;其中,第二交易信息包括第一区块链节点的公钥地址、第二公钥地址、第一交易内容和加密后的第五私钥,加密后的第五私钥能够通过共享密钥解密,第二公钥地址能够根据第五私钥生成,也即能够利用生成的共享密钥来验证获取到的交易信息是否为第二交易信息。B7、在第二区块链节点确定多个交易信息中存在第二交易信息的情况下,确定第二交易信息指向的交易成功。由于每次交易过程中为第二区块链节点生成的临时的公钥地址为根据随机生成的第五私钥生成的,保证了该临时的公钥地址是一次性的,不能够指向某个特定的交易接收方。且第二区块链无需存储多余的临时公钥或临时私钥等,就可以完成对交易信息的验证,避免提高交易接收方的管理难度。
由于上述两种实现方式的具体流程有所不同,以下分别对前述两种情况进行详细介绍。
一、共享密钥用于生成第一公钥地址
本申请实施例中,请参阅图3,图3为本申请实施例提供的区块链信息的处理方法的一种流程示意图,本申请实施例提供的区块链信息的处理方法可以包括:
301、第一区块链节点根据第一区块链节点的私钥和第二区块链节点的第一公钥生成共享密钥。
本申请实施例中,第一区块链节点能够获取到第一区块链节点的私钥和第二区块链节点的第一公钥,根据第一区块链节点的私钥和第二区块链节点的第一公钥生成共享密钥 (derive shared key)。其中,第一区块链节点和第二区块链节点为区块链上的两个区块链节点,第一区块链节点为交易的发送方,第二区块链节点为交易的接收方。共享密钥也可以称为对称密钥或对称共享密钥,第二区块链节点也能够根据第一区块链节点的公钥和第二区块链节点的第一私钥生成。
进一步地,在一种情况下,第一区块链节点和第二区块链节点均仅拥有一套固定密钥(single-key scheme),一套固定密钥中包括一个长期私钥和一个长期公钥;第一区块链节点的私钥指的是第一区块链节点的长期私钥,第二区块链节点的第一公钥指的是第二区块链节点的长期公钥,第一区块链节点的公钥指的是第一区块链节点的长期公钥,第二区块链节点的第一私钥指的是第二区块链节点的长期私钥。
在另一种情况下,第一区块链节点和第二区块链节点均拥有两套固定密钥(Dual-Key scheme),两套固定密钥包括第一套固定密钥和第二套固定密钥,第一套固定密钥包括一个长期私钥和一个长期公钥,第二套固定密钥包括一个扫描(scanning)私钥和一个扫描公钥,在本情况下,长期私钥也可以称为花费(spending)私钥,长期公钥也可以称为花费公钥;第一区块链节点的私钥为第一区块链节点的长期私钥,第二区块链节点的第一公钥为第二区块链节点的扫描公钥,第一区块链节点的公钥指的是第一区块链节点的长期公钥,第二区块链节点的第一私钥指的是第二区块链节点的扫描私钥。本申请实施例中,提供的区块链信息的处理方法不仅可以适用于区块链节点仅拥有一套固定密钥的情况,而且还适用于区块链拥有两套固定密钥的情况,扩展了本方案的应用场景。
具体的,在一种实现方式中,在椭圆曲线的公钥密码体系中,第一区块链节点基于静态的迪菲-赫尔曼(Diffie-Hellman)算法,将第一区块链节点的私钥与第二区块链节点的第一公钥进行点乘,得到共享密钥。为更直观地理解本方案,以下以第二区块链节点拥有两套固定的密钥为例,公开了第一区块链节点在椭圆曲线的公钥密码体系中,生成共享密钥的公式的一个示例:
S=a.D=ad.G  (1)
其中,S代表共享密钥,a代表第一区块链节点的私钥,D代表第二区块链节点的第一公钥(也即第二区块链节点的扫描公钥),D是由第二区块链节点的第一私钥d(也即第二区块链节点的扫描私钥)与生成元(generator,G)点乘得到,G代表椭圆曲线群的生成元,也可以称为椭圆曲线上的基点。需要说明的是,虽然用户看来第一区块链节点的私钥和第二区块链节点的第一公钥均表现为包括字母、数字的密钥,但对于计算机而言,均可以通过二进制编码的方式进行表示。
在另一种实现方式中,在离散对数的公钥密码体系中,第一区块链节点根据第一区块链节点的私钥和第二区块链节点的第一公钥,进行指数运算,得到共享密钥。其中,第二区块链节点的第一公钥为指数运算中的底数,第一区块链节点的私钥为指数运算中的指数。
进一步地,在离散对数的公钥密钥体系中,第二区块链节点的第一公钥为第二区块链节点的第一私钥与生成元G进行指数运算得到,生成元G为指数运算中的底数,第二区块链节点的第一私钥为指数运算中的指数。在离散对数的公钥密钥体系中,生成元G代表的为整数群的生成元或素数群的生成元。
本申请实施例中,分别公开了在椭圆曲线的公钥密码体系和离散对数的公钥密码体系下,共享密钥的生成方式,扩展了本方案的应用场景。
302、第一区块链节点根据共享密钥和第一交易内容生成第二私钥。
本申请的一些实施例中,第一区块链节点在生成共享密钥之后,可以根据共享密钥和第一交易内容生成临时的第二私钥(generate temporary private key)。其中,由于与不同交易对应的交易内容不同,则根据不同的交易内容生成的私钥不同,所以第二私钥为一次性的,或者说第二私钥为临时的,而不是固定的。需要说明的是,第二私钥为生成第二区块链节点的一次性公钥地址的过程中所产生的密钥,并不归属于第一区块链节点,也不归属于第二区块链节点,也不需要对任何交易信息进行解密。
具体的,第一区块链节点将共享密钥和第一交易内容(Txcontents)进行组合,得到第一组合结果;对第一组合结果进行哈希运算,以生成第二私钥。其中,第一交易内容指的是第一区块链节点与第二区块链节点当前交易的交易内容,第一交易内容中包括时间戳,用于指示第一交易内容所指向的交易的时间,作为示例,例如第一交易内容可以为“转移3个比特币”、“卖出两箱奇异果”、“卖出一辆汽车”等等,此处不做穷举。组合的方式包括但不限于拼接、异/或运算、相加等;采用的哈希函数包括但不限于SHA256、SHA512等,此处不对组合的方式以及采用的哈希函数进行穷举。本申请实施例中,提供了生成第二私钥的具体实现方式,操作简单,易于实现。
为更直观地理解本方案,以下生成第二私钥的公式的一个示例:
r=Hash(Txcontents,S)  (2)
其中,r代表第二私钥,Txcontents代表第一交易内容,S代表共享密钥,Txcontents,S代表将第一交易内容与共享密钥进行拼接,需要说明的是,式(2)仅为一个示例,不用于限定本方案。
303、第一区块链节点根据第二私钥生成第二区块链节点的第一公钥地址。
本申请实施例中,第一区块链节点在生成第二私钥之后,可以根据临时的第二私钥生成临时的第三公钥(generate temporary pubic key),进而根据临时的第三公钥,生成第二区块链节点的临时的第一公钥地址。需要说明的是,第三公钥的作用与第二私钥的功能类似,均为生成第二区块链节点的一次性公钥地址的过程中所生成的密钥,并不归属于第一区块链节点,也不归属于第二区块链节点,也不需要对任何交易信息进行解密。由于该第一公钥地址仅在第一区块链节点向第二区块链节点发送第一交易信息时使用,所以将第一公钥地址称为临时的公钥地址,也可以称为一次性的公钥地址。
具体的,第一区块链节点根据第二私钥和第二区块链节点的第二公钥,生成第二区块链节点的第一公钥地址。其中,无论在第二区块链节点仅拥有一套固定密钥的情况下,还是在第二区块链节点拥有两套固定密钥的情况下,第二区块链节点的第二公钥均为第二区块链节点的长期公钥。进一步地,若第二区块链节点仅拥有一套固定密钥,则第二区块链节点的第一公钥和第二区块链节点的第二公钥可以为同一密钥。若第二区块链节点拥有两套固定密钥,则第二区块链节点的第一公钥和第二区块链节点的第二公钥可以为不同的密钥,第二区块链节点的第一公钥为第二区块链节点的扫描公钥,第二区块链节点的第二公 钥为第二区块链节点的长期公钥。
本申请实施例中,根据第二私钥和第二区块链节点的第二公钥生成第一公钥地址,则需要借助第二区块链节点的第三私钥才能够生成花费第一交易信息中的产品时所使用的私钥,从而避免了第一区块链节点在将第一交易信息中的产品转移给第二区块链节点之后,还能够花费第一交易信息中的产品,以保证了第二区块链节点的财产的安全性,也包括了区块链上交易的稳定性。
更具体的,在一种情况中,步骤303可以包括:在椭圆曲线的公钥密码体系中,第一区块链节点根据临时的第二私钥和第二区块链节点的第二公钥,生成临时的第三公钥,并根据临时的第三公钥,生成临时的第一公钥地址。
进一步地,在一种实现方式中,在椭圆曲线的公钥密码体系中,第一区块链节点根据临时的第二私钥r,将临时的第二私钥r与生成元G(也即椭圆曲线群的生成元)进行点乘,可以生成临时的公钥R,进而将临时的公钥R与第二区块链节点的第二公钥B相加,以生成临时的第三公钥T,也即临时的第三公钥T=R+B,进而在椭圆曲线的公钥密码体系的约束下,根据临时的第三公钥T生成第一公钥地址。
在另一种实现方式中,在椭圆曲线的公钥密码体系中,第一区块链节点根据临时的第二私钥r,将临时的第二私钥r与生成元G(也即椭圆曲线群的生成元)进行点乘,可以生成临时的公钥R,进而将临时的公钥R与第二区块链节点的第二公钥B相减,以生成临时的第三公钥T,也即临时的第三公钥T=R-B,进而在椭圆曲线的公钥密码体系的约束下,根据临时的第三公钥T生成第一公钥地址。
在另一种实现方式中,在椭圆曲线的公钥密码体系中,第一区块链节点根据临时的第二私钥r,将临时的第二私钥r与第二区块链节点的第二公钥B相乘,以生成临时的第三公钥T,也即临时的第三公钥T=r.B,进而在椭圆曲线的公钥密码体系的约束下,根据临时的第三公钥T生成第一公钥地址。
在另一种实现方式中,在椭圆曲线的公钥密码体系中,第一区块链节点根据临时的第二私钥r,将临时的第二私钥r的倒数与第二区块链节点的第二公钥B相乘,以生成临时的第三公钥T,进而在椭圆曲线的公钥密码体系的约束下,根据临时的第三公钥T生成第一公钥地址等等,此处不对在椭圆曲线的公钥密码体系中,生成第一公钥地址的方式进行穷举,应理解,此处举例仅为进一步理解本方案,不用于限定本方案。
在另一种情况中,步骤303可以包括:在离散对数的公钥密码体系中,第一区块链节点根据临时的第二私钥和第二区块链节点的第二公钥,生成临时的第三公钥,并根据临时的第三公钥,生成临时的第一公钥地址。
进一步地,在一种实现方式中,第一区块链节点根据临时的第二私钥r,将临时的第二私钥r与第二区块链节点的第二公钥B进行指数运算,以生成临时的第三公钥T;其中,第二区块链节点的第二公钥B为前述指数运算的底数,临时的第二私钥r为前述指数运算的指数。进而在离散对数的公钥密码体系的约束下,根据临时的第三公钥T生成第一公钥地址等等,此处不对在离散对数的公钥密码体系中,生成第一公钥地址的方式进行穷举,应理解,此处举例仅为进一步理解本方案,不用于限定本方案。
本申请实施例中,无论是在椭圆曲线的公钥密码体系下,还是在离散对数的公钥密码体系下,均能根据临时的第二私钥和第二区块链节点的第二公钥,生成临时的第三公钥,并根据临时的第三公钥,生成临时的第一公钥地址,扩展了本方案的应用场景。
304、第一区块链节点将第一交易信息写入区块链,第一交易信息包括第一区块链节点的公钥地址、第一公钥地址和第一交易内容。
本申请实施例中,第一区块链节点在为第二区块链节点生成一次性的第一公钥地址之后,会将第一交易信息写入区块链,也即将第一交易信息上链。其中,第一交易信息包括第一区块链节点的公钥地址(也即字段Input的内容为交易发送方的公钥地址)、第一公钥地址(也即字段Output的内容为交易接收方的公钥地址)和第一交易内容。
进一步地,第一区块链节点的公钥地址属于第一区块链节点,若第一交易内容所指向的交易是由第一区块链节点首创的,则无论第一区块链节点拥有一套固定密钥,还是拥有两套固定密钥,第一区块链节点的公钥地址均为根据第一区块链节点的长期公钥生成的。若第一交易内容所指向的交易为第三区块链节点转移给第一区块链节点的,则第一区块链节点的公钥地址为第三区块链节点为第一区块链节点生成的临时公钥地址,具体临时公钥地址的生成方式可参阅上述步骤301至303中的描述,此处不做赘述。第一交易内容的含义可参阅上述步骤302中的描述,此处不做赘述。
写入区块链的第一交易信息由第二区块链节点根据第一公钥地址进行验证,第一公钥地址需要利用共享密钥进行验证,共享密钥能够通过第一区块链节点的公钥和第二区块链节点的第三私钥生成,也即第二区块链节点能够自主生成前述共享密钥。
305、第二区块链节点根据第一区块链节点的公钥和第二区块链节点的第一私钥生成共享密钥。
本申请实施例中,第二区块链节点能够获取到第一区块链节点的公钥和第二区块链节点的第一私钥,第二区块链节点根据第一区块链节点的公钥和第二区块链节点的第一私钥生成共享密钥。其中,在一种情况下,第一区块链节点和第二区块链节点均仅拥有一套固定密钥,一套固定密钥中包括一个长期私钥和一个长期公钥,则第一区块链节点的公钥指的是第一区块链节点的长期公钥,第二区块链节点的第一私钥指的是第二区块链节点的长期私钥。
在另一种情况下,第一区块链节点和第二区块链节点均拥有两套固定密钥,两套固定密钥包括第一套固定密钥和第二套固定密钥,第一套固定密钥包括一个长期私钥和一个长期公钥,第二套固定密钥包括一个扫描私钥和一个扫描公钥。与步骤301对应的,第一区块链节点的公钥为第一区块链节点的长期公钥,第二区块链节点的第一私钥为第二区块链节点的扫描私钥。
具体的,与步骤301对应的,在一种实现方式中,在椭圆曲线的公钥密码体系中,第二区块链节点基于静态的迪菲-赫尔曼算法,将第一区块链节点的公钥和第二区块链节点的第一私钥进行点乘,得到共享密钥。为更直观地理解本方案,以下以第二区块链节点拥有两套私钥为例,公开第二区块链节点在椭圆曲线的公钥密码体系中,生成共享密钥的公式的一个示例:
S=d.A=da.G   (3)
其中,S代表共享密钥,d代表第二区块链节点的第一私钥(也即第二区块链节点的扫描私钥),A代表第一区块链节点的公钥,A是由第一区块链节点的私钥a与生成元(generator,G)点乘得到,G代表椭圆曲线群的生成元,也可以称为椭圆曲线上的基点,则第二区块链节点也可以生成共享密钥,需要说明的是,虽然用户看来第二区块链节点的第一私钥和第一区块链节点的公钥均表现为包括字母、数字的密钥,但对于计算机而言,均可以通过二进制编码的方式进行表示。
在另一种实现方式中,在离散对数的公钥密码体系中,根据第一区块链节点的公钥和第二区块链节点的第一私钥,进行指数运算,第一区块链节点的公钥为指数运算中的底数,第二区块链节点的第一私钥为指数运算中的指数。
进一步地,在离散对数的公钥密钥体系中,第一区块链节点的公钥为第一区块链节点的私钥与生成元G进行指数运算得到,生成元G为指数运算中的底数,第一区块链节点的私钥为指数运算中的指数。在离散对数的公钥密钥体系中,生成元G代表的为整数群的生成元或素数群的生成元。
306、第二区块链节点对区块链上的至少一个交易信息进行读取,并判断区块链上的至少一个交易信息中是否存在第一交易信息,若存在,则确定第一交易内容指向的交易为交易成功;若不存在,则确定第一交易内容指向的交易为交易失败。
本申请实施例中,第二区块链节点需要遍历区块链节点上的所有交易信息,也即需要对区块链上的每个交易信息进行读取,以逐个判断区块链上的每个交易信息中是否为第一交易信息,也即判断区块链上的至少一个交易信息中是否存在第一交易信息。在区块链上的至少一个交易信息中存在第一交易信息的情况下,确定第一交易内容指向的交易为交易成功;在区块链上的至少一个交易信息中不存在第一交易信息的情况下,确定第一交易内容指向的交易为交易失败。
其中,区块链节点上的每个交易信息中均包括交易发送方的公钥地址(也即字段Input中的内容)、交易内容和交易接收方的公钥地址(也即字段Output中的内容)。第一交易信息包括第一区块链节点的公钥地址、第一交易内容和第二区块链节点的第一公钥地址;第一区块链节点的公钥地址属于第一区块链节点,第一交易内容为第一区块链节点和第二区块链节点之间交易的内容,第一公钥地址能够根据共享密钥和第一交易内容生成。也即第一交易信息的特点在于,第二区块链节点能够根据生成的共享密钥和交易信息中的交易内容,生成交易接收方的公钥地址。
具体的,针对判断区块链上的至少一个交易信息中的任一个交易信息是否为第一交易信息的过程。第二区块链节点在读取到一个交易信息之后,会获取该交易信息中的交易内容,并根据步骤305中生成的共享密钥和获取到的交易内容,生成一个临时的公钥地址,具体生成方式与步骤302和303中生成第一公钥地址的方式一致,此处不做赘述。进而判断该临时的公钥地址与该交易信息中的携带的接收方的公钥地址是否一致,若一致,则视为该交易信息为第一交易信息,若不一致,则视为该交易信息不是第一交易信息。
第二区块链节点对区块链上的每个交易信息均执行上述操作,以判断区块链上的每个 交易信息是否为第一交易信息。
307、第二区块链节点根据共享密钥和第一交易内容,生成第二私钥。
本申请实施例中,第二区块链节点在确定第一交易信息指向的交易为交易成功的情况下,当第二区块链节点需要花费第一交易信息中的产品时,还需要生成用于花费第一交易信息中的产品的临时的第四私钥,该临时的第四私钥与临时的第一公钥地址对应,也即该第四私钥需要能够在椭圆曲线的公钥密码体系的约束下,或者,在离散对数的公钥密码体系中的约束下,能够直接生成临时的第一公钥地址。
具体的,第二区块链节点生成临时的第四私钥的方式与第一区块链节点生成临时的第一公钥地址的方式对应。第二区块链节点需要先根据共享密钥和第一交易内容,生成第二私钥。具体实现方式与步骤302中第一区块链节点生成第二私钥的步骤一致,第二私钥的含义与步骤302中第二私钥的含义一致,均可参阅上述步骤302中的描述,此处不做赘述。
308、第二区块链节点根据第二私钥,生成第二区块链节点的第四私钥,第四私钥用于花费第一交易信息中的产品。
本申请实施例中,第二区块链节点根据第二私钥,生成第二区块链节点的临时的第四私钥,由于该临时的第四私钥需要与临时的第一公钥地址对应,则第二区块链节点生成第四私钥的方式,需要与步骤303中第一区块链节点生成第一公钥地址的方式对应。
具体的,在一种实现方式中,第二区块链节点根据第二私钥和第二区块链节点的第三私钥,生成第二区块链节点的临时的第四私钥。
更具体的,在一种情况中,步骤308可以包括:在椭圆曲线的公钥密码体系中,第二区块链节点根据临时的第二私钥和第二区块链节点的第三私钥(也即第二区块链节点的长期私钥),生成第二区块链节点的临时的第四私钥。其中,无论第二区块链节点包括一套固定密钥,还是两套固定密钥,第二区块链节点的第三私钥指的均为第二区块链节点的长期私钥。
进一步地,与步骤303对应,在一种实现方式中,在椭圆曲线的公钥密码体系中,第二区块链节点根据临时的第二私钥r,第二私钥r与第二区块链节点的第三私钥b相加,得到第一相加结果,将第一相加结果与q进行求余运算,得到第二区块链节点的临时的第四私钥。其中,求余运算也可以称为取余或者取模运算;在椭圆曲线的公钥密码体系中,q代表生成元的阶(order)。也即临时的第四私钥t=(r+b)mod q。
在另一种实现方式中,在椭圆曲线的公钥密码体系中,第二区块链节点根据临时的第二私钥r,第二私钥r与第二区块链节点的第三私钥b相减,得到第一相减结果,将第一相减结果与q进行求余运算,得到第二区块链节点的临时的第四私钥,也即临时的第四私钥t=(r-b)mod q。
在另一种实现方式中,在椭圆曲线的公钥密码体系中,第二区块链节点根据临时的第二私钥r,第二私钥r与第二区块链节点的第三私钥b相乘,将前述相乘结果与q进行求余运算,得到第二区块链节点的临时的第四私钥,也即临时的第四私钥t=(rb)mod q。
在另一种实现方式中,在椭圆曲线的公钥密码体系中,第二区块链节点根据临时的第二私钥r,第二私钥r的倒数与第二区块链节点的第三私钥b相乘,将前述相乘结果与q进 行求余运算,得到第二区块链节点的临时的第四私钥等等。
上述种种实现方式的举例均仅为方便理解本方案,不用于限定本方案,需要说明的是,在上述种种实现方式中,在椭圆曲线的公钥密码体系中,需要满足,生成的临时的第四私钥t点乘生成元G之后,需要等于步骤303中生成的临时的第三公钥T。
在另一种情况中,步骤308可以包括:在离散对数的公钥密码体系中,第二区块链节点根据临时的第二私钥和第二区块链节点的第三私钥(也即第二区块链节点的长期私钥),生成第二区块链节点的临时的第四私钥。其中,无论第二区块链节点包括一套固定密钥,还是两套固定密钥,第二区块链节点的第三私钥指的均为第二区块链节点的长期私钥。
进一步地,与步骤303对应,在一种实现方式中,在离散对数的公钥密码体系中,第二区块链节点将临时的第二私钥r与第二区块链节点的第三私钥b进行指数运算,得到第一运算结果;第三私钥b为前述指数运算的底数,第二私钥r为前述指数运算的指数。第二区块链节点将第一运算结果与q进行求余运算,得到第二区块链节点的临时的第四私钥。其中,在离散对数的公钥密码体系中,q代表生成元的阶(order)。
上述种种实现方式的举例均仅为方便理解本方案,不用于限定本方案,需要说明的是,在上述种种实现方式中,在离散对数的公钥密码体系中,需要满足,生成的临时的第四私钥t与生成元G进行指数运算之后,需要等于步骤303中生成的临时的第三公钥T。
本申请实施例中,提供了当第二区块链节点想要花费第一交易信息中的产品时,生成花费第一交易信息中的产品的私钥的具体生成方式,扩展了本方案的应用场景,且增加了本方案的完整性。
为更直观地理解本方案,请参阅图4和图5,图4和图5分别示出了本申请实施例提供的区块链信息的处理方法的两种流程示意图。图4和图5均以在椭圆曲线的公钥密码体系下为例;图4和图5的区别在于,图4以第一区块链节点和第二区块链节点均仅拥有一套固定密钥为例,图5以第一区块链节点和第二区块链节点均拥有两套固定密钥为例。先参阅图4,第一区块链节点中配置有长期私钥a和长期公钥A,第二区块链节点中配置有长期私钥b和长期公钥B。C1、第一区块链节点通过将a与B进行点乘,生成共享密钥S。C2、第一区块链节点将第一交易内容与S进行拼接,并对拼接结果进行哈希运算,以生成临时的第二私钥r。C3、第一区块链节点将r与G进行点乘,并将点乘结果与B相加,以生成临时的第三公钥T,也即T=r.G+B=R+B,临时的第三公钥T用于生成第二区块链节点的临时的第一公钥地址。C4、第一区块链节点将第一交易信息上链,第一交易信息包括第一区块链节点的公钥地址(也即交易发送方的公钥地址)、第二区块链节点的临时的第一公钥地址(也即交易接收方的公钥地址)和第一交易内容。C5、第二区块链节点通过将b与A进行点乘,生成共享密钥S。C6、第二区块链节点在读取到区块链上的一个交易信息之后,将读取到的交易内容(Txcontents1)与S进行拼接,并对拼接结果进行哈希运算,以生成临时的私钥r1。需要说明的是,若当前读取的交易信息为第一交易信息,则Txcontents1与Txcontents相同,且r1与r相同;若当前读取的交易信息不是第一交易信息,则Txcontents1与Txcontents不同,且r1与r不同。C7、第二区块链节点将r1与G进行点乘,并将点乘结果与B相加,得到相加结果,将计算到的相加结果与读取到交易信息中携带的交易接收 方的公钥地址进行对比,以判断计算到的相加结果与读取到的交易接收方的公钥地址是否相同,若相同,则证明读取到的交易信息为第一交易信息,也即证明第一交易信息指向的交易成功;若区块链上的所有交易信息均不是第一交易信息,则证明第一交易信息执行的交易失败。C8、在第一交易信息指向的交易成功的情况下,当第二区块链节点想要花费第一交易信息中的产品时,还会根据第二私钥,生成第二区块链节点的第四私钥,第四私钥用于花费第一交易信息中的产品,t点乘G之后需要等于T,也即t=(r+b)mod q。
请再参阅图5,第一区块链节点配置有长期私钥a和长期公钥A,第二区块链节点中配置有长期私钥b、长期公钥B、扫描私钥d和扫描公钥D。D1、第一区块链节点通过将a与D进行点乘,生成共享密钥S。D2、第一区块链节点将第一交易内容与S进行拼接,并对拼接结果进行哈希运算,以生成临时的第二私钥r。D3、第一区块链节点将r与B进行点乘,以生成临时的第三公钥T,临时的第三公钥T用于生成第二区块链节点的临时的第一公钥地址。D4、第一区块链节点将第一交易信息上链,第一交易信息包括第一区块链节点的公钥地址(也即交易发送方的公钥地址)、第二区块链节点的临时的第一公钥地址(也即交易接收方的公钥地址)和第一交易内容。D5、第二区块链节点通过将d与A进行点乘,生成共享密钥S。D6、第二区块链节点在读取到区块链上的一个交易信息之后,将读取到的交易内容(Txcontents1)与S进行拼接,并对拼接结果进行哈希运算,以生成临时的私钥r1。D7、第二区块链节点将r1与B进行点乘,判断计算到的点乘结果与读取到的交易接收方的公钥地址是否相同,若相同,则证明读取到的交易信息为第一交易信息,也即证明第一交易信息指向的交易成功;若区块链上的所有交易信息均不是第一交易信息,则证明第一交易信息执行的交易失败。D8、在第一交易信息指向的交易成功的情况下,当第二区块链节点想要花费第一交易信息中的产品时,还会根据第二私钥,生成第二区块链节点的第四私钥,第四私钥用于花费第一交易信息中的产品,t点乘G之后需要等于T,也即t=(rb)mod q。需要说明的是,图4和图5中的举例均仅为方便理解本方案,不用于限定本方案。
本申请实施例中,由于第一交易信息的公钥地址是根据共享密钥和第一交易内容生成的,而不同交易中的交易内容是不同的,则区块链上的每个交易信息的公钥地址都是一次性的,从而可以很好的保护接收方的隐私;且共享密钥也可以通过第一区块链节点的公钥和第二区块链节点的第一私钥生成,也即接收方也可以生成共享密钥,并根据共享密钥和第一交易内容生成第一交易信息的公钥地址,以对交易信息进行验证,接收方无需存储并管理多个公私钥对,降低了管理难度。且不需要更改写入区块链的交易信息的格式,降低了本方案带来的技术更新的难度。
二、共享密钥用于加密第五私钥
本申请实施例中,请参阅图6,图6为本申请实施例提供的区块链信息的处理方法的一种流程示意图,本申请实施例提供的区块链信息的处理方法可以包括:
601、第一区块链节点根据第一区块链节点的私钥和第二区块链节点的第一公钥生成共享密钥。
本申请实施例中,第一区块链节点执行步骤601的具体实现方式与图3对应实施例中 步骤301的具体实现方式类似,可参阅图3中的描述,此处不做赘述。
602、第一区块链节点随机生成第五私钥。
本申请的一些实施例中,第一区块链节点随机生成第五私钥。其中,第五私钥也是临时的一次性的私钥,第五私钥的作用与图3对应实施例中第二私钥的作用类似,第五私钥为生成第二区块链节点的一次性公钥地址的过程中所产生的私钥,并不归属于第一区块链节点,也不归属于第二区块链节点,也不需要对任何交易信息进行解密。
需要说明的是,本申请实施例不限定步骤601和602的执行顺序,可以先执行步骤601,再执行步骤602,也可以先执行步骤602,再执行步骤601,还可以同时执行步骤601和步骤602。
603、第一区块链节点根据第五私钥生成第二区块链节点的第二公钥地址。
本申请实施例中,第一区块链节点在随机生成第五私钥之后,会根据第五私钥生成临时的第四公钥,进而根据临时的第四公钥生成第二区块链节点的临时的第二公钥地址。其中,临时的第四公钥的含义与图3对应实施例中临时的第三公钥的含义类似,作用相同,为生成第二区块链节点的第二公钥地址的过程中产生的密钥,既不归属于第一区块链节点,也不归属于第二区块链节点,也不需要对任何交易信息进行解密。
具体的,第一区块链节点根据第五私钥和第二区块链节点的第二公钥生成临时的第四公钥,进而根据临时的第四公钥生成第二区块链节点的临时的第二公钥地址。
其中,第二区块链节点的第二公钥地址的概念和第二区块链节点的第二公钥的概念均可以参阅图3对应各个实施例的描述,第一区块链节点执行步骤603的具体实现方式与图3对应实施例中步骤303的具体实现方式类似,区别仅在于将图3对应实施例中步骤303中的第二私钥替换为步骤603中的第五私钥,具体实现方式以及带来的有益效果可参阅图3中的描述,此处不做赘述。
604、第一区块链节点采用共享密钥对第五私钥进行对称加密,得到加密后的第五私钥。
本申请的一些实施例中,第一区块链节点会利用步骤601生成的共享密钥对第五私钥进行对称加密,以得到加密后的第五私钥。其中,加密后的第五私钥可以表示为En(h,S),h代表随机生成的第五私钥,S代表共享密钥,En(h,S)代表利用共享密钥对h进行对称加密。对称加密的算法指的是加密和解密使用相同密钥的加密算法,对称加密的算法包括但不限于数据加密标准(DES,data encryption standard)、3数据加密标准(3DES,triple data encryption standard)、高级加密标准(AES,advanced encryption standard)或其他对称加密算法等等,此处不一一列举,具体采用哪种对称加密的算法,可结合实际情况灵活选择,此处不做限定。
需要说明的是,本申请实施例不限定步骤603和604的执行顺序,可以先执行步骤603,再执行步骤604,也可以先执行步骤604,再执行步骤603,还可以同时执行步骤603和步骤604。
605、第一区块链节点将第二交易信息写入区块链,第二交易信息包括第一区块链节点的公钥地址、第二公钥地址、第一交易内容和加密后的第五私钥。
本申请的一些实施例中,第一区块链节点将第二交易信息写入区块链,也即将第二交 易信息上链。其中,第二交易信息包括第一区块链节点的公钥地址、第二公钥地址(也即第二区块链节点的临时公钥地址)、第一交易内容和加密后的第五私钥,也即第二交易信息的格式为字段Input的内容为第一区块链节点的公钥地址(也即交易发送方的公钥地址)、字段Output的内容为第二区块链节点的第二公钥地址(也即交易接收方的公钥地址)、字段交易内容的内容为第一交易内容和加密后的第五私钥,字段交易内容可以表示为(Txcontents,En(h,S))。
进一步地,第一区块链节点的公钥地址属于第一区块链节点,第一交易内容为第一区块链节点和第二区块链节点之间交易的内容,写入区块链的第二交易信息由第二区块链节点根据第二公钥地址进行验证,第二公钥地址为根据第五私钥生成,加密后的第五私钥需要利用共享密钥进行解密,共享密钥在第二区块链节点处通过第一区块链节点的公钥和第二区块链节点的第一私钥生成。
606、第二区块链节点根据第一区块链节点的公钥和第二区块链节点的第一私钥生成共享密钥。
本申请实施例中,第一区块链节点执行步骤606的具体实现方式与图3对应实施例中步骤305的具体实现方式类似,可参阅图5中的描述,此处不做赘述。
607、第二区块链节点对区块链上的至少一个交易信息进行读取,并判断区块链上的至少一个交易信息中是否存在第二交易信息,若存在,则确定第一交易内容指向的交易为交易成功;若不存在,则确定第一交易内容指向的交易为交易失败。
本申请实施例中,第二区块链节点需要遍历区块链节点上的所有交易信息,也即需要对区块链上的每个交易信息进行读取,以逐个判断区块链上的每个交易信息中是否为第二交易信息,也即判断区块链上的至少一个交易信息中是否存在第二交易信息。在区块链上的至少一个交易信息中存在第二交易信息的情况下,确定第一交易内容指向的交易为交易成功;在区块链上的至少一个交易信息中不存在第二交易信息的情况下,确定第一交易内容指向的交易为交易失败。
其中,区块链节点上的每个交易信息中均包括交易发送方的公钥地址(也即字段Input中的内容)、交易接收方的公钥地址(也即字段Output中的内容)、交易发送方和交易接收方之间的交易内容以及加密后的第五私钥。第二交易信息包括第一区块链节点的公钥地址、第二区块链节点的第二公钥地址、第一交易内容和加密后的第五私钥,加密后的第五私钥能够通过第二区块链节点生成的共享密钥解密,第二公钥地址能够根据第五私钥生成。
具体的,针对判断区块链上的至少一个交易信息中的任一个交易信息是否为第二交易信息的过程。第二区块链节点在读取到一个交易信息之后,会利用生成的共享密钥对加密后的密钥进行解密,进而采用步骤603中的方式,根据解密结果生成公钥地址,并判断生成的公钥地址是否与获取的交易信息中包括的交易接收方的公钥地址一致,若一致,则证明读取到的交易信息为第二交易信息,若不一致,则证明读取到的交易信息不是第二交易信息。
第二区块链节点对区块链上的每个交易信息均执行上述操作,以判断区块链上的每个交易信息是否为第二交易信息。
608、第二区块链节点根据第五私钥,生成第二区块链节点的第六私钥,第六私钥用于花费第二交易信息中的产品。
本申请实施例中,第二区块链节点在确定第二交易信息指向的交易为交易成功的情况下,当第二区块链节点需要花费第二交易信息中的产品时,还需要生成用于花费第二交易信息中的产品的临时的第六私钥,该临时的第六私钥与临时的第二公钥地址对应,也即该第六私钥需要能够在椭圆曲线的公钥密码体系的约束下,或者,在离散对数的公钥密码体系中的约束下,能够直接生成临时的第二公钥地址。
具体的,第二区块链节点根据第五私钥和第二区块链节点的第三私钥,生成第二区块链节点的临时的第六私钥。
更具体的,在一种情况中,步骤608可以包括:在椭圆曲线的公钥密码体系中,第二区块链节点根据临时的第五私钥和第二区块链节点的第三私钥(也即第二区块链节点的长期私钥),生成第二区块链节点的临时的第六私钥。具体实现方式可参阅图3对应实施例中步骤308中的描述,区别在于将步骤308中的第二私钥替换为步骤608中的第五私钥,需要说明的是,在椭圆曲线的公钥密码体系中,需要满足,生成的临时的第六私钥点乘生成元G之后,需要等于步骤603中生成的临时的第四公钥。
在另一种情况中,步骤608可以包括:在离散对数的公钥密码体系中,第二区块链节点根据临时的第五私钥和第二区块链节点的第三私钥(也即第二区块链节点的长期私钥),生成第二区块链节点的临时的第六私钥。具体实现方式可参阅图3对应实施例中步骤308中的描述,区别在于将步骤308中的第二私钥替换为步骤608中的第五私钥,需要说明的是,在离散对数的公钥密码体系中,需要满足,生成的临时的第六私钥与生成元G进行指数运算之后,需要等于步骤603中生成的临时的第四公钥。
为更直观地理解本方案,请参阅图7和图8,图7和图8分别示出了本申请实施例提供的区块链信息的处理方法的两种流程示意图。图7和图8均以在椭圆曲线的公钥密码体系下为例;图7和图8的区别在于,图7以第一区块链节点和第二区块链节点均仅拥有一套固定密钥为例,图8以第一区块链节点和第二区块链节点均拥有两套固定密钥为例。先参阅图7,第一区块链节点中配置有长期私钥a和长期公钥A,第二区块链节点中配置有长期私钥b和长期公钥B。E1、第一区块链节点通过将a与B进行点乘,生成共享密钥S。E2、第一区块链节点随机生成临时的第五私钥h。E3、第一区块链节点将h与G进行点乘,并将点乘结果与B相加,以生成临时的第三公钥M,临时的第三公钥M用于生成第二区块链节点的临时的第二公钥地址。E4、第一区块链节点采用共享密钥对第五私钥进行对称加密,得到加密后的第五私钥。E5、第一区块链节点将第二交易信息上链,第二交易信息包括第一区块链节点的公钥地址(也即交易发送方的公钥地址)、第二区块链节点的临时的第二公钥地址(也即交易接收方的公钥地址)、第一交易内容和加密后的第五私钥。E6、第二区块链节点通过将b与A进行点乘,生成共享密钥S。E7、第二区块链节点在读取到区块链上的一个交易信息之后,通过共享密钥对读取到的交易信息中加密后的私钥进行解密,得到解密结果h1。需要说明的是,若当前读取的交易信息为第二交易信息,则h1与h相同;若当前读取的交易信息不是第二交易信息,则h1与h不同。E8、第二区块链节点将 h1与G进行点乘,并将点乘结果与B相加,得到相加结果,将计算到的相加结果与读取到交易信息中携带的交易接收方的公钥地址进行对比,以判断计算到的相加结果与读取到的交易接收方的公钥地址是否相同,若相同,则证明读取到的交易信息为第二交易信息,也即证明第二交易信息指向的交易成功;若区块链上的所有交易信息均不是第二交易信息,则证明第二交易信息执行的交易失败。E9、在第二交易信息指向的交易成功的情况下,当第二区块链节点想要花费第二交易信息中的产品时,还会根据第二私钥,生成第二区块链节点的第六私钥,第六私钥用于花费第二交易信息中的产品,m点乘G之后需要等于M,也即m=(h+b)mod q。
请继续参阅图8,图8与图7的区别在于,第一,图8中的第二区块链节点配置有长期私钥b、长期公钥B、扫描私钥d和扫描公钥D。对应的,步骤F1中,第一区块链节点通过将a与D进行点乘,生成共享密钥S;步骤F6中,第二区块链节点通过将d与A进行点乘,生成共享密钥S。第二,步骤F3中,第一区块链节点将h与B进行点乘,以生成临时的第四公钥M,对应的,步骤F8中,第二区块链节点将h1与B进行点乘,判断计算到的点乘结果与读取到的交易接收方的公钥地址是否相同,且在步骤F9中,为了保证第六私钥m与G点乘后等于第四公钥M,m=(hb)mod q。图8中剩余步骤的描述均可参阅上述图7中的介绍,此处不做赘述。需要说明的是,图7和图8中的举例均仅为方便理解本方案,不用于限定本方案。
本申请实施例中,在隐藏交易接收方的真实地址的前提下,提供了交易接收方无需存储并管理多个公私钥对的又一实现方案,提高了本方案的实现灵活性。
在图1至图8所对应的实施例的基础上,为了更好的实施本申请实施例的上述方案,下面还提供用于实施上述方案的相关设备。具体参阅图9,图9为本申请实施例提供的地址的生成装置的一种结构示意图。地址的生成装置900应用于第一区块链节点,地址的生成装置900包括生成模块901和写入模块902。其中,生成模块901,用于根据第一区块链节点的私钥和第二区块链节点的第一公钥生成共享密钥;生成模块901,还用于根据共享密钥和第一交易内容生成第二区块链节点的第一公钥地址;写入模块902,用于将第一交易信息写入区块链,第一交易信息包括第一区块链节点的公钥地址、第一公钥地址和第一交易内容。其中,第一交易内容为第一区块链节点和第二区块链节点之间的交易的内容,写入区块链的第一交易信息由第二区块链节点根据第一公钥地址进行验证,第一公钥地址需要利用共享密钥进行验证,共享密钥在第二区块链节点处通过第一区块链节点的公钥和第二区块链节点的第一私钥生成。
在一种可能的设计中,生成模块901,具体用于根据共享密钥和第一交易内容生成第二私钥,根据第二私钥和第二区块链节点的第二公钥生成第一公钥地址。
在一种可能的设计中,生成模块901,具体用于将共享密钥和第一交易内容进行组合,得到第一组合结果,对第一组合结果进行哈希运算,以生成第二私钥。
在一种可能的设计中,生成模块901,具体用于:在椭圆曲线的公钥密码体系中,根据第二私钥和第二区块链节点的第二公钥,生成第三公钥,并根据第三公钥,生成第一公钥地址;或者,在离散对数的公钥密码体系中,根据第二私钥和第二区块链节点的第二公 钥,生成第三公钥,并根据第三公钥,生成第一公钥地址。
在一种可能的设计中,生成模块901,具体用于执行以下两项中的任一项:在椭圆曲线的公钥密码体系中,将第一区块链节点的私钥与第二区块链节点的第一公钥进行点乘,得到共享密钥;或者,在离散对数的公钥密码体系中,根据第一区块链节点的私钥和第二区块链节点的第一公钥,进行指数运算,得到共享密钥,第二区块链节点的第一公钥为指数运算中的底数,第一区块链节点的私钥为指数运算中的指数。
在一种可能的设计中,第一区块链节点和第二区块链节点均仅拥有一套固定密钥,一套固定密钥中包括一个长期私钥和一个长期公钥,第一区块链节点的私钥为第一区块链节点的长期私钥,第二区块链节点的第一公钥为第二区块链节点的长期公钥,第一区块链节点的公钥为第一区块链节点的长期公钥,第二区块链节点的第一私钥为第二区块链节点的长期私钥。或者,第一区块链节点和第二区块链节点均拥有两套固定密钥,两套固定密钥包括第一套固定密钥和第二套固定密钥,第一套固定密钥包括一个长期私钥和一个长期公钥,第二套固定密钥包括一个扫描私钥和一个扫描公钥,第一区块链节点的私钥为第一区块链节点的长期私钥,第二区块链节点的第一公钥为第二区块链节点的扫描公钥,第一区块链节点的公钥为第一区块链节点的长期公钥,第二区块链节点的第一私钥为第二区块链节点的扫描私钥。
需要说明的是,地址的生成装置900中各模块/单元之间的信息交互、执行过程等内容,与本申请中图3至图5对应的各个方法实施例基于同一构思,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
本申请实施例还提供一种区块链信息的处理装置,请参阅图10,图10为本申请实施例提供的区块链信息的处理装置的一种结构示意图。区块链信息的处理装置1000应用于第二区块链节点,区块链信息的处理装置1000包括生成模块1001、读取模块1002和确定模块1003。其中,生成模块1001,用于根据第一区块链节点的公钥和第二区块链节点的第一私钥生成共享密钥;读取模块1002,用于对区块链上的至少一个交易信息进行读取;确定模块1003,用于在至少一个交易信息中存在第一交易信息的情况下,确定第一交易内容指向的交易为交易成功,第一交易信息包括第一区块链节点的公钥地址、第一交易内容和第二区块链节点的第一公钥地址。其中,第一区块链节点的公钥地址属于第一区块链节点,第一交易内容为第一区块链节点和第二区块链节点之间交易的内容,第一公钥地址能够根据共享密钥和第一交易内容生成。
在一种可能的设计中,生成模块1001,具体用于:在椭圆曲线的公钥密码体系中,将第一区块链节点的公钥和第二区块链节点的第一私钥进行点乘,得到共享密钥;或者,在离散对数的公钥密码体系中,根据第一区块链节点的公钥和第二区块链节点的第一私钥,进行指数运算,第一区块链节点的公钥为指数运算中的底数,第二区块链节点的第一私钥为指数运算中的指数。
在一种可能的设计中,生成模块1001,还用于根据共享密钥和第一交易内容,生成第二私钥;生成模块1001,还用于根据第二私钥和第二区块链节点的第三私钥,生成第二区块链节点的第四私钥,第四私钥用于花费第一交易信息中的产品。
在一种可能的设计中,第一区块链节点和第二区块链节点均仅拥有一套固定密钥,一套固定密钥中包括一个长期私钥和一个长期公钥,第一区块链节点的公钥为第一区块链节点的长期公钥,第二区块链节点的第一私钥为第二区块链节点的长期私钥。或者,第一区块链节点和第二区块链节点均拥有两套固定密钥,两套固定密钥包括第一套固定密钥和第二套固定密钥,第一套固定密钥包括一个长期私钥和一个长期公钥,第二套固定密钥包括一个扫描私钥和一个扫描公钥,第一区块链节点的公钥为第一区块链节点的长期公钥,第二区块链节点的第一私钥为第二区块链节点的扫描私钥。
需要说明的是,区块链信息的处理装置1000中各模块/单元之间的信息交互、执行过程等内容,与本申请中图3至图5对应的各个方法实施例基于同一构思,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
本申请实施例还提供一种地址的生成装置,具体参阅图11,图11为本申请实施例提供的地址的生成装置的一种结构示意图。地址的生成装置1100应用于第一区块链节点,地址的生成装置1100包括生成模块1101、加密模块1102、和写入模块1103。其中,生成模块1101,用于根据第一区块链节点的私钥和第二区块链节点的第一公钥生成共享密钥;生成模块1101,还用于随机生成第五私钥,并根据第五私钥生成第二区块链节点的第二公钥地址;加密模块1102,用于采用共享密钥对第五私钥进行对称加密,得到加密后的第五私钥;写入模块1103,用于将第二交易信息写入区块链,第二交易信息包括第一区块链节点的公钥地址、第二公钥地址、第一交易内容和加密后的第五私钥。其中,第一区块链节点的公钥地址属于第一区块链节点,第一交易内容为第一区块链节点和第二区块链节点之间交易的内容,写入区块链的第二交易信息由第二区块链节点根据第二公钥地址进行验证,第二公钥地址为根据第五私钥生成,加密后的第五私钥需要利用共享密钥进行解密,共享密钥在第二区块链节点处通过第一区块链节点的公钥和第二区块链节点的第一私钥生成。
在一种可能的设计中,生成模块1101,具体用于执行以下两项中的任一项:在椭圆曲线的公钥密码体系中,将第一区块链节点的私钥与第二区块链节点的第一公钥进行点乘,得到共享密钥;或者,在离散对数的公钥密码体系中,根据第一区块链节点的私钥和第二区块链节点的第一公钥,进行指数运算,第二区块链节点的第一公钥为指数运算中的底数,第一区块链节点的私钥为指数运算中的指数。
在一种可能的设计中,生成模块1101,具体用于根据第五私钥和第二区块链节点的第二公钥,生成第二公钥地址。
需要说明的是,地址的生成装置1100中各模块/单元之间的信息交互、执行过程等内容,与本申请中图6至图8对应的各个方法实施例基于同一构思,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
本申请实施例还提供一种区块链信息的处理装置,请参阅图12,图12为本申请实施例提供的区块链信息的处理装置的一种结构示意图。区块链信息的处理装置1200应用于第二区块链节点,区块链信息的处理装置1200包括生成模块1201、读取模块1202和确定模块1203。其中,生成模块1201,用于根据第一区块链节点的公钥和第二区块链节点的第一私钥生成共享密钥;读取模块1202,用于对区块链上的至少一个交易信息进行读取;确定 模块1203,用于在至少一个交易信息中存在第二交易信息的情况下,确定第一交易内容指向的交易为交易成功,第二交易信息包括第一区块链节点的公钥地址、第二区块链节点的第二公钥地址、第一交易内容和加密后的第五私钥。其中,第一区块链节点的公钥地址属于第一区块链节点,第一交易内容为第一区块链节点和第二区块链节点之间交易的内容,加密后的第五私钥能够通过共享密钥解密,第二公钥地址能够根据第五私钥生成。
在一种可能的设计中,生成模块1201,具体用于执行以下两项中的任一项:在椭圆曲线的公钥密码体系中,将第一区块链节点的公钥和第二区块链节点的第一私钥进行点乘,得到共享密钥;或者,在离散对数的公钥密码体系中,根据第一区块链节点的公钥和第二区块链节点的第一私钥,进行指数运算,第一区块链节点的公钥为指数运算中的底数,第二区块链节点的第一私钥为指数运算中的指数。
在一种可能的设计中,生成模块1201,还用于根据第五私钥和第二区块链节点的第三私钥,生成第二区块链节点的第六私钥,第六私钥用于花费第二交易信息中的产品。
需要说明的是,区块链信息的处理装置1200中各模块/单元之间的信息交互、执行过程等内容,与本申请中图6至图8对应的各个方法实施例基于同一构思,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。
本申请实施例还提供了一种区块链节点,请参阅图13,图13为本申请实施例提供的区块链节点的一种结构示意图。其中,区块链节点1300上可以部署有图3至图5对应实施例中所描述的第一区块链节点,用于实现图9对应实施例中地址的生成装置900的功能。或者,区块链节点1300上可以部署有图3至图5对应实施例中所描述的第二区块链节点,用于实现图10对应实施例中区块链信息的处理装置1000的功能。或者,区块链节点1300上可以部署有图6至图8对应实施例中所描述的第一区块链节点,用于实现图11对应实施例中地址的生成装置1100的功能。或者,区块链节点1300上可以部署有图6至图8对应实施例中所描述的第二区块链节点,用于实现图12对应实施例中区块链信息的处理装置1200的功能。
具体的,区块链节点1300包括:接收器1301、发射器1302、处理器1303和存储器1304(其中区块链节点1300中的处理器1303的数量可以一个或多个,图13中以一个处理器为例),其中,处理器1303可以包括应用处理器13031和通信处理器13032。在本申请实施例的一些实施例中,接收器1301、发射器1302、处理器1303和存储器1304可通过总线或其它方式连接。
存储器1304可以包括只读存储器和随机存取存储器,并向处理器1303提供指令和数据。存储器1304的一部分还可以包括非易失性随机存取存储器(non-volatile random access memory,NVRAM)。存储器1304存储有处理器和操作指令、可执行模块或者数据结构,或者它们的子集,或者它们的扩展集,其中,操作指令可包括各种操作指令,用于实现各种操作。
处理器1303控制数据生成装置的操作。具体的应用中,数据生成装置的各个组件通过总线系统耦合在一起,其中总线系统除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都称为总线系统。
上述本申请实施例揭示的方法可以应用于处理器1303中,或者由处理器1303实现。处理器1303可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1303中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1303可以是通用处理器、数字信号处理器(digital signal processing,DSP)、微处理器或微控制器,还可进一步包括专用集成电路(application specific integrated circuit,ASIC)、现场可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。该处理器1303可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1304,处理器1303读取存储器1304中的信息,结合其硬件完成上述方法的步骤。
接收器1301可用于接收输入的数字或字符信息,以及产生与数据生成装置的相关设置以及功能控制有关的信号输入。发射器1302可用于通过第一接口输出数字或字符信息,发射器1302还可用于通过第一接口向磁盘组发送指令,以修改磁盘组中的数据,发射器1302还可以包括显示屏等显示设备。
本申请实施例中,在一种情况下,应用处理器13031,用于实现图3至图5对应实施例中第一区块链节点的功能。对于应用处理器13031执行图3至图5对应实施例中第一区块链节点的功能的具体实现方式以及带来的有益效果,均可以参考图3至图5对应的各个方法实施例中的叙述,此处不再一一赘述。
在另一种情况下,应用处理器13031,用于实现图3至图5对应实施例中第二区块链节点的功能。对于应用处理器13031执行图3至图5对应实施例中第二区块链节点的功能的具体实现方式以及带来的有益效果,均可以参考图3至图5对应的各个方法实施例中的叙述,此处不再一一赘述。
在一种情况下,应用处理器13031,用于实现图6至图8对应实施例中第一区块链节点的功能。对于应用处理器13031执行图6至图8对应实施例中第一区块链节点的功能的具体实现方式以及带来的有益效果,均可以参考图6至图8对应的各个方法实施例中的叙述,此处不再一一赘述。
在另一种情况下,应用处理器13031,用于实现图6至图8对应实施例中第二区块链节点的功能。对于应用处理器13031执行图6至图8对应实施例中第二区块链节点的功能的具体实现方式以及带来的有益效果,均可以参考图6至图8对应的各个方法实施例中的叙述,此处不再一一赘述。
本申请实施例中还提供一种计算机可读存储介质,该计算机可读存储介质中存储有程序,当其在计算机上运行时,使得计算机执行如前述图3至图5所示实施例描述的方法中第一区块链节点所执行的步骤,或者,执行如前述图3至图5所示实施例描述的方法中第二区块链节点所执行的步骤。
本申请实施例中还提供一种计算机可读存储介质,该计算机可读存储介质中存储有程序,当其在计算机上运行时,使得计算机执行如前述图6至图8所示实施例描述的方法中第一区块链节点所执行的步骤,或者,执行如前述图6至图8所示实施例描述的方法中第二区块链节点所执行的步骤。
本申请实施例中还提供一种计算机程序,当其在计算机上运行时,使得计算机执行如前述图3至图5所示实施例描述的方法中第一区块链节点所执行的步骤,或者,执行如前述图3至图5所示实施例描述的方法中第二区块链节点所执行的步骤。
本申请实施例中还提供一种计算机程序,当其在计算机上运行时,使得计算机执行如前述图6至图8所示实施例描述的方法中第一区块链节点所执行的步骤,或者,执行如前述图6至图8所示实施例描述的方法中第二区块链节点所执行的步骤。
本申请实施例中还提供一种电路系统,所述电路系统包括处理电路,所述处理电路配置为执行如前述图3至图5所示实施例描述的方法中第一区块链节点所执行的步骤,或者,执行如前述图3至图5所示实施例描述的方法中第二区块链节点所执行的步骤。
本申请实施例中还提供一种电路系统,所述电路系统包括处理电路,所述处理电路配置为执行如前述图6至图8所示实施例描述的方法中第一区块链节点所执行的步骤,或者,执行如前述图6至图8所示实施例描述的方法中第二区块链节点所执行的步骤。
本申请实施例提供的相关设备具体可以为芯片,芯片包括:处理单元和通讯单元,所述处理单元例如可以是处理器,所述通讯单元例如可以是输入/输出接口、管脚或电路等。该处理单元可执行存储单元存储的计算机执行指令,以使芯片执行上述前述图3至图5所示实施例描述的方法中第一区块链节点所执行的步骤,或者,执行如上述图3至图5所示实施例描述的方法中第二区块链节点所执行的步骤,或者,执行上述前述图6至图8所示实施例描述的方法中第一区块链节点所执行的步骤,或者,执行如上述图6至图8所示实施例描述的方法中第二区块链节点所执行的步骤。可选地,所述存储单元为所述芯片内的存储单元,如寄存器、缓存等,所述存储单元还可以是所述无线接入设备端内的位于所述芯片外部的存储单元,如只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)等。
其中,上述任一处提到的处理器,可以是一个通用中央处理器,微处理器,ASIC,或一个或多个用于控制上述方法的程序执行的集成电路。
另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通讯连接,具体可以实现为一条或多条通讯总线或信号线。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CLU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容 易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、ROM、RAM、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序的形式实现。
所述计算机程序包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。

Claims (34)

  1. 一种地址的生成方法,其特征在于,所述方法应用于第一区块链节点,所述方法包括:
    根据所述第一区块链节点的私钥和所述第二区块链节点的第一公钥生成共享密钥;
    根据所述共享密钥和第一交易内容生成第二区块链节点的第一公钥地址;
    将第一交易信息写入区块链,所述第一交易信息包括所述第一区块链节点的公钥地址、所述第一公钥地址和所述第一交易内容;
    其中,所述第一交易内容为所述第一区块链节点和所述第二区块链节点之间的交易的内容,写入区块链的所述第一交易信息由所述第二区块链节点根据所述第一公钥地址进行验证,所述第一公钥地址需要利用所述共享密钥进行验证,所述共享密钥在所述第二区块链节点处通过所述第一区块链节点的公钥和所述第二区块链节点的第一私钥生成。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述共享密钥和第一交易内容生成第一交易信息的第一公钥地址,包括:
    根据所述共享密钥和所述第一交易内容生成第二私钥;
    根据所述第二私钥和所述第二区块链节点的第二公钥生成所述第一公钥地址。
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述共享密钥和所述第一交易内容生成第二私钥,包括:
    将所述共享密钥和所述第一交易内容进行组合,得到第一组合结果;
    对所述第一组合结果进行哈希运算,以生成所述第二私钥。
  4. 根据权利要求2所述的方法,其特征在于,所述根据所述第二私钥和所述第二区块链节点的第二公钥生成所述第一公钥地址,包括:
    在椭圆曲线的公钥密码体系中,根据所述第二私钥和所述第二区块链节点的第二公钥,生成第三公钥,并根据所述第三公钥,生成所述第一公钥地址;或者,
    在离散对数的公钥密码体系中,根据所述第二私钥和所述第二区块链节点的第二公钥,生成第三公钥,并根据所述第三公钥,生成所述第一公钥地址。
  5. 根据权利要求1至4任一项所述的方法,其特征在于,所述根据所述第一区块链节点的私钥和所述第二区块链节点的第一公钥生成共享密钥,包括:
    在椭圆曲线的公钥密码体系中,将所述第一区块链节点的私钥与所述第二区块链节点的第一公钥进行点乘,得到所述共享密钥;或者,
    在离散对数的公钥密码体系中,根据所述第一区块链节点的私钥和所述第二区块链节点的第一公钥,进行指数运算,得到所述共享密钥,所述第二区块链节点的第一公钥为所述指数运算中的底数,所述第一区块链节点的私钥为所述指数运算中的指数。
  6. 根据权利要求1至4任一项所述的方法,其特征在于,
    所述第一区块链节点和所述第二区块链节点均仅拥有一套固定密钥,所述一套固定密钥中包括一个长期私钥和一个长期公钥,所述第一区块链节点的私钥为所述第一区块链节点的长期私钥,所述第二区块链节点的第一公钥为所述第二区块链节点的长期公钥,所述第一区块链节点的公钥为所述第一区块链节点的长期公钥,所述第二区块链节点的第一私 钥为所述第二区块链节点的长期私钥;或者,
    所述第一区块链节点和所述第二区块链节点均拥有两套固定密钥,所述两套固定密钥包括第一套固定密钥和第二套固定密钥,所述第一套固定密钥包括一个长期私钥和一个长期公钥,所述第二套固定密钥包括一个扫描私钥和一个扫描公钥,所述第一区块链节点的私钥为所述第一区块链节点的长期私钥,所述第二区块链节点的第一公钥为所述第二区块链节点的扫描公钥,所述第一区块链节点的公钥为所述第一区块链节点的长期公钥,所述第二区块链节点的第一私钥为所述第二区块链节点的扫描私钥。
  7. 一种区块链信息的处理方法,其特征在于,所述方法应用于第二区块链节点,所述方法包括:
    根据第一区块链节点的公钥和所述第二区块链节点的第一私钥生成共享密钥;
    对区块链上的至少一个交易信息进行读取;
    在所述第二区块链节点确定所述至少一个交易信息中存在第一交易信息的情况下,确定第一交易内容指向的交易为交易成功,所述第一交易信息包括所述第一区块链节点的公钥地址、所述第一交易内容和所述第二区块链节点的第一公钥地址;
    其中,所述第一交易内容为所述第一区块链节点和所述第二区块链节点之间交易的内容,所述第一公钥地址为根据所述共享密钥和所述第一交易内容生成。
  8. 根据权利要求7所述的方法,其特征在于,所述根据第一区块链节点的公钥和所述第二区块链节点的第一私钥生成共享密钥,包括:
    在椭圆曲线的公钥密码体系中,将所述第一区块链节点的公钥和所述第二区块链节点的第一私钥进行点乘,得到所述共享密钥;或者,
    在离散对数的公钥密码体系中,根据所述第一区块链节点的公钥和所述第二区块链节点的第一私钥,进行指数运算,所述第一区块链节点的公钥为所述指数运算中的底数,所述第二区块链节点的第一私钥为所述指数运算中的指数。
  9. 根据权利要求7或8所述的方法,其特征在于,所述方法还包括:
    根据所述共享密钥和所述第一交易内容,生成第二私钥;
    根据所述第二私钥和所述第二区块链节点的第三私钥,生成所述第二区块链节点的第四私钥,所述第四私钥用于花费所述第一交易信息中的产品。
  10. 根据权利要求7或8所述的方法,其特征在于,
    所述第一区块链节点和所述第二区块链节点均仅拥有一套固定密钥,所述一套固定密钥中包括一个长期私钥和一个长期公钥,所述第一区块链节点的公钥为所述第一区块链节点的长期公钥,所述第二区块链节点的第一私钥为所述第二区块链节点的长期私钥;或者,
    所述第一区块链节点和所述第二区块链节点均拥有两套固定密钥,所述两套固定密钥包括第一套固定密钥和第二套固定密钥,所述第一套固定密钥包括一个长期私钥和一个长期公钥,所述第二套固定密钥包括一个扫描私钥和一个扫描公钥,所述第一区块链节点的公钥为所述第一区块链节点的长期公钥,所述第二区块链节点的第一私钥为所述第二区块链节点的扫描私钥。
  11. 一种地址的生成方法,其特征在于,所述方法应用于第一区块链节点,所述方法包 括:
    根据所述第一区块链节点的私钥和所述第二区块链节点的第一公钥生成共享密钥;
    随机生成第五私钥,并根据所述第五私钥生成第二区块链节点的第二公钥地址;
    采用所述共享密钥对所述第五私钥进行对称加密,得到加密后的第五私钥;
    将所述第二交易信息写入区块链,所述第二交易信息包括所述第一区块链节点的公钥地址、所述第二公钥地址、第一交易内容和所述加密后的第五私钥;
    其中,所述第一交易内容为所述第一区块链节点和所述第二区块链节点之间交易的内容,写入区块链的所述第二交易信息由所述第二区块链节点根据所述第二公钥地址进行验证,所述加密后的第五私钥需要利用所述共享密钥进行解密,所述共享密钥在所述第二区块链节点处通过所述第一区块链节点的公钥和所述第二区块链节点的第一私钥生成。
  12. 根据权利要求11所述的方法,其特征在于,所述根据所述第一区块链节点的私钥和所述第二区块链节点的第一公钥生成共享密钥,包括:
    在椭圆曲线的公钥密码体系中,将所述第一区块链节点的私钥与所述第二区块链节点的第一公钥进行点乘,得到所述共享密钥;或者,
    在离散对数的公钥密码体系中,根据所述第一区块链节点的私钥和所述第二区块链节点的第一公钥,进行指数运算,所述第二区块链节点的第一公钥为所述指数运算中的底数,所述第一区块链节点的私钥为所述指数运算中的指数。
  13. 根据权利要求11或12所述的方法,其特征在于,所述根据所述第五私钥生成第二区块链节点的第二公钥地址,包括:
    根据所述第五私钥和所述第二区块链节点的第二公钥,生成所述第二公钥地址。
  14. 一种区块链信息的处理方法,其特征在于,所述方法应用于第二区块链节点,所述方法包括:
    根据第一区块链节点的公钥和所述第二区块链节点的第一私钥生成共享密钥;
    对区块链上的至少一个交易信息进行读取;
    在所述第二区块链节点确定至少一个交易信息中存在第二交易信息的情况下,确定第一交易内容指向的交易为交易成功,所述第二交易信息包括所述第一区块链节点的公钥地址、所述第二区块链节点的第二公钥地址、所述第一交易内容和所述加密后的第五私钥;
    其中,所述第一交易内容为所述第一区块链节点和所述第二区块链节点之间交易的内容,所述加密后的第五私钥通过所述共享密钥解密,所述第二公钥地址为根据所述第五私钥生成。
  15. 根据权利要求14所述的方法,其特征在于,所述根据第一区块链节点的公钥和所述第二区块链节点的第一私钥生成共享密钥,包括:
    在椭圆曲线的公钥密码体系中,将所述第一区块链节点的公钥和所述第二区块链节点的第一私钥进行点乘,得到所述共享密钥;或者,
    在离散对数的公钥密码体系中,根据所述第一区块链节点的公钥和所述第二区块链节点的第一私钥,进行指数运算,所述第一区块链节点的公钥为所述指数运算中的底数,所述第二区块链节点的第一私钥为所述指数运算中的指数。
  16. 根据权利要求14或15所述的方法,其特征在于,所述方法还包括:
    根据所述第五私钥和所述第二区块链节点的第三私钥,生成所述第二区块链节点的第六私钥,所述第六私钥用于花费所述第二交易信息中的产品。
  17. 一种地址的生成装置,其特征在于,所述装置应用于第一区块链节点,所述装置包括:
    生成模块,用于根据所述第一区块链节点的私钥和所述第二区块链节点的第一公钥生成共享密钥;
    所述生成模块,还用于根据所述共享密钥和第一交易内容生成第二区块链节点的第一公钥地址;
    写入模块,用于将第一交易信息写入区块链,所述第一交易信息包括所述第一区块链节点的公钥地址、所述第一公钥地址和所述第一交易内容;
    其中,所述第一交易内容为所述第一区块链节点和所述第二区块链节点之间的交易的内容,写入区块链的所述第一交易信息由所述第二区块链节点根据所述第一公钥地址进行验证,所述第一公钥地址需要利用所述共享密钥进行验证,所述共享密钥在所述第二区块链节点处通过所述第一区块链节点的公钥和所述第二区块链节点的第一私钥生成。
  18. 根据权利要求17所述的装置,其特征在于,
    所述生成模块,具体用于根据所述共享密钥和所述第一交易内容生成第二私钥,根据所述第二私钥和所述第二区块链节点的第二公钥生成所述第一公钥地址。
  19. 根据权利要求18所述的装置,其特征在于,
    所述生成模块,具体用于将所述共享密钥和所述第一交易内容进行组合,得到第一组合结果,对所述第一组合结果进行哈希运算,以生成所述第二私钥。
  20. 根据权利要求18所述的装置,其特征在于,所述生成模块,具体用于:
    在椭圆曲线的公钥密码体系中,根据所述第二私钥和所述第二区块链节点的第二公钥,生成第三公钥,并根据所述第三公钥,生成所述第一公钥地址;或者,
    在离散对数的公钥密码体系中,根据所述第二私钥和所述第二区块链节点的第二公钥,生成第三公钥,并根据所述第三公钥,生成所述第一公钥地址。
  21. 根据权利要求17至20任一项所述的装置,其特征在于,
    所述生成模块,具体用于:
    在椭圆曲线的公钥密码体系中,将所述第一区块链节点的私钥与所述第二区块链节点的第一公钥进行点乘,得到所述共享密钥;或者,
    在离散对数的公钥密码体系中,根据所述第一区块链节点的私钥和所述第二区块链节点的第一公钥,进行指数运算,得到所述共享密钥,所述第二区块链节点的第一公钥为所述指数运算中的底数,所述第一区块链节点的私钥为所述指数运算中的指数。
  22. 根据权利要求17至20任一项所述的装置,其特征在于,
    所述第一区块链节点和所述第二区块链节点均仅拥有一套固定密钥,所述一套固定密钥中包括一个长期私钥和一个长期公钥,所述第一区块链节点的私钥为所述第一区块链节点的长期私钥,所述第二区块链节点的第一公钥为所述第二区块链节点的长期公钥,所述 第一区块链节点的公钥为所述第一区块链节点的长期公钥,所述第二区块链节点的第一私钥为所述第二区块链节点的长期私钥;或者,
    所述第一区块链节点和所述第二区块链节点均拥有两套固定密钥,所述两套固定密钥包括第一套固定密钥和第二套固定密钥,所述第一套固定密钥包括一个长期私钥和一个长期公钥,所述第二套固定密钥包括一个扫描私钥和一个扫描公钥,所述第一区块链节点的私钥为所述第一区块链节点的长期私钥,所述第二区块链节点的第一公钥为所述第二区块链节点的扫描公钥,所述第一区块链节点的公钥为所述第一区块链节点的长期公钥,所述第二区块链节点的第一私钥为所述第二区块链节点的扫描私钥。
  23. 一种区块链信息的处理装置,其特征在于,所述装置应用于第二区块链节点,所述装置包括:
    生成模块,用于根据第一区块链节点的公钥和所述第二区块链节点的第一私钥生成共享密钥;
    读取模块,用于对区块链上的至少一个交易信息进行读取;
    确定模块,用于在所述至少一个交易信息中存在第一交易信息的情况下,确定第一交易内容指向的交易为交易成功,所述第一交易信息包括所述第一区块链节点的公钥地址、第一交易内容和所述第二区块链节点的第一公钥地址;
    其中,所述第一交易内容为所述第一区块链节点和所述第二区块链节点之间交易的内容,所述第一公钥地址能够根据所述共享密钥和所述第一交易内容生成。
  24. 根据权利要求23所述的装置,其特征在于,所述生成模块,具体用于:
    在椭圆曲线的公钥密码体系中,将所述第一区块链节点的公钥和所述第二区块链节点的第一私钥进行点乘,得到所述共享密钥;或者,
    在离散对数的公钥密码体系中,根据所述第一区块链节点的公钥和所述第二区块链节点的第一私钥,进行指数运算,所述第一区块链节点的公钥为所述指数运算中的底数,所述第二区块链节点的第一私钥为所述指数运算中的指数。
  25. 根据权利要求23或24所述的装置,其特征在于,
    所述生成模块,还用于根据所述共享密钥和所述第一交易内容,生成第二私钥;
    所述生成模块,还用于根据所述第二私钥和所述第二区块链节点的第三私钥,生成所述第二区块链节点的第四私钥,所述第四私钥用于花费所述第一交易信息中的产品。
  26. 根据权利要求23或24所述的装置,其特征在于,
    所述第一区块链节点和所述第二区块链节点均仅拥有一套固定密钥,所述一套固定密钥中包括一个长期私钥和一个长期公钥,所述第一区块链节点的公钥为所述第一区块链节点的长期公钥,所述第二区块链节点的第一私钥为所述第二区块链节点的长期私钥;或者,
    所述第一区块链节点和所述第二区块链节点均拥有两套固定密钥,所述两套固定密钥包括第一套固定密钥和第二套固定密钥,所述第一套固定密钥包括一个长期私钥和一个长期公钥,所述第二套固定密钥包括一个扫描私钥和一个扫描公钥,所述第一区块链节点的公钥为所述第一区块链节点的长期公钥,所述第二区块链节点的第一私钥为所述第二区块链节点的扫描私钥。
  27. 一种地址的生成装置,其特征在于,所述装置应用于第一区块链节点,所述装置包括:
    生成模块,用于根据所述第一区块链节点的私钥和所述第二区块链节点的第一公钥生成共享密钥;
    所述生成模块,还用于随机生成第五私钥,并根据所述第五私钥生成第二区块链节点的第二公钥地址;
    加密模块,用于采用所述共享密钥对所述第五私钥进行对称加密,得到加密后的第五私钥;
    写入模块,用于将所述第二交易信息写入区块链,所述第二交易信息包括所述第一区块链节点的公钥地址、所述第二公钥地址、第一交易内容和所述加密后的第五私钥;
    其中,所述第一交易内容为所述第一区块链节点和所述第二区块链节点之间交易的内容,写入区块链的所述第二交易信息由所述第二区块链节点根据所述第二公钥地址进行验证,所述加密后的第五私钥需要利用所述共享密钥进行解密,所述共享密钥在所述第二区块链节点处通过所述第一区块链节点的公钥和所述第二区块链节点的第一私钥生成。
  28. 根据权利要求27所述的装置,其特征在于,所述生成模块,具体用于:
    在椭圆曲线的公钥密码体系中,将所述第一区块链节点的私钥与所述第二区块链节点的第一公钥进行点乘,得到所述共享密钥;或者,
    在离散对数的公钥密码体系中,根据所述第一区块链节点的私钥和所述第二区块链节点的第一公钥,进行指数运算,所述第二区块链节点的第一公钥为所述指数运算中的底数,所述第一区块链节点的私钥为所述指数运算中的指数。
  29. 根据权利要求27或28所述的装置,其特征在于,
    所述生成模块,具体用于根据所述第五私钥和所述第二区块链节点的第二公钥,生成所述第二公钥地址。
  30. 一种区块链信息的处理装置,其特征在于,所述装置应用于第二区块链节点,所述装置包括:
    生成模块,用于根据第一区块链节点的公钥和所述第二区块链节点的第一私钥生成共享密钥;
    读取模块,用于对区块链上的至少一个交易信息进行读取;
    确定模块,用于在所述至少一个交易信息中存在第二交易信息的情况下,确定第一交易内容指向的交易为交易成功,所述第二交易信息包括所述第一区块链节点的公钥地址、所述第二区块链节点的第二公钥地址、所述第一交易内容和所述加密后的第五私钥;
    其中,所述第一交易内容为所述第一区块链节点和所述第二区块链节点之间交易的内容,所述加密后的第五私钥为通过所述共享密钥解密,所述第二公钥地址为根据所述第五私钥生成。
  31. 根据权利要求30所述的装置,其特征在于,所述生成模块,具体用于:
    在椭圆曲线的公钥密码体系中,将所述第一区块链节点的公钥和所述第二区块链节点的第一私钥进行点乘,得到所述共享密钥;或者,
    在离散对数的公钥密码体系中,根据所述第一区块链节点的公钥和所述第二区块链节点的第一私钥,进行指数运算,所述第一区块链节点的公钥为所述指数运算中的底数,所述第二区块链节点的第一私钥为所述指数运算中的指数。
  32. 根据权利要求30或31所述的装置,其特征在于,
    所述生成模块,还用于根据所述第五私钥和所述第二区块链节点的第三私钥,生成所述第二区块链节点的第六私钥,所述第六私钥用于花费所述第二交易信息中的产品。
  33. 一种计算机程序,其特征在于,当其在计算机上运行时,使得计算机执行如权利要求1至6中任一项所述的方法,或者,使得计算机执行如权利要求7至10任一项所述的方法,或者,使得计算机执行如权利要求11至13任一项所述的方法,或者,使得计算机执行如权利要求14至16任一项所述的方法。
  34. 一种区块链节点,其特征在于,包括处理器,所述处理器与所述存储器耦合;
    所述存储器,用于存储程序;
    所述处理器,用于执行所述存储器中的程序,使得所述区块链节点执行如权利要求1至6中任一项所述的方法,或者,使得所述区块链节点执行如权利要求7至10任一项所述的方法,或者,使得所述区块链节点执行如权利要求11至13任一项所述的方法,或者,使得所述区块链节点执行如权利要求14至16任一项所述的方法。
PCT/CN2021/126962 2020-10-31 2021-10-28 地址的生成方法、区块链信息的处理方法以及相关设备 WO2022089518A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP21885245.7A EP4216486A4 (en) 2020-10-31 2021-10-28 ADDRESS GENERATION METHOD, BLOCKCHAIN INFORMATION PROCESSING METHOD, AND RELATED DEVICE
US18/308,786 US20230259926A1 (en) 2020-10-31 2023-04-28 Address generation method, blockchain information processing method, and related device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011196897.1 2020-10-31
CN202011196897.1A CN114531224B (zh) 2020-10-31 2020-10-31 地址的生成方法、区块链信息的处理方法以及相关设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/308,786 Continuation US20230259926A1 (en) 2020-10-31 2023-04-28 Address generation method, blockchain information processing method, and related device

Publications (1)

Publication Number Publication Date
WO2022089518A1 true WO2022089518A1 (zh) 2022-05-05

Family

ID=81381939

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/126962 WO2022089518A1 (zh) 2020-10-31 2021-10-28 地址的生成方法、区块链信息的处理方法以及相关设备

Country Status (4)

Country Link
US (1) US20230259926A1 (zh)
EP (1) EP4216486A4 (zh)
CN (1) CN114531224B (zh)
WO (1) WO2022089518A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115134163A (zh) * 2022-07-18 2022-09-30 西交利物浦大学 跨域密钥管理系统、跨域密钥建立方法、设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016202952A1 (en) * 2015-06-16 2016-12-22 The Provost, Fellows, Foundation Scholars, & The Other Members Of Board, Of The College Of The Holy & Undiv. Trinity Of Queen Elizabeth, Near Dublin Digital token exchange system
CN109691013A (zh) * 2018-08-16 2019-04-26 区链通网络有限公司 区块链节点间通信方法、装置及存储介质、区块链系统
CN110046482A (zh) * 2018-12-25 2019-07-23 阿里巴巴集团控股有限公司 身份核实方法及其系统

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201707788D0 (en) * 2017-05-15 2017-06-28 Nchain Holdings Ltd Computer-implemented system and method
CN108989022B (zh) * 2018-06-08 2021-11-09 中国科学院计算技术研究所 一种基于区块链的智能物件共享密钥建立方法和系统
CN109034800A (zh) * 2018-07-31 2018-12-18 杭州复杂美科技有限公司 一种隐私交易方法、系统及设备
CN109285073B (zh) * 2018-09-29 2022-03-04 数字钱包(北京)科技有限公司 数字货币交易方法及装置
CN110519059B (zh) * 2019-09-29 2023-05-05 四川师范大学 一种基于双线性映射的区块链双密钥隐匿地址处理方法
CN111241586B (zh) * 2020-01-20 2023-02-07 布比(北京)网络技术有限公司 区块链地址匿名处理方法及系统、终端、存储介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016202952A1 (en) * 2015-06-16 2016-12-22 The Provost, Fellows, Foundation Scholars, & The Other Members Of Board, Of The College Of The Holy & Undiv. Trinity Of Queen Elizabeth, Near Dublin Digital token exchange system
CN109691013A (zh) * 2018-08-16 2019-04-26 区链通网络有限公司 区块链节点间通信方法、装置及存储介质、区块链系统
CN110046482A (zh) * 2018-12-25 2019-07-23 阿里巴巴集团控股有限公司 身份核实方法及其系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4216486A4

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115134163A (zh) * 2022-07-18 2022-09-30 西交利物浦大学 跨域密钥管理系统、跨域密钥建立方法、设备及存储介质
CN115134163B (zh) * 2022-07-18 2023-08-25 西交利物浦大学 跨域密钥管理系统、跨域密钥建立方法、设备及存储介质

Also Published As

Publication number Publication date
CN114531224B (zh) 2024-03-01
EP4216486A1 (en) 2023-07-26
EP4216486A4 (en) 2024-03-27
CN114531224A (zh) 2022-05-24
US20230259926A1 (en) 2023-08-17

Similar Documents

Publication Publication Date Title
EP3563329B1 (en) Off-chain smart contract service based on trusted execution environment
Hardin et al. Amanuensis: Information provenance for health-data systems
US20190074968A1 (en) Method, apparatus and system for data encryption and decryption
WO2022247576A1 (zh) 一种数据处理方法、装置、设备及计算机可读存储介质
Galal et al. Trustee: full privacy preserving vickrey auction on top of ethereum
JP2022536645A (ja) 暗号化された秘密シェアを使用した鍵の回復
US20150229619A1 (en) Trusted execution within a distributed computing system
CN109214201B (zh) 一种数据共享方法、终端设备及计算机可读存储介质
EP1984890A2 (en) A point-of-sale terminal transaction using mutating identifiers
WO2015094245A1 (en) Technologies for collecting advertising statistics in a privacy sensitive manner
CN109921905B (zh) 基于私钥池的抗量子计算密钥协商方法和系统
US11431489B2 (en) Encryption processing system and encryption processing method
TW201901584A (zh) 具多重密鑰的kyc資料標記之爭議救濟系統及其方法
WO2021134897A1 (zh) 区块链供应链交易隐藏动态监管系统及方法
US20230259926A1 (en) Address generation method, blockchain information processing method, and related device
WO2022221333A1 (en) Blockchain-based private reviews
CN109660344A (zh) 基于非对称密钥池路由装置的抗量子计算区块链交易方法和系统
WO2023241142A1 (zh) 一种数据处理方法及装置、存储介质及电子设备
CN114514550A (zh) 将请求分区成区块链的交易
Gou et al. A novel quantum E-payment protocol based on blockchain
CN110677253A (zh) 基于非对称密钥池和ecc的抗量子计算rfid认证方法及系统
CN115599959A (zh) 数据共享方法、装置、设备及存储介质
US7979712B2 (en) Network system, server and information terminal for list matching
TWI701931B (zh) 具分級機制的數位簽章方法及適用該方法的硬體錢包裝置
CN112199695A (zh) 应收账款融资的处理方法、装置、电子装置和存储介质

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: 21885245

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021885245

Country of ref document: EP

Effective date: 20230418

NENP Non-entry into the national phase

Ref country code: DE