IP Library Granted Patent US 11,283,634
Granted Patent B2
US 11,283,634 · App. 16/464,013 · Granted Mar 22, 2022

System and method for detecting replay attack

Inventor: Guilu Xie (Hangzhou, CN)
Assignee: ADVANCED NEW TECHNOLOGIES CO., LTD.
H04L9/3297H04L63/1416H04L63/1425H04L2209/38
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,283,634
App. No.
16/464,013
Granted
Mar 22, 2022
Kind
B2
Abstract

A computer-implemented method for detecting replay attack comprises: obtaining at least one candidate transaction for adding to a blockchain, the obtained candidate transaction comprising a timestamp; verifying if the timestamp is within a validation range and if an identification of the candidate transaction exists in an identification database; and in response to determining that the timestamp is within the validation range and the identification does not exist in the identification database, determining that the candidate transaction is not associated with a replay attack.

Claims (56)

1. A method, comprising:

storing, at an identification database of a blockchain node, a plurality of hash values of a respective plurality of candidate transactions that have not been added to a blockchain and have a respective plurality of timestamps within a time period;

obtaining, at the blockchain node, a candidate transaction for adding to the blockchain, the obtained candidate transaction comprising a timestamp and transaction information of the candidate transaction;

determining, at the blockchain node, based at least on the timestamp and transaction information, a first hash value of the candidate transaction;

verifying, at the blockchain node, whether the timestamp of the candidate transaction is within a validation range corresponding to the time period;

verifying, at the blockchain node, whether the first hash value of the candidate transaction exists in the identification database;

in response to determining that the timestamp of the candidate transaction is within the validation range and the first hash value of the candidate transaction does not exist in the identification database, determining, at the blockchain node, without using an account nonce, that the candidate transaction is not associated with a replay attack, and adding the first hash value of the candidate transaction to a cache that stores the identification database; and

in response to determining that the timestamp of the candidate transaction is within the validation range and the first hash value of the candidate transaction exists in the identification database, determining, at the blockchain node, that the candidate transaction is associated with the replay attack, and rejecting the candidate transaction for addition to the blockchain.

2. The method of claim 1 , wherein:

the candidate transaction further comprises a second hash value; and

before verifying whether the first hash value of the candidate transaction exists in the identification database, the method further comprises: verifying, at the blockchain node, the second hash value is the same as the first hash value.

3. The method of claim 1 , wherein:

the timestamp is configured by a user terminal that initiated the candidate transaction; and

obtaining the candidate transaction for adding to the blockchain comprises receiving the candidate transaction at the blockchain node from the user terminal.

4. The method of claim 1 , wherein:

the timestamp is configured by the blockchain node; and

obtaining the candidate transaction for adding to the blockchain comprises:

receiving at least one initiated transaction from a user terminal; and

adding, by the blockchain node, the timestamp to the initiated transaction to obtain the candidate transaction.

5. The method of claim 1 , further comprising:

in response to determining that the timestamp of the candidate transaction is not within the validation range, returning an error message to a computing device that submitted the candidate transaction.

6. The method of claim 1 , further comprising:

performing consensus verification, wherein the candidate transaction is included in the consensus verification if the candidate transaction is determined not to be associated with the replay attack.

7. The method of claim 6 , further comprising:

synchronizing, at the blockchain node, the identification database with one or more other blockchain nodes.

8. The method of claim 1 , before obtaining the candidate transaction, further comprising:

synchronizing, at the blockchain node, the identification database with one or more other blockchain nodes.

9. The method of claim 1 , wherein:

the validation range is based on another timestamp of a latest block of the blockchain; and

the validation range is included in a genesis block of the blockchain.

10. The method of claim 1 , wherein:

the validation range is based on an internal clock of the blockchain node.

11. A system comprising

one or more processors of a blockchain node; and

one or more non-transitory computer-readable memories coupled to the one or more processors and configured with instructions executable by the one or more processors to cause the system to perform operations comprising:

storing, at an identification database of the blockchain node, a plurality of hash values of a respective plurality of candidate transactions that have not been added to a blockchain and have a respective plurality of timestamps within a time period;

obtaining a candidate transaction for adding to the blockchain, the obtained candidate transaction comprising a timestamp and transaction information of the candidate transaction;

determining based at least on the timestamp and transaction information, a first hash value of the candidate transaction;

verifying whether the timestamp of the candidate transaction is within a validation range corresponding to the time period;

verifying whether the first hash value of the candidate transaction exists in the identification database;

in response to determining that the timestamp of the candidate transaction is within the validation range and the first hash value of the candidate transaction does not exist in the identification database, determining, without using an account nonce, that the candidate transaction is not associated with a replay attack, and adding the first hash value of the candidate transaction to a cache that stores the identification database; and

in response to determining that the timestamp of the candidate transaction is within the validation range and the first hash value of the candidate transaction exists in the identification database, determining that the candidate transaction is associated with the replay attack, and rejecting the candidate transaction for addition to the blockchain.

12. The system of claim 11 , wherein:

the candidate transaction further comprises second hash value; and

before verifying whether the first hash value of the candidate transaction exists in the identification database, the operations further comprise: verifying the second hash value is the same as the first hash value.

13. A non-transitory computer-readable storage medium configured with instructions executable by one or more processors of a blockchain node to cause the one or more processors to perform operations comprising:

storing, at an identification database of the blockchain node, a plurality of hash values of a respective plurality of candidate transactions that have not been added to a blockchain and have a respective plurality of timestamps within a time period;

obtaining a candidate transaction for adding to the blockchain, the obtained candidate transaction comprising a timestamp and transaction information of the candidate transaction;

determining based at least on the timestamp and transaction information, a first hash value of the candidate transaction;

verifying whether the timestamp of the candidate transaction is within a validation range corresponding to the time period;

verifying whether the first hash value of the candidate transaction exists in the identification database;

in response to determining that the timestamp of the candidate transaction is within the validation range and the first hash value of the candidate transaction does not exist in the identification database, determining, without using an account nonce, that the candidate transaction is not associated with a replay attack, and adding the first hash value of the candidate transaction to a cache that stores the identification database; and

in response to determining that the timestamp of the candidate transaction is within the validation range and the first hash value of the candidate transaction exists in the identification database, determining that the candidate transaction is associated with the replay attack, and rejecting the candidate transaction for addition to the blockchain.

14. The non-transitory computer-readable storage medium of claim 13 , wherein:

the candidate transaction further comprises a second hash value; and

before verifying whether the first hash value of the candidate transaction exists in the identification database, the operations further comprise: verifying the second hash value is the same as the first hash value.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 16, 2020
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053796/0281 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 3, 2020
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053702/0392 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 24, 2019
From: XIE, GUILU
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 049287/0018 →