Digital currency transaction method, device, digital currency transaction system and storage medium

The derivation of child keys from parent keys in digital currency transactions addresses the challenge of securely managing multiple accounts, enhancing security and efficiency by avoiding private key reuse.

CN112184216BActive Publication Date: 2024-12-10SHENZHEN HUASHU CLOUD COMPUTING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010842054.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-20
Publication Date
2024-12-10
Estimated Expiration
2040-08-20

AI Technical Summary

Technical Problem

Existing digital currency transaction systems face challenges in securely managing multiple accounts with electronic wallets, leading to user burden and potential security risks due to the reuse of private keys.

Method used

A method involving the derivation of child private and public keys from parent keys using hashing and random codes, allowing secure transactions without exposing the root private key, enabling a single electronic wallet to manage multiple accounts.

Benefits of technology

Enhances security and reduces the burden on users by allowing a single electronic wallet to manage multiple accounts without reusing private keys, thereby improving transaction security and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112184216B_ABST
    Figure CN112184216B_ABST
Patent Text Reader

Abstract

The present invention discloses a digital currency transaction method, device, digital currency transaction system and storage medium. The digital currency transaction method includes the steps of determining a child private key according to a parent private key, signing digital currency according to the child private key, sending a transaction body and a parent public key to a second computer device, etc. The second computer device is used to determine the child public key according to the parent public key, etc., and verify the transaction body according to the child public key. The present invention derives keys by determining the child private key according to the parent private key and the child public key according to the parent public key. When a new public key is needed to manage and mark currency ownership, the new child public key can be directly determined by the parent public key. When the child private key is needed, the new child private key can be determined according to the parent private key, so that a private key is not reused, the security of digital currency transactions is improved, and the same electronic wallet can manage multiple digital currency accounts. The present invention is widely used in the field of digital currency technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of digital currency technology, and in particular to a digital currency transaction method, device, digital currency transaction system and storage medium. Background Art

[0002] Digital currency is a new type of currency that can be equivalent to existing circulating currency. Digital currency issuers issue encrypted strings, which can represent real currency with denominations as digital currency. Users can actually store and manage these digital currencies in electronic wallets. Digital currency issuers can operate digital currency registration centers to record the ownership conversion relationship of digital currency during the circulation process. The digital currency registration center uses strings associated with public keys to mark the ownership of currency. When using currency, users need to use their own private keys to sign transactions. The digital currency registration center will verify the transaction itself based on the currency number and the corresponding public key. After determining the identity of the currency owner, the currency ownership will be converted and the corresponding currency ownership will be marked as a new public key. In essence, the transaction payment process of digital currency is the process of transferring currency ownership.

[0003] An electronic wallet is essentially a cryptographic hardware. By utilizing the characteristics of an electronic wallet, it can store and manage the user's private key with high security. Since electronic wallets have strict management of private keys, it is difficult to use the same electronic wallet to manage a large number of accounts. Users often need to handle a large number of electronic wallets, which creates a great burden on users. Summary of the invention

[0004] In response to at least one of the above technical problems, an object of the present invention is to provide a digital currency transaction method, device, digital currency transaction system and storage medium.

[0005] In one aspect, an embodiment of the present invention includes a digital currency transaction method, comprising:

[0006] Obtain a first code, a first random code and a parent private key;

[0007] Determine a child private key according to the first code, the first random code and the parent private key;

[0008] The digital currency to be traded is signed according to the sub-private key; the result of the signature is to obtain the transaction body;

[0009] Obtain the second code, the second random code and the parent public key;

[0010] The transaction body, the second code, the second random code and the parent public key are sent to a second computer device; the second computer device is used to determine the child public key according to the second code, the second random code and the parent public key, and verify the transaction body according to the child public key.

[0011] Further, determining the child private key according to the first code, the first random code and the parent private key includes:

[0012] Concatenate the first code, the first random code, and the parent private key and perform hashing to determine a first hash value;

[0013] The sum of the high byte portion of the first hash value and the parent private key is determined as the child private key, and the low byte portion of the first hash value is determined as a third random code that matches the child private key; or the low byte portion of the first hash value is determined as the child private key, and the sum of the high byte portion of the first hash value and the parent private key is determined as a third random code that matches the child private key.

[0014] Further, determining the child public key according to the second code, the second random code and the parent public key includes:

[0015] Concatenate the second code, the second random code and the parent public key and perform hashing to determine a second hash value;

[0016] Determine an additional generator; the additional generator is the product of the high byte portion of the second hash value and the generator of the elliptic curve;

[0017] Determine the sum of the additional generator and the parent public key as the child public key;

[0018] A low byte portion of the second hash value is determined as a fourth random code that matches the sub-public key.

[0019] Furthermore, the parent private key is determined based on the root private key, and the parent public key is determined based on the root public key.

[0020] Further, the root private key and the root public key are determined according to the following steps:

[0021] Get the fifth random code;

[0022] Hash the fifth random code to determine a third hash value;

[0023] Determine the high byte portion of the third hash value as the root private key, and determine the low byte portion of the third hash value as the sixth random code matching the root private key; or determine the low byte portion of the third hash value as the root private key, and determine the high byte portion of the third hash value as the sixth random code matching the root private key;

[0024] The root public key is determined as a product of the root private key and a generator of an elliptic curve.

[0025] Furthermore, the digital currency transaction method also includes:

[0026] When the transaction entity passes the verification, a registration request is sent to the digital currency transaction registration system.

[0027] Furthermore, the second computer device is also used to send a registration request to the digital currency transaction registration system when the transaction entity passes the verification.

[0028] On the other hand, an embodiment of the present invention further includes a first computer device, including a memory and a processor, wherein the memory is used to store at least one program, and the processor is used to load the at least one program to execute the method described in the embodiment.

[0029] On the other hand, an embodiment of the present invention further includes a digital currency trading system, including:

[0030] Digital currency transaction registration system;

[0031] The first computer device and the second computer device of the embodiment;

[0032] The digital currency transaction registration system is connected to the first computer device and the second computer device respectively, and the first computer device is connected to the second computer device.

[0033] On the other hand, an embodiment of the present invention further includes a storage medium storing a program executable by a processor, wherein the program executable by the processor is used to execute the method described in the embodiment when executed by the processor.

[0034] The beneficial effects of the present invention are as follows: the present invention derives keys by determining child private keys according to parent private keys and determining child public keys according to parent public keys, wherein the root private key can be used as the most original parent private key and the root public key can be used as the most original parent public key. When a new public key is needed to manage and mark currency ownership, there is no need to access the root private key, and the new child public key can be directly determined by encoding the parent public key and the child public key to be derived. When the child private key is needed, the new child private key can be determined according to the parent private key and the encoding of the child private key to be derived. In this way, a private key will not be reused, thereby improving the security of digital currency transactions and allowing the same electronic wallet to manage more than one digital currency account. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is a structural diagram of the digital currency trading system in the embodiment;

[0036] Figure 2 Flow chart of the digital currency transaction method in the embodiment. DETAILED DESCRIPTION

[0037] In this embodiment, the digital currency transaction method can be executed by a digital currency transaction system. The structure of the digital currency transaction system is as follows: Figure 1 As shown, it includes a digital currency transaction registration system, a first computer device and a second computer device. The digital currency transaction registration system can be operated by a digital currency issuing institution such as a central bank. Specifically, the digital currency transaction registration system can be a server. The first computer device and the second computer device can be devices such as mobile phones or tablet computers, which can be called electronic wallets or hardware wallets. The first computer device and the second computer device are held by different users respectively.

[0038] In this embodiment, the first computer device and the digital currency transaction registration system, and the second computer device and the digital currency transaction registration system are connected through the Internet, and the first computer device and the second computer device can be connected through the Internet, NFC or WiFi.

[0039] In this embodiment, a digital currency transaction between the holder of the first computer device and the holder of the second computer device is used as an example for explanation, wherein the first computer device is the payer of the digital currency, which can also be called the sender of the digital currency, and the second computer device is the receiver of the digital currency.

[0040] In this embodiment, refer to Figure 2 , the digital currency transaction method includes the following steps:

[0041] S1. Obtain the first code, the first random code and the parent private key;

[0042] S2. Determine the child private key according to the first code, the first random code and the parent private key;

[0043] S3. Sign the digital currency to be traded according to the sub-private key, wherein the result of the signature is to obtain the transaction body;

[0044] S4. Obtain the second code, the second random code and the parent public key;

[0045] S5. Send the transaction body, the second code, the second random code and the parent public key to the second computer device.

[0046] In this embodiment, steps S1-S5 are executed by the first computer device.

[0047] When executing step S1, the first computer device uses the ID of the sub-private key to be generated as the first code i1, and obtains the first random code c p1 and the parent private key x p1 , where the first random code c p1 Can be generated by a random number generation algorithm, the parent private key x p1 The root private key x may be stored by the first computer device r generate.

[0048] In this embodiment, the algorithm is designed so that the generated root private key x r is 32 bytes, based on the root private key x r Generated parent private key x p1 Also 32 bytes.

[0049] When executing step S2, the first computer device may execute the following sub-steps:

[0050] S201. The first code i1 and the first random code c p1 and the parent private key x p1 After linking, hashing is performed to determine the first hash value;

[0051] S202. Compare the high byte portion of the first hash value with the parent private key x p1 The sum is determined as the child private key;

[0052] S203. Determine the low byte portion of the first hash value as a third random code that matches the sub-private key.

[0053] In this embodiment, the output length of the hash algorithm used is the input parent private key x p1 Twice the length, for example, if the parent private key is x p1The length is 32 bytes, then SHA512 with an output length of 64 bytes can be used as the hash function in this embodiment. The steps in this embodiment are described by taking Secp256k1 in the ECDSA algorithm as an example, and the hash function used is SHA512, which can be represented by H().

[0054] The linking and hashing performed in step S201 can be expressed by the formula l1=H(X p1 ||c p1 ||i1). The first hash value l1 obtained can be divided into the high byte part l 1R and the low byte part l 1L , where the high byte part is l 1R The high 32 bytes of the first hash value l1, the low byte part l 1L The lower 32 bytes of the first hash value l1.

[0055] In step S202, the high byte portion l of the first hash value l1 is 1R With the parent private key x p1 The sum is determined as the child private key x i1 , that is, x i1 = l 1R +X p1 .

[0056] In step S203, the low byte portion l of the first hash value l1 is 1L Determine the child private key x i1 Matching third random code c i1 . Child private key x i1 and the third random code c i1 It can be expressed as (x i1 ,c i1 ), that is, (x i1 ,c i1 ) can be used as a 64-byte data unit.

[0057] In this embodiment, the contents of steps S202 and S203 can be interchanged, that is, the low-byte portion of the first hash value can be determined as the child private key, and the sum of the high-byte portion of the first hash value and the parent private key can be determined as the third random code matching the child private key, which can achieve the same technical effect.

[0058] In this embodiment, according to the root private key x r Generate parent private key x p1 The principle is similar to steps S201-S203, that is, the encoding, random code and root private key x r After linking, hash it, determine the hash value, and compare the high byte portion of the hash value with the root private key x r The sum determines the parent private key xp1 , the low byte portion of the hash value is determined to be the same as the parent private key x p1 Matching random code.

[0059] When executing step S3, the first computer device determines the digital currency to be traded from the digital currency list stored in the first computer device or other storage device, and uses the child private key x i The digital currency to be traded is signed. For the first computer device, the digital currency to be traded is the digital currency to be paid. The result of the signature is to obtain the transaction body.

[0060] When executing step S4, the first computer device uses the ID of the sub-public key to be generated as the second code i2, and obtains the second random code c p2 and the parent public key X p2 , where the first random code c p2 Can be generated by a random number generation algorithm, parent public key X p2 It can be generated from the root public key Y stored in the first computer device.

[0061] In this embodiment, the first computer may perform the following steps to determine the root private key x in step S1: r And the root public key Y in step S4:

[0062] P1. Obtain a fifth random code r having a length of 32 bytes. In this embodiment, the fifth random code r may also be referred to as a random number seed;

[0063] P2. Hash the fifth random code r to determine a third hash value l3, ie, l3 = H(r), where the third hash value l3 is 64 bytes of data;

[0064] P3. Determine the high byte portion of the third hash value l3, i.e., the high 32 bytes, as the root private key x r ;

[0065] P4. The low byte portion of the third hash value l3, i.e., the low 32 bytes, is determined to be the same as the root private key x r Matching sixth random code c r ; Root private key x r and the sixth random code c r It can be expressed as (x r ,c r ), that is, (x r ,c r ) can be used as a 64-byte data unit.

[0066] P5. The root private key x r The product x with the generator G of the elliptic curve r G is determined to be the root public key Y, that is, Y = xr G.

[0067] In this embodiment, the parent public key X is generated based on the root public key Y. p2 The principle is similar to steps S201-S203, that is, the code, random code and root public key Y are linked and hashed to determine the hash value, and the high byte part of the hash value and the root public key Y are summed to determine the parent public key X p2 The low byte portion of the hash value is determined to be the same as the parent public key X p2 Matching random code.

[0068] In some scenarios, the second code i2 may be the same as the first code i1, and the second random code c p2 Can be combined with the first random code c p1 The same, that is, i2 = i1, c p2 =c p1 .

[0069] In this embodiment, the contents of steps P3 and P4 can be interchanged, that is, the low byte part of the third hash value can be determined as the root private key, and the high byte part of the third hash value can be determined as the sixth random code matching the root private key, which can achieve the same technical effect.

[0070] When executing step S5, the first computer converts the transaction body, the second code i2, and the second random code c p2 and the parent public key X p2 The data is sent to the second computer device.

[0071] The second computer device, as the recipient of the digital currency, receives the transaction body, the second code i2, and the second random code c sent by the first computer device. p2 and the parent public key X p2 After that, perform the following steps:

[0072] A1. The second code i2 and the second random code c p2 and the parent public key X p2 After linking, hashing is performed to determine the second hash value;

[0073] A2. Determine an additional generator; the additional generator is the product of the high byte portion of the second hash value and the generator of the elliptic curve;

[0074] A3. Determine the sum of the additional generator and the parent public key as the child public key;

[0075] A4. Determine the low byte portion of the second hash value as a fourth random code that matches the sub-public key.

[0076] The linking and hashing performed in step A1 can be expressed by the formula l2=H(X p2 cp2 i2). The obtained second hash value l2 can be divided into a high byte part l 2R and the low byte part l 2L , where the high byte part is l 2R The high 32 bytes of the second hash value l2, the low byte part l 2L The lower 32 bytes of the second hash value l2.

[0077] In step A2, the high byte portion of the second hash value is 2R The product l with the generator G of the elliptic curve 2R G is determined as an additional generator.

[0078] In step A3, the additional generator l 2R G and parent public key X p2 The sum is determined as the sub-public key x i2 , that is, x i2 =X p2 +l 2R G.

[0079] In step A4, the low byte portion l of the second hash value is 2L Determined to be the child public key x i2 Matching fourth random code c i2 . Child public key x i2 and the fourth random code c i2 It can be expressed as (x i2 ,c i2 ), that is, (x i2 ,c i2 ) can be used as a 64-byte data unit.

[0080] In this embodiment, the second computer device does not need to generate a sub-private key during the process of executing steps A1-A4, which means that the first computer device does not need to provide the sub-private key to the second computer device, thereby avoiding the leakage of the sub-private key and improving the security of the transaction.

[0081] In this embodiment, the second computer device, as the recipient of the digital currency, obtains the child public key x i2 Then, use the child public key x i2Verify the transaction body. The results of the verification include verification passed and verification failed. In the case of verification failed, the transaction of the digital currency is terminated, that is, the ownership of the digital currency is not changed, which is equivalent to the first computer device not paying the digital currency and the first computer device not receiving the digital currency. In the case of verification passed, the second computer device can send a registration request to the digital currency transaction registration system, or the second computer device can feed back the information used to indicate the verification passed to the first computer device, and the first computer device can send a registration request to the digital currency transaction registration system, so that the digital currency transaction registration system registers the transaction of the digital currency, realizes the transfer of ownership of the digital currency, and completes the transaction of the digital currency.

[0082] In this embodiment, a storage medium stores a program executable by a processor. When the program executable by the processor is executed by the processor, it is used to execute the digital currency transaction method in the embodiment to achieve the same technical effect as described in the embodiment.

[0083] It should be noted that, unless otherwise specified, when a feature is referred to as "fixed" or "connected" to another feature, it may be directly fixed or connected to another feature, or it may be indirectly fixed or connected to another feature. In addition, the descriptions of up, down, left, right, etc. used in this disclosure are only relative to the relative positional relationship of the components of the present disclosure in the accompanying drawings. The singular forms of "a", "said" and "the" used in this disclosure are also intended to include the plural forms, unless the context clearly indicates other meanings. In addition, unless otherwise defined, all technical and scientific terms used in this embodiment have the same meaning as those generally understood by technicians in this technical field. The terms used in the specification of this embodiment are only for describing specific embodiments, not for limiting the present invention. The term "and / or" used in this embodiment includes any combination of one or more related listed items.

[0084] It should be understood that, although the term first, second, third etc. may be adopted to describe various elements in the present disclosure, these elements should not be limited to these terms. These terms are only used to distinguish the same type of elements from each other. For example, without departing from the scope of the present disclosure, the first element may also be referred to as the second element, and similarly, the second element may also be referred to as the first element. The use of any and all examples or exemplary language ("for example", "such as" etc.) provided by the present embodiment is only intended to better illustrate embodiments of the present invention, and unless otherwise required, the scope of the present invention will not be limited.

[0085] It should be appreciated that embodiments of the present invention may be implemented or enforced by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable memory. The method may be implemented in a computer program using standard programming techniques - including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium so configured causes the computer to operate in a specific and predefined manner - according to the methods and drawings described in the specific embodiments. Each program may be implemented in a high-level procedural or object-oriented programming language to communicate with a computer system. However, if desired, the program may be implemented in an assembly or machine language. In any case, the language may be a compiled or interpreted language. In addition, the program may be run on a programmed ASIC for this purpose.

[0086] In addition, the operations of the process described in this embodiment may be performed in any suitable order, unless otherwise indicated in this embodiment or otherwise clearly contradicted by the context. The process described in this embodiment (or variations and / or combinations thereof) may be performed under the control of one or more computer systems configured with executable instructions, and may be implemented as a code (e.g., executable instructions, one or more computer programs, or one or more applications) executed jointly on one or more processors, by hardware or a combination thereof. The computer program includes a plurality of instructions that may be executed by one or more processors.

[0087] Further, the method can be implemented in any type of computing platform that is operably connected to a suitable computer, including but not limited to a personal computer, a minicomputer, a mainframe, a workstation, a network or distributed computing environment, a separate or integrated computer platform, or in communication with a charged particle tool or other imaging device, etc. Various aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, an optical read and / or write storage medium, a RAM, a ROM, etc., so that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the process described herein. In addition, the machine-readable code, or a portion thereof, can be transmitted via a wired or wireless network. When such media includes instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor, the invention described in this embodiment includes these and other different types of non-transitory computer-readable storage media. When programmed according to the methods and techniques of the present invention, the present invention also includes the computer itself.

[0088] The computer program can be applied to input data to perform the functions described in the present embodiment, thereby converting the input data to generate output data stored in a non-volatile memory. The output information can also be applied to one or more output devices such as a display. In a preferred embodiment of the present invention, the converted data represents a physical and tangible object, including a specific visual depiction of the physical and tangible object produced on the display.

[0089] The above is only a preferred embodiment of the present invention. The present invention is not limited to the above implementation. As long as the technical effect of the present invention is achieved by the same means, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of protection of the present invention. Within the scope of protection of the present invention, its technical scheme and / or implementation method may have various modifications and changes.

Claims

1. A digital currency transaction method, It is characterized in that include: Obtain a first code, a first random code and a parent private key; the first code is the ID of the child private key to be generated; Determine a child private key according to the first code, the first random code and the parent private key; The digital currency to be traded is signed according to the sub-private key; the result of the signature is to obtain the transaction body; Obtain a second code, a second random code and a parent public key; the second code is the ID of the child public key to be generated; Sending the transaction body, the second code, the second random code and the parent public key to a second computer device; the second computer device is used to determine a child public key according to the second code, the second random code and the parent public key, and verify the transaction body according to the child public key; The determining the child private key according to the first code, the first random code and the parent private key includes: Concatenate the first code, the first random code, and the parent private key and perform hashing to determine a first hash value; The sum of the high byte portion of the first hash value and the parent private key is determined as the child private key, and the low byte portion of the first hash value is determined as a third random code that matches the child private key; or the low byte portion of the first hash value is determined as the child private key, and the sum of the high byte portion of the first hash value and the parent private key is determined as a third random code that matches the child private key.

2. The digital currency transaction method according to claim 1, It is characterized in that The determining of the child public key according to the second code, the second random code and the parent public key comprises: Concatenate the second code, the second random code and the parent public key and perform hashing to determine a second hash value; Determine an additional generator; the additional generator is the product of the high byte portion of the second hash value and the generator of the elliptic curve; Determine the sum of the additional generator and the parent public key as the child public key; A low byte portion of the second hash value is determined as a fourth random code that matches the sub-public key.

3. The digital currency transaction method according to claim 1, It is characterized in that The parent private key is determined based on the root private key, and the parent public key is determined based on the root public key.

4. The digital currency transaction method according to claim 3, It is characterized in that The root private key and the root public key are determined according to the following steps: Get the fifth random code; Hash the fifth random code to determine a third hash value; Determine the high byte portion of the third hash value as the root private key, and determine the low byte portion of the third hash value as the sixth random code matching the root private key; or determine the low byte portion of the third hash value as the root private key, and determine the high byte portion of the third hash value as the sixth random code matching the root private key; The root public key is determined as a product of the root private key and a generator of an elliptic curve.

5. The digital currency transaction method according to any one of claims 1 to 4, It is characterized in that Also includes: When the transaction entity passes the verification, a registration request is sent to the digital currency transaction registration system.

6. A digital currency transaction method according to any one of claims 1 to 4, It is characterized in that The second computer device is also used to send a registration request to the digital currency transaction registration system when the transaction entity passes the verification.

7. a first computer device, It is characterized in that The method comprises a memory and a processor, wherein the memory is used to store at least one program, and the processor is used to load the at least one program to execute the method according to any one of claims 1 to 6.

8. A digital currency trading system, It is characterized in that include: Digital currency transaction registration system; The first computer device of claim 7; The second computer device in the digital currency transaction method according to any one of claims 1 to 6; The digital currency transaction registration system is connected to the first computer device and the second computer device respectively, and the first computer device is connected to the second computer device.

9. A storage medium storing a program executable by a processor, It is characterized in that The processor-executable program is used to perform the method according to any one of claims 1 to 6 when executed by the processor.