A blockchain evidence storage method for real-time uploading of transaction information

Through the blockchain certificate storage method of real-time uploading of transaction information, and the use of blockchain technology to verify transaction data, the risk of disagreements and tampering in the performance of electronic contracts is solved, and the credibility of both parties to the contract is guaranteed and transaction security is achieved.

CN114219489BActive Publication Date: 2024-09-17COSCO SHIPPING TECH CO LTD +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111607122.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-24
Publication Date
2024-09-17
Estimated Expiration
2041-12-24

AI Technical Summary

Technical Problem

Electronic contracts are prone to disagreements during contract performance, and there are risks of malicious tampering and denial, leading to improper performance or refusal to perform the contract.

Method used

Adopt the blockchain certificate storage method of real-time uploading of transaction information, and verify the address information and timestamp of the payer and payee through blockchain technology to ensure the non-tamperability and credibility of the transaction data and realize the multi-round transaction information Deposit and payment confirmation.

Benefits of technology

It provides a credible transaction contract model to ensure the security and transparency of cooperation between both parties to the contract, reduces the risk of malicious denial and tampering, and improves the reliability and efficiency of transactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114219489B
    Figure CN114219489B
Patent Text Reader

Abstract

The present invention provides a blockchain evidence storage method for uploading transaction information in real time. The method consists of four stages: the first stage, verification, in which the verification between the payer P and the payee S is completed with the assistance of people; the second stage, evidence storage, in which the payer P obtains legal permission and starts the evidence storage process; the third stage, legal procedure, establishes the legal procedure for evidence storage; the fourth stage, payment and evidence storage feedback, completes the payment operation and evidence storage feedback. The present invention designs a transaction information evidence storage scheme that provides address information and timestamps, and allows multiple rounds of evidence storage within the effective time of the session key.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and specifically to a blockchain evidence storage method for uploading transaction information in real time. Background Art

[0002] In today's social life, the payment methods in online transactions are mature, convenient and highly secure, which not only greatly facilitates the daily life of ordinary people, but also brings business transactions between companies online. Business transactions between companies are usually based on contracts, and online transaction contract signing through the Internet, fax and other means is a convenient means, and companies that are geographically far apart can also quickly conduct business exchanges. However, this kind of electronic contract is prone to disagreements when performing the contract, because the electronic contract itself is extremely easy to copy and tamper with; at the same time, there may be a party who maliciously denies that it will perform based on the tampered contract in order to seek improper benefits or refuse to perform the contract. This has become a technical problem that urgently needs to be solved. Summary of the invention

[0003] In order to solve the above technical problems, the present invention provides a blockchain evidence storage method for uploading transaction information in real time. In the technical solution of the present invention, by using blockchain technology to upload data that is usually difficult to obtain as evidence data to the blockchain, it can be helpful when conducting judicial procedures. Therefore, applying blockchain technology to electronic contracts can bring reliable guarantees for the cooperation between the two parties to the contract. The present invention is a simplified transaction contract model for buyers and sellers, and designs a data evidence storage solution suitable for multiple rounds of transaction information on the chain.

[0004] The technical solution adopted by the present invention is as follows:

[0005] A blockchain evidence storage method for uploading transaction information in real time, the method comprising the following steps:

[0006] Step 1: The payer P and the payee S verify each other based on address information and timestamp;

[0007] Step 2: If the mutual verification is successful, the evidence storage process is started, and it is determined whether a verification success receipt is received from the payee S; if the verification success receipt is received, it indicates that the evidence storage process is successfully started, and step 3 is continued; if the verification success receipt is not received, the start of the evidence storage process is terminated;

[0008] Step 3: During the validity period of the session key LK between the payer P and the payee S, execute the evidence establishment procedure i times, where i represents the number of rounds;

[0009] Step 4: If the hash value H of the payee S i Once it is deposited into blockchain B, the payment operation and evidence feedback are completed.

[0010] Furthermore, in step 1, the mutual verification on the payer P side includes the following sub-steps:

[0011] Step P01: Generate a random number R using a random number generator P ;

[0012] Step P02: Calculate U P =R P +SK P , where SK P Indicates the private key of the payer P, U P represents the sum of the numbers at the payee P;

[0013] Step P03, calculate T P =U P ×G, where T P Indicates U P A point on the elliptic curve obtained after scalar multiplication, G represents the base point of the elliptic curve EC;

[0014] Step P04: Generate a random number N using a random number generator P ;

[0015] Step P05: Calculate W using the 128-bit hash summary code function HMAC P =HMAC 128 (N P , ID P ||PK P ||T P ), where W P Indicates message verification code, ID P Indicates the identifier of the payer P, PK P Indicates the public key of the payer P, N P Represents a random number;

[0016] Step P06: Use the common channel to send the message M1 = {ID P , PK P , T P , W P}Send to the payee S;

[0017] Step P07: Receive the message M2 from the payee S via the normal channel = {ID S , PK S , U S , N S1 ,Time S , Loc S}, where ID S Indicates the ID of the payee S, PK S represents the public key of the payee S, US Indicates the sum of the numbers at the recipient's place, N S1 Indicates random number, Time S Indicates the current timestamp of the payee S, Loc S Indicates the current address information of the payee S;

[0018] Step P08: Get the current address information Loc of the payer P P , and obtain the current timestamp Time of the payer P from the National Time Service Center NTSC P ;

[0019] Step P09: Use the common channel to send the message M3={N P ,Time P , Loc P}Send to the payee S;

[0020] Step P10: Calculate using 16-bit hash summary code function HMAC Where D P Indicates a 16-digit short message verification code;

[0021] Step P11: D P Convert it to decimal and display it. The user compares it with the D displayed by the payer P. P D shown at the recipient S S Are they equal? ​​If not, the mutual authentication fails and the process ends; if they are equal, continue to step P12;

[0022] Step P12: Calculate the temporary key Temp=R P ×(U S ×G-PK S )=R P ×R S ×G;

[0023] Step P13: Calculate LK using the 128-bit hash digest code function HMAC P =HMAC 128 (Temp, M1||M2||M3).

[0024] Furthermore, in step 1, the mutual verification on the payee S side includes the following sub-steps:

[0025] Step S01: Receive the message M1={ID P , PK P , T P , W P};

[0026] Step S02: Generate a random number R using a random number generator S ;

[0027] Step S03: Calculate U S =R S +SK S , where SK S Represents the private key of the payee S;

[0028] Step S04: Generate a random number N using a random number generator S1 ;

[0029] Step S05: Get the current address information Loc of the payee S S , and obtain the current timestamp Time of the payee S from the National Time Service Center NTSC S ;

[0030] Step S06: Use the common channel to send the message M2={ID S , PK S , U S , N S1 ,Time S , Loc S}Send to payer P;

[0031] Step S07: Receive the message M3={N P ,Time P , Loc P};

[0032] Step S08: Calculate W using the 128-bit hash summary code function HMAC P1 =HMAC 128 (N P , ID P ||PK P ||T P ), where W P1 represents the message verification code calculated by the payee S;

[0033] Step S09: Verify W P1 Is it equal to W? P If they are not equal, the mutual authentication fails and the process ends; if they are equal, continue to step S10;

[0034] Step S10: Calculate using 16-bit hash summary code function HMAC Where D S Indicates a 16-digit short message verification code;

[0035] Step S11: DS Convert it to decimal and display it. The user compares it with the D displayed by the payer P. P D shown at the recipient S S Are they equal? ​​If not, the mutual authentication fails and the process ends; if they are equal, continue to step S12;

[0036] Step S12: Calculate Temp = R S ×(T P -PK P )=R P ×R S ×G;

[0037] Step S13: Calculate the session key LK S =HMAC 128 (Temp, M1||M2||M3).

[0038] Furthermore, in step 2, the process of starting the evidence storage includes the following sub-steps on the payer P side:

[0039] Step P01: Use the SSL channel to send the fourth message M4 to blockchain B; where M4 = {ID P , ID S , N P , N S1 ,Time S , Loc S ,Time P , Loc P}, ID P Indicates the identifier or ID of the payer P S Indicates the ID of the payee S, N S1 and N P Indicates random number, Time s Indicates the current timestamp and Loc of the payee S S Indicates the current address information and Time of the payee S P Indicates the current timestamp of the payer P, Loc P Indicates the current address information of the payer P;

[0040] Step P02: Receive the message M5={Licence} sent by blockchain B through the SSL channel and obtain the digital signature License;

[0041] Step P03: Use a common channel to send a message M6 = {'Begin', Licence} to the payee S, where 'Begin' indicates a start instruction.

[0042] Furthermore, in step 2, the process of starting the evidence storage includes the following sub-steps on the payee S side:

[0043] Step S01, receiving the message M6={'Begin', Licence} sent by the payer P through the common channel, and obtaining the digital signature Licence;

[0044] Step S02: Use the public key PK of blockchain B B Signature verification algorithm Verify the digital signature License. If the verification fails, the evidence storage process ends; if the verification succeeds, a successful verification receipt is returned.

[0045] Furthermore, in step 2, the process of starting the evidence storage includes the following sub-steps on the blockchain B side:

[0046] Step B01: Receive message M4 sent by payer P via SSL channel; where M4 = {ID P , ID S , N P , N S1 ,Time S , Loc S ,Time P , Loc P};

[0047] Step B02: Get the timestamp Time from the National Time Service Center NTSC B ;

[0048] Step B03: Verify the inequality Time U <Time P <Time B Is it true? If not, the evidence storage process ends; if true, it means that the timestamp meets Time U Earlier than Time P and Time P Earlier than Time B If the condition is met, then continue to execute step B04;

[0049] Step B04: Use the private key SK of blockchain B B The signature algorithm used to calculate the digital signature Where N B Represents a random number;

[0050] Step B05: Use the SSL channel to send the message M5 = {Licence} to the payer P.

[0051] Furthermore, in step 3, the procedure for establishing the evidence storage includes the following sub-steps on the payer P side:

[0052] Step P01: Receive a message M from the payee S through a common channel a , and from the message M a Get a random number N Si and timestampTime Si ;

[0053] Step P02, get the current address information Loc Pi , and obtain the timestamp Time from the National Time Service Center NTSC Pi ;

[0054] Step P03, use the 128-bit hash summary code function HMAC to calculate Res i =HMAC 128 (LK P , N Si );Res i Indicates the message verification code, LK P Represents the session key of the payer P;

[0055] Step P04: Use the normal channel to send the message M b ={File i ,Time Pi , Loc Pi ,Res i}Send to the payee S, File i Indicates the file data generated by this round.

[0056] Furthermore, in step 3, the procedure for establishing the evidence storage includes the following sub-steps on the payee S side:

[0057] Step S01: Generate a random number N using a random number generator Si ;

[0058] Step S02: Get the timestamp Time from the National Time Service Center NTSC Si ;

[0059] Step S03: Use a common channel to send the message M a = {N Si ,Time Si}Send to payer P;

[0060] Step S04: Receive message M sent by payer P via the normal channel b ={File i ,Time Pi , Loc Pi ,Res i};

[0061] Step S05: Calculate Res′ using the hash summary code function HMACi =HMAC 128 (LK S , N Si ), where Res′ i Indicates the message verification code, LK S Represents the session key of the payee S;

[0062] Step S06: Verify Res i ′Whether it is the same as Res i If they are not equal, then the evidence establishment procedure is terminated; if they are equal, then the step S07 is continued;

[0063] Step S07: Get the timestamp Time from the National Time Service Center NTSC Si ;

[0064] Step S08: Calculate the hash value H i ;

[0065] Among them, H i =Hash(ID P , ID S ,Time Si , Loc S ,Time Pi , Loc Pi , File i ); ID P Indicates the ID of the payer P. S Indicates the identifier of the payee S, Loc S Indicates the current address information of the payee S;

[0066] Step S09: Use the SSL channel to send the message M c ={H i}Sent to blockchain B.

[0067] Furthermore, in step 3, the procedure for establishing the evidence storage includes the following sub-steps on the blockchain B side:

[0068] Step B01: Receive message M from payee S via SSL channel C , get the hash value H i ;

[0069] Step B02: Hash value H i Deposit into blockchain B.

[0070] Furthermore, in step 4, the completion of the payment operation and the evidence feedback on the payer P side includes the following sub-steps:

[0071] Step P01: Receive a message from the payee S via the normal channel Where N S2 Represents a random number, indicates ciphertext, Bill indicates bill; mac S Indicates the message verification code;

[0072] Step P02: Calculate using 128-bit hash summary code function HMAC where mac′ S Indicates the message verification code, LK P Represents the session key of the payer P;

[0073] Step P03, verify mac′ S Whether and Mac S If they are not equal, the payment operation and evidence feedback process are terminated; if they are equal, continue to step P04;

[0074] Step P04: Use the private key SK of the payer P P The signature algorithm used to calculate the digital signature Where N S2 Indicates random number, ID P Indicates the identifier or ID of the payer P S It indicates the ID of the payee S, and Licence indicates the digital signature;

[0075] Step P05: Use the common channel to send the message M8=Confirm to the payee S;

[0076] The completion of the payment operation and the evidence feedback on the payee S side includes the following sub-steps:

[0077] Step S01: Generate a random number N using a random number generator S2 ;

[0078] Step S02: Calculate the bill generated by the transaction;

[0079] Step S03: Calculate Enc LKS (Bill);

[0080] Step S04: Calculate using 128-bit hash summary code function HMAC

[0081] Step S05: Use a common channel to send the message Send to payer P;

[0082] Step S06: Receive the message M8 sent by the payer P through the ordinary channel and obtain the digital signature Confirm;

[0083] Step S07: Use the signature verification algorithm of the public key PKB of the payer P Verify the digital signature Confirm. If the verification fails, the payment operation and evidence feedback process ends; if the verification succeeds, continue to step S08;

[0084] Step S08: Use the SSL channel to send message M9 to blockchain B;

[0085] Where, M9 = {ID P , ID S ,Licence,Bill,Confirm,N S2}, where N S2 Indicates random number, ID P Indicates the identifier or ID of the payer P S It indicates the identifier of the payee S, Licence and Confirm both indicate digital signatures, and Bill indicates the bill;

[0086] The completion of the payment operation and evidence storage feedback on the blockchain B side includes the following sub-steps:

[0087] Step B01, receiving a message M9 sent from an SSL channel;

[0088] Step B02: Send the evidence storage result to the payer P and the payee S respectively through the SSL channel.

[0089] Through the embodiments of the present application, the following technical effects can be obtained: compared with the prior art, the present invention designs a transaction information notarization scheme that provides address information and timestamps, and allows multiple rounds of notarization within the effective time of the session key. BRIEF DESCRIPTION OF THE DRAWINGS

[0090] In order to more clearly illustrate the technical solutions in the embodiments of the present application, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0091] Figure 1 This is a schematic diagram of the composition structure of the multi-round transaction evidence storage model. DETAILED DESCRIPTION

[0092] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0093] Before describing the technical solution of the present invention in detail, the terminology used in the present invention is first introduced as follows:

[0094] P: payer in the transaction

[0095] S: The recipient of the transaction ( se lle r )

[0096] Assumption: Both P and S have the correct PK B

[0097] B:Blockchain c hai n )

[0098] ID: identity information

[0099] N, R: Random number (nonc e , random number)

[0100] EC: elliptic curve over finite field

[0101] G: base point of elliptic curve EC

[0102] ×: scalar multiplication

[0103] ||: Cascade symbol

[0104] SK: Private key

[0105] PK: Public Key

[0106] Temp: Temporary Secret

[0107] K: Master key

[0108] File: The data file that needs to be stored

[0109] NTSC: National Time Service Center

[0110] SSL: Secure Socket Layer

[0111] Hash: message digest code function

[0112] HMAC: Key-based message authentication code function

[0113] Enc(·): symmetric encryption algorithm, returns a ciphertext

[0114] Dec(·): Symmetric decryption algorithm, returns a plaintext

[0115] Sig(·): signature algorithm, returns a digital signature

[0116] Ver(·): signature verification algorithm, returns a verification result

[0117] Figure 1 The figure is a schematic diagram of the composition structure of a multi-round transaction evidence storage model. The present invention provides a blockchain evidence storage method for uploading transaction information in real time. The method comprises the following steps:

[0118] Step 1: The payer P and the payee S verify each other based on address information and timestamp;

[0119] Step 2: If the mutual verification is successful, the evidence storage process is started, and it is determined whether a verification success receipt is received from the payee S; if the verification success receipt is received, it indicates that the evidence storage process is successfully started, and step 3 is continued; if the verification success receipt is not received, the start of the evidence storage process is terminated;

[0120] Step 3: During the validity period of the session key LK between the payer P and the payee S, execute the evidence establishment procedure i times, where i represents the number of rounds;

[0121] Step 4: If the hash value H of the payee S i Once it is deposited into blockchain B, the payment operation and evidence feedback are completed.

[0122] The proposed method consists of four stages: the first stage, verification, completes the verification between the payer P and the payee S with the assistance of humans; the second stage, evidence, the payer P obtains legal permission and starts the evidence process; the third stage, legal procedures, establishes the legal procedures for evidence; the fourth stage, payment and evidence feedback, completes the payment operation and evidence feedback. Each stage is introduced below.

[0123] Phase 1:

[0124] (1) Payer P’s algorithm:

[0125] Step P01: Generate a random number R using a random number generator P;

[0126] Step P02: Calculate U P =R P +SK P , where SK P Indicates the private key of the payer P, U P represents the sum of the numbers at the payee P;

[0127] Step P03, calculate T P =U P ×G, where T P Indicates U P A point on the elliptic curve obtained after scalar multiplication, G represents the base point of the elliptic curve EC;

[0128] Step P04: Generate a random number N using a random number generator P ;

[0129] Step P05: Calculate W using the 128-bit hash summary code function HMAC P =HMAC 128 (N P , ID P ||PK P ||T P ), where W P Indicates message verification code, ID P Indicates the identifier of the payer P, PK P Indicates the public key of the payer P, N P Represents a random number;

[0130] Step P06: Use the common channel to send the message M1 = {ID P , PK P , T P , W P}Send to the payee S;

[0131] Step P07: Receive the message M2 from the payee S via the normal channel = {ID S , PK S , U S , N S1 ,Time S , Loc S}, where ID S Indicates the ID of the payee S, PK S represents the public key of the payee S, U S Indicates the sum of the numbers at the recipient's place, N S1 Indicates random number, Time S Indicates the current timestamp of the payee S, Loc S Indicates the current address information of the payee S;

[0132] Step P08: Get the current address information Loc of the payer P P , and obtain the current timestamp Time of the payer P from the National Time Service Center NTSC P ;

[0133] Step P09: Use the common channel to send the message M3={N P ,Time P , Loc P}Send to the payee S;

[0134] Step P10: Calculate using 16-bit hash summary code function HMAC Where D P Indicates a 16-digit short message verification code;

[0135] Step P11: D P Convert it to decimal and display it. The user compares it with the D displayed by the payer P. P D shown at the recipient S S Are they equal? ​​If not, the mutual authentication fails and the process ends; if they are equal, continue to step P12;

[0136] Step P12: Calculate the temporary key Temp=R P ×(U S ×G-PK S )=R P ×R S ×G;

[0137] Step P13: Calculate LK using the 128-bit hash digest code function HMAC P =HMAC 128 (Temp, M1||M2||M3).

[0138] (2) The algorithm of the payee S:

[0139] Step S01: Receive the message M1={ID P , PK P , T P , W P};

[0140] Step S02: Generate a random number R using a random number generator S ;

[0141] Step S03: Calculate U S =R S +SK S , where SK SRepresents the private key of the payee S;

[0142] Step S04: Generate a random number N using a random number generator S1 ;

[0143] Step S05: Get the current address information Loc of the payee S S , and obtain the current timestamp Time of the payee S from the National Time Service Center NTSC S ;

[0144] Step S06: Use the common channel to send the message M2={ID S , PK S , U S , N S1 ,Time S , Loc S}Send to payer P;

[0145] Step S07: Receive the message M3={N P ,Time P , Loc P};

[0146] Step S08: Calculate W using the 128-bit hash summary code function HMAC P1 =HMAC 128 (N P , ID P ||PK P ||T P ), where W P1 represents the message verification code calculated by the payee S;

[0147] Step S09: Verify W P1 Is it equal to W? P If they are not equal, the mutual authentication fails and the process ends; if they are equal, continue to step S10;

[0148] Step S10: Calculate using 16-bit hash summary code function HMAC Where D S Indicates a 16-digit short message verification code;

[0149] Step S11: D S Convert it to decimal and display it. The user compares it with the D displayed by the payer P. P D shown at the recipient S S Are they equal? ​​If not, the mutual authentication fails and the process ends; if they are equal, continue to step S12;

[0150] Step S12: Calculate Temp = R S ×(T P -PK P )=R P ×R S ×G;

[0151] Step S13: Calculate the session key LK S =HMAC 128 (Temp, M1||M2||M3).

[0152] Phase 2:

[0153] (1) Payer P’s algorithm:

[0154] Step P01: Use the SSL channel to send the fourth message M4 to blockchain B; where M4 = {ID P , ID s , N P , N S1 ,Time S , Loc S ,Time P , Loc P}, ID P Indicates the identifier or ID of the payer P S Indicates the ID of the payee S, N S1 and N P Indicates random number, Time s Indicates the current timestamp and Loc of the payee S S Indicates the current address information and Time of the payee S P Indicates the current timestamp of the payer P, Loc P Indicates the current address information of the payer P;

[0155] Step P02: Receive the message M5={Licence} sent by blockchain B through the SSL channel and obtain the digital signature License;

[0156] Step P03: Use a common channel to send a message M6 = {'Begin', Licence} to the payee S, where 'Begin' indicates a start instruction.

[0157] (2) The algorithm of the payee S:

[0158] Step S01, receiving the message M6={'Begin', Licence} sent by the payer P through the common channel, and obtaining the digital signature Licence;

[0159] Step S02: Use the public key PK of blockchain B B Signature verification algorithm Verify the digital signature License. If the verification fails, the evidence storage process ends; if the verification succeeds, a verification success receipt is returned.

[0160] (3) Blockchain B-side algorithm:

[0161] Step B01: Receive message M4 sent by payer P via SSL channel; where M4 = {ID P , ID S , N P , N S1 ,Time S , Loc S ,Time P , Loc P};

[0162] Step B02: Get the timestamp Time from the National Time Service Center NTSC B ;

[0163] Step B03: Verify the inequality Time U <Time P <Time B Is it true? If not, the evidence storage process ends; if true, it means that the timestamp meets Time U Earlier than Time P and Time P Earlier than Time B If the condition is met, then continue to execute step B04;

[0164] Step B04: Use the private key SK of blockchain B B The signature algorithm used to calculate the digital signature Where N B Represents a random number;

[0165] Step B05: Send the message M5={Licence} to the payer P using the SSL channel.

[0166] Phase 3:

[0167] Establish the legal procedure for evidence storage. At this stage, there may be multiple rounds of evidence storage, because transactions may be carried out continuously. Multiple similar interaction processes can occur during the validity period of a session key (LK). The following describes one of the rounds of the process, where the subscript i represents the data in each i-th round.

[0168] (1) Payer P’s algorithm:

[0169] Step P01: Receive a message M from the payee S through a common channel a, and from the message M a Get a random number N Si and timestampTime Si ;

[0170] Step P02, get the current address information Loc Pi , and obtain the timestamp Time from the National Time Service Center NTSC Pi ;

[0171] Step P03, use the 128-bit hash summary code function HMAC to calculate Res i =HMAC 128 (LK P , N Si );Res i Indicates the message verification code, LK P Represents the session key of the payer P;

[0172] Step P04: Use the normal channel to send the message M b ={File i ,Time Pi , Loc Pi ,Res i}Send to the payee S, File i Indicates the file data generated by this round.

[0173] (2) The algorithm of the payee S:

[0174] Step S01: Generate a random number N using a random number generator Si ;

[0175] Step S02: Get the timestamp Time from the National Time Service Center NTSC Si ;

[0176] Step S03: Use a common channel to send the message M a = {N Si ,Time Si}Send to payer P;

[0177] Step S04: Receive message M sent by payer P via the normal channel b ={File i ,Time Pi , Loc Pi ,Res i};

[0178] Step S05: Calculate Res′ using the hash summary code function HMAC i =HMAC 128 (LK S , N Si), where Res′ i Indicates the message verification code, LK S Represents the session key of the payee S;

[0179] Step S06: Verify Res i ′Whether it is the same as Res i If they are not equal, then the evidence establishment procedure is terminated; if they are equal, then the step S07 is continued;

[0180] Step S07: Get the timestamp Time from the National Time Service Center NTSC Si ;

[0181] Step S08: Calculate the hash value H i ;

[0182] Among them, H i =Hash(ID P , ID S ,Time Si , Loc S ,Time Pi , Loc Pi , File i ); ID P Indicates the ID of the payer P. S Indicates the identifier of the payee S, Loc S Indicates the current address information of the payee S;

[0183] Step S09: Use the SSL channel to send the message M c ={H i}Sent to blockchain B.

[0184] (3) Blockchain B-side algorithm:

[0185] Step B01: Receive message M from payee S via SSL channel c , get the hash value H i ;

[0186] Step B02: Hash value H i Deposit into blockchain B.

[0187] Phase 4:

[0188] After multiple rounds of proof storage, assuming that P has completed the transaction he wants to make, the following process will be carried out.

[0189] (1) Payer P’s algorithm:

[0190] Step P01: Receive a message from the payee S via the normal channel Where N S2 Represents a random number, indicates ciphertext, Bill indicates bill; mac S Indicates the message verification code;

[0191] Step P02: Calculate using 128-bit hash summary code function HMAC where mac′ S Indicates the message verification code, LK P Represents the session key of the payer P;

[0192] Step P03, verify mac′ S Is it compatible with Mac? S If they are not equal, the payment operation and evidence feedback process are terminated; if they are equal, continue to step P04;

[0193] Step P04: Use the private key SK of the payer P P The signature algorithm used to calculate the digital signature Where N S2 Indicates random number, ID P Indicates the identifier or ID of the payer P S It indicates the ID of the payee S, and Licence indicates the digital signature;

[0194] Step P05: Use the common channel to send the message M8=Confirm to the payee S;

[0195] (2) The algorithm of the payee S:

[0196] Step S01: Generate a random number N using a random number generator S2 ;

[0197] Step S02: Calculate the bill generated by the transaction;

[0198] Step S03: Calculation

[0199] Step S04: Calculate using 128-bit hash summary code function HMAC

[0200] Step S05: Use a common channel to send the message Send to payer P;

[0201] Step S06: Receive the message M8 sent by the payer P through the ordinary channel and obtain the digital signature Confirm;

[0202] Step S07: Use the public key PK of the payer P B Signature verification algorithm Verify the digital signature Confirm. If the verification fails, the payment operation and evidence feedback process ends; if the verification succeeds, continue to step S08;

[0203] Step S08: Use the SSL channel to send message M9 to blockchain B;

[0204] Where, M9 = {ID P , ID S ,Licence,Bill,Confirm,N S2}, where N S2 Indicates random number, ID P Indicates the identifier or ID of the payer P S It indicates the identifier of the payee S, Licence and Confirm both indicate digital signatures, and Bill indicates the bill;

[0205] (3) Blockchain B-side algorithm:

[0206] Step B01, receiving a message M9 sent from an SSL channel;

[0207] Step B02: Send the evidence storage result to the payer P and the payee S respectively through the SSL channel.

[0208] In summary, the present invention designs a transaction information storage scheme that provides address information and timestamps, and allows multiple rounds of storage within the effective time of the session key. In addition, the algorithm digital signature algorithm can be a secure DSA digital signature algorithm, a secure ECDSA digital signature algorithm, or a secure RSA digital signature algorithm.

[0209] In some embodiments, part or all of the computer program may be loaded and / or installed on the device via the ROM. When the computer program is loaded and executed, one or more steps of the method described above may be performed.

[0210] The functions described above in the present application may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip systems (SOCs), load programmable logic devices (CPLDs), and the like.

[0211] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0212] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0213] In addition, although each operation is described in a specific order, this should be understood as requiring such operation to be performed in the specific order shown or in a sequential order, or requiring that all illustrated operations should be performed to obtain desired results. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination mode.

[0214] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A blockchain evidence storage method for real-time uploading of transaction information, characterized in that: The method comprises the following steps: Step 1: The payer P and the payee S verify each other based on address information and timestamp; Step 2: If the mutual verification is successful, the evidence storage process is started, and it is determined whether a verification success receipt is received from the payee S; if the verification success receipt is received, it indicates that the evidence storage process is successfully started, and step 3 is continued; If the verification success receipt is not received, the start-up evidence storage process is terminated; Step 3: During the validity period of the session key LK between the payer P and the payee S, execute the evidence establishment procedure i times, where i represents the number of rounds; Step 4: If the hash value Hi of the payee S is stored in blockchain B, the payment operation and evidence feedback are completed; The procedure for establishing the evidence storage includes the following sub-steps on the payer P side: Step P01: Receive a message M from the payee S through a common channel a , and from the message M a Get a random number N Si and timestampTime Si ; Step P02, get the current address information Loc Pi , and obtain the timestamp Time from the National Time Service Center NTSC Pi ; Step P03, use the 128-bit hash summary code function HMAC to calculate Res i =HMAC 128 (LK P , N Si );Res i Indicates the message verification code, LK P Represents the session key of the payer P; Step P04: Use the normal channel to send the message M b ={File i ,Time Pi , Loc Pi ,Res i }Send to the payee S, File i Indicates the file data generated by this round; In step 3, the procedure for establishing the evidence storage includes the following sub-steps on the payee S side: Step S01: Generate a random number N using a random number generator Si ; Step S02: Get the timestamp Time from the National Time Service Center NTSC Si ; Step S03: Use a common channel to send the message M a = {N Si ,Time Si }Send to the payee P; Step S04, receive the message M sent by the payee P through the ordinary channel b ={File i ,Time Pi , Loc Pi ,Res i }; Step S05: Calculate Res′ using the hash summary code function HMAC i =HMAC 128 (LK S , N Si ), where Res′ i Indicates the message verification code, LK S Represents the session key of the payee S; Step S06: Verify Res i ′Whether it is the same as Res i If they are not equal, then the evidence establishment procedure is terminated; if they are equal, then the step S07 is continued; Step S07: Get the timestamp Time from the National Time Service Center NTSC Si ; Step S08: Calculate the hash value H i ; Among them, H i =Hash(ID P , ID S ,Time Si , Loc S ,Time Pi , Loc Pi , File i ); ID P Indicates the ID of the payer P. S Indicates the identifier of the payee S, Loc S Indicates the current address information of the payee S; Step S09: Use the SSL channel to send the message M c ={H i }Send to blockchain B; In step 3, the procedure for establishing the evidence storage includes the following sub-steps on the blockchain B side: Step B01: Receive message M from payee S via SSL channel C , get the hash value H i ; Step B02: Hash value H i Deposit into blockchain B.

2. The blockchain evidence storage method according to claim 1 is characterized in that: In step 1, the mutual verification on the payer P side includes the following sub-steps: Step P01: Generate a random number R using a random number generator P ; Step P02: Calculate U P =R P +SK P , where SK P Indicates the private key of the payer P, U P represents the sum of the numbers at the payee P; Step P03, calculate T P =U P ×G, where T P Indicates U P A point on the elliptic curve obtained after scalar multiplication, G represents the base point of the elliptic curve EC; Step P04: Generate a random number N using a random number generator P ; Step P05: Calculate W using the 128-bit hash summary code function HMAC P =HMAC 128 (N P , ID P ||PK P ||T P ), where W P Indicates message verification code, ID P Indicates the identifier of the payer P, PK P Indicates the public key of the payer P, N P Represents a random number; Step P06: Use the common channel to send the message M1 = {ID P , PK P , T P , W P }Send to the payee S; Step P07: Receive the message M2 from the payee S via the normal channel = {ID S , PK S , U S , N S1 ,Time S , Loc S }, where ID S Indicates the ID of the payee S, PK S represents the public key of the payee S, U S Indicates the sum of the numbers at the recipient's place, N S1 Indicates random number, Time S Indicates the current timestamp of the payee S, Loc S Indicates the current address information of the payee S; Step P08: Get the current address information Loc of the payer P P , and obtain the current timestamp Time of the payer P from the National Time Service Center NTSC P ; Step P09: Use the common channel to send the message M3={N P ,Time P , Loc P }Send to the payee S; Step P10: Calculate using 16-bit hash summary code function HMAC Where D P Indicates a 16-digit short message verification code; Step P11: D P Convert it to decimal and display it. The user compares it with the D displayed by the payer P. P D shown at the recipient S S Are they equal? ​​If not, mutual authentication fails and the process ends. If they are equal, continue to execute step P12; Step P12: Calculate the temporary key Temp=R P ×(U S ×G-PK S )=R P ×R S ×G; Step P13: Calculate LK using the 128-bit hash digest code function HMAC P =HMAC 128 (Temp, M1||M2||M3).

3. The blockchain evidence storage method according to claim 2 is characterized in that: In step 1, the mutual verification on the payee S side includes the following sub-steps: Step S01: Receive the message M1={ID P , PK P , T P , W P }; Step S02: Generate a random number R using a random number generator S ; Step S03: Calculate U S =R S +SK S , where SK S Represents the private key of the payee S; Step S04: Generate a random number N using a random number generator S1 ; Step S05: Get the current address information Loc of the payee S S , and obtain the current timestamp Time of the payee S from the National Time Service Center NTSC S ; Step S06: Use the common channel to send the message M2={ID S , PK S , U S , N S1 ,Time S , Loc S }Send to payer P; Step S07: Receive the message M3={N P ,Time P , Loc P }; Step S08: Calculate W using the 128-bit hash summary code function HMAC P1 =HMAC 128 (N P , ID P ||PK P ||T P ), where W P1 represents the message verification code calculated by the payee S; Step S09: Verify W P1 Is it equal to W? P , if they are not equal, the mutual authentication fails and the process ends; If they are equal, continue to execute step S10; Step S10: Calculate using 16-bit hash summary code function HMAC Where D S Indicates a 16-digit short message verification code; Step S11: D S Convert it to decimal and display it. The user compares it with the D displayed by the payer P. P D shown at the recipient S S Are they equal? ​​If not, mutual authentication fails and the process ends. If they are equal, continue to execute step S12; Step S12: Calculate Temp = R S ×(T P -PK P )=R P ×R S ×G; Step S13: Calculate the session key LK S =HMAC 128 (Temp, M1||M2||M3).

4. The blockchain evidence storage method according to claim 1, characterized in that: In step 2, the process of starting the evidence storage includes the following sub-steps on the payer P side: Step P01: Use the SSL channel to send the fourth message M4 to blockchain B; where M4 = {ID P , ID S , N P , N S1 ,Time S , Loc S ,Time P , Loc P }, ID P Indicates the identifier or ID of the payer P S Indicates the ID of the payee S, N S1 and N P Indicates random number, Time S Indicates the current timestamp and Loc of the payee S S Indicates the current address information and Time of the payee S P Indicates the current timestamp of the payer P, Loc P Indicates the current address information of the payer P; Step P02: Receive the message M5={Licence} sent by blockchain B through the SSL channel and obtain the digital signature License; Step P03: Use a common channel to send a message M6 = {'Begin', Licence} to the payee S, where 'Begin' indicates a start instruction.

5. The blockchain evidence storage method according to claim 4 is characterized in that: In step 2, the process of starting the evidence storage includes the following sub-steps on the payee S side: Step S01, receiving the message M6={'Begin', Licence} sent by the payer P through the common channel, and obtaining the digital signature Licence; Step S02: Use the public key PK of blockchain B B Signature verification algorithm Verify the digital signature License. If the verification fails, the evidence storage process ends. If the verification is successful, a verification success receipt will be returned.

6. The blockchain evidence storage method according to claim 4 is characterized in that: In step 2, the process of starting the evidence storage includes the following sub-steps on the blockchain B side: Step B01, receiving a message M4 sent by the payer P via the SSL channel; Where, M4 = {ID P , ID S , N P , N S1 ,Time S , Loc S ,Time P , Loc P }; Step B02: Get the timestamp Time from the National Time Service Center NTSC B ; Step B03: Verify the inequality Time S <Time P <Time B Is it true? If not, the evidence storage process ends; if true, it means that the timestamp meets Time S Earlier than Time P and Time P Earlier than Time B If the condition is met, then continue to execute step B04; Step B04: Use the private key SK of blockchain B B The signature algorithm used to calculate the digital signature Where N B Represents a random number; Step B05: Send the message M5={Licence} to the payer P using the SSL channel.

7. The blockchain evidence storage method according to claim 1, characterized in that: In step 4, the completion of the payment operation and the evidence feedback on the payer P side includes the following sub-steps: Step P01: Receive a message from the payee S via the normal channel Where N S2 Represents a random number, represents ciphertext, Bill represents bill; Mac s Indicates the message verification code; Step P02: Calculate using 128-bit hash summary code function HMAC where mac′ S Indicates the message verification code, LK P Represents the session key of the payer P; Step P03, verify mac′ S Whether and Mac S If they are not equal, the payment operation and evidence feedback process will be terminated; If they are equal, continue to execute step P04; Step P04: Use the private key SK of the payer P P The signature algorithm used to calculate the digital signature Where N S2 Indicates random number, ID P Indicates the identifier or ID of the payer P S It indicates the ID of the payee S, and Licence indicates the digital signature; Step P05: Use the common channel to send the message M8=Confirm to the payee S; The completion of the payment operation and the evidence feedback on the payee S side includes the following sub-steps: Step S01: Generate a random number N using a random number generator S2 ; Step S02: Calculate the bill generated by the transaction; Step S03: Calculation Step S04: Calculate using 128-bit hash summary code function HMAC Step S05: Use a common channel to send the message Send to payer P; Step S06: Receive the message M8 sent by the payer P through the ordinary channel and obtain the digital signature Confirm; Step S07: Use the public key PK of the payer P B Signature verification algorithm Verify the digital signature Confirm. If the verification fails, the payment operation and evidence feedback process will be terminated; If the verification is successful, continue to step S08; Step S08: Use the SSL channel to send message M9 to blockchain B; Where, M9 = {ID P , ID S ,Licence,Bill,Confirm,N S2 }, where N S2 Indicates random number, ID P Indicates the identifier or ID of the payer P S It indicates the identifier of the payee S, Licence and Confirm both indicate digital signatures, and Bill indicates the bill; The completion of the payment operation and evidence storage feedback on the blockchain B side includes the following sub-steps: Step B01, receiving a message M9 sent from an SSL channel; Step B02: Send the evidence storage result to the payer P and the payee S respectively through the SSL channel.