# US 2021/0176058 A1 · Consensus method used for miner node in blockchain system and blockchain system

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0176058 A1
- Document ID: US20210176058A1
- Status: Published application
- Kind: A1
- Application number: 17/144,353
- Filed: 2021-01-08
- Published: 2021-06-10
- Earliest claimed: 2018-07-10
- Assignees: Shenzhen Red Brick Technology Co., Ltd.
- Applicants: Shenzhen Red Brick Technology Co., Ltd.
- Inventors: Qiang CHENG
- Web page: https://patentgrep.com/patent/US20210176058A1

## CPC

- H04L 9/30: Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
- H04L 9/3239: {involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD}
- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F 16/9024: {Graphs; Linked lists (G06F16/9027 takes precedence)}
- G06Q 20/065: {using e-cash}
- G06Q 20/3678: {e-cash details, e.g. blinded, divisible or detecting double spending}
- G06Q 20/3823: {combining multiple encryption tools for a transaction}
- G06Q 20/3825: {Use of electronic signatures}
- G06Q 20/3827: {Use of message hashing}
- G06Q 20/3829: {involving key management}
- G06Q 40/04: Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
- H04L 9/0894: {Escrow, recovery or storing of secret information, e.g. secret key escrow or cryptographic key storage}
- H04L 9/321: {involving a third party or a trusted authority}
- H04L 9/3236: {using cryptographic hash functions}
- H04L 9/3247: {involving digital signatures}
- H04L 9/3297: {involving time stamps, e.g. generation of time stamps}
- H04L 9/50: {using hash chains, e.g. blockchains or hash trees}
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06Q: INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

Disclosed are a blockchain system and a consensus method for use in a miner node in a blockchain system. A specific embodiment of the method includes: acquiring a lower-limit accumulative unused duration; executing, in a trusted execution environment associated with the miner node, a bookkeeping right determination operation including: determining a current accumulative unused duration for the miner node; determining whether the current accumulative unused duration is more than the lower-limit accumulative unused duration; and, in response to the determination that the current accumulative unused duration is more than the lower-limit accumulative unused duration, determining that the miner node has won a bookkeeping right, and updating the current accumulative unused duration with a difference between the current accumulative unused duration and the lower-limit accumulative unused duration. This embodiment allows for reduced electric power consumption in a blockchain system.

## Claims

### Claim 1

A consensus method, applicable to a miner node in a blockchain system, wherein the miner node is associated with a trusted execution environment, and the method comprises:
acquiring a lower-limit accumulative unused duration;
executing, in the trusted execution environment associated with the miner node, a bookkeeping right determination operation, comprising: determining a current accumulative unused duration for the miner node; determining whether the current accumulative unused duration is more than the lower-limit accumulative unused duration; determining, in response to a determination that the current accumulative unused duration is more than the lower-limit accumulative unused duration, that the miner node has won a bookkeeping right; and updating the current accumulative unused duration by using a difference between the current accumulative unused duration and the lower-limit accumulative unused duration.

### Claim 2 (depends on 1)

The method according to claim 1, wherein making the miner node associated with the trusted execution environment comprising:
providing the trusted execution environment associated with the miner node in the miner node; or
providing the trusted execution environment associated with the miner node in other electronic devices connected to the miner node over a network, wherein the miner node interacts with its associated trusted execution environment through a message communication mechanism.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the bookkeeping right determination operation further comprises:
determining, in response to a determination that the miner node has won the bookkeeping right, whether to adjust the lower-limit accumulative unused duration according to a block where the miner node has won the bookkeeping right;
adjusting, in response to a determination to adjust the lower-limit accumulative unused duration, the lower-limit accumulative unused duration by performing operations of: determining an adjusted lower-limit accumulative unused duration according to the lower-limit accumulative unused duration, a real adjustment cycle duration, and an expected adjustment cycle duration, wherein the real adjustment cycle duration is a duration between a timing of generation of the block where the miner node has won the bookkeeping right and a timing of generation of a block corresponding to a previous adjustment of the lower-limit accumulative unused duration in a blockchain of the miner node; and updating the lower-limit accumulative unused duration to the adjusted lower-limit accumulative unused duration.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the adjusted lower-limit accumulative unused duration is positively correlated with the lower-limit accumulative unused duration and the expected adjustment cycle duration, and the adjusted lower-limit accumulative unused duration is negatively correlated with the real adjustment cycle duration.

### Claim 5 (depends on 3)

The method according to claim 3, wherein the determining an adjusted lower-limit accumulative unused duration according to the lower-limit accumulative unused duration, a real adjustment cycle duration, and an expected adjustment cycle duration comprises:
calculating the adjusted lower-limit accumulative unused duration according to the lower-limit accumulative unused duration, the real adjustment cycle duration, and the expected adjustment cycle duration in accordance with a following formula:
T
min
′
=
T
min

T
exp
T
real
where Tmin is the lower-limit accumulative unused duration, Texp is the expected adjustment cycle duration, Treal is the real adjustment cycle duration, and T′min is a calculated adjusted lower-limit accumulative unused duration.

### Claim 6 (depends on 3)

The method according to claim 3, wherein the determining an adjusted lower-limit accumulative unused duration according to the lower-limit accumulative unused duration, a real adjustment cycle duration, and an expected adjustment cycle duration comprises:
calculating the adjusted lower-limit accumulative unused duration according to the lower-limit accumulative unused duration, the real adjustment cycle duration, and the expected adjustment cycle duration in accordance with a following formula:
T
min
′
=
α


T
min

T
exp
+
β
γ


T
real
+
θ
where
Tmin is the lower-limit accumulative unused duration, Texp is the expected adjustment cycle duration, Treal is the real adjustment cycle duration, T′min is a calculated adjusted lower-limit accumulative unused duration, and α, β, γ, and θ are preset constants.

### Claim 7 (depends on 4)

The method according to claim 4, wherein before executing the bookkeeping right determination operation in the trusted execution environment associated with the miner node, the method further comprises:
acquiring a hash value of a block previous to a block ready for bookkeeping; and
after determining that the miner node has won the bookkeeping right, the bookkeeping right determination operation further comprises:
signing bookkeeping right determination information with a preset private key stored in the trusted execution environment, to obtain a signature of the bookkeeping right determination information, in the trusted execution environment associated with the miner node, wherein the bookkeeping right determination information comprises: the hash value of the block previous to the block ready for bookkeeping, the lower-limit accumulative unused duration, and an account address bound to the miner node, wherein the account address bound to the miner node is stored in the trusted execution environment associated with the miner node; and
broadcasting the bookkeeping right determination information and the signature of the bookkeeping right determination information to nodes neighboring the miner node.

### Claim 8 (depends on 7)

The method according to claim 7, wherein the preset private key is a private key preset when the trusted execution environment is issued, or a private key corresponding to the account address bound to the miner node.

### Claim 9 (depends on 7)

The method according to claim 7, wherein the bookkeeping right determination information further comprises a real-name authentication identifier stored in the trusted execution environment associated with the miner node, wherein the real-name authentication identifier is used for representing whether the trusted execution environment associated with the miner node has passed a real-name authentication from a third-party organization.

### Claim 10 (depends on 2)

The method according to claim 2, wherein the trusted execution environment associated with the miner node interacts with an outside world in a ciphertext manner; and
the executing the bookkeeping right determination operation in the trusted execution environment associated with the miner node comprises:
encrypting an instruction corresponding to the bookkeeping right determination operation by using a preset administrator public key, to obtain an encrypted instruction;
decrypting an obtained encrypted instruction by using a preset administrator private key stored in the trusted execution environment associated with the miner node, to obtain a decrypted instruction, and executing the decrypted instruction to execute the bookkeeping right determination operation in the trusted execution environment associated with the miner node; and
encrypting a result of executing the bookkeeping right determination operation by using a preset key stored in the trusted execution environment associated with the miner node, and then outputting an encrypted execution result from the trusted execution environment associated with the miner node.

### Claim 11 (depends on 10)

The method according to claim 10, further comprising:
verifying the signature of received bookkeeping right determination information by using a preset public key, in response to reception of the bookkeeping right determination information and the signature of the bookkeeping right determination information;
checking a hash value of a previous block and a lower-limit accumulative unused duration in the received bookkeeping right determination information by using a hash value of a tail block in the blockchain of the miner node and the lower-limit accumulative unused duration, respectively, in response to a successful verification of the signature of the received bookkeeping right determination information;
determining, in response to a successful checking, an account address in the received bookkeeping right determination information as an account address bound to a miner node which has won a first current block, wherein the first current block is a block next to a block indicated by the hash value of the previous block in the received bookkeeping right determination information.

### Claim 12 (depends on 11)

The method according to claim 11, wherein, after determining the current accumulative unused duration for the miner node, the bookkeeping right determination operation further comprises:
updating the current accumulative unused duration to an upper-limit accumulative unused duration, in response to a determination that the current accumulative unused duration for the miner node is more than the upper-limit accumulative unused duration.

### Claim 13 (depends on 1)

The method according to claim 1, further comprising, before executing the bookkeeping right determination operation in the trusted execution environment associated with the miner node,
judging whether a time interval from a time at which a previous bookkeeping is performed in the trusted execution environment is more than a cool-down duration, wherein the cool-down duration is k times the lower-limit accumulative unused duration, wherein k is a constant greater than 0 and less than 1; and
executing the bookkeeping right determination operation in the trusted execution environment, if yes.

### Claim 14 (depends on 13)

The method according to claim 13, further comprising, after the judging whether a time interval from a time at which a previous bookkeeping is performed in the trusted execution environment is more than a cool-down duration,
calculating, if the time interval from the time at which the previous bookkeeping is performed in the trusted execution environment is not more than the cool-down duration, a time interval to a next competition for the bookkeeping right in which the trusted execution environment is able to participate, wherein the time interval is a difference between the cool-down duration and the time interval from the time at which the previous bookkeeping is performed in the trusted execution environment.

### Claim 15 (depends on 13)

The method according to claim 13, wherein the time interval t1 from the time at which the previous bookkeeping is performed in the trusted execution environment is calculated by a following formula:
t1=(Height2−Height1)·t
where Height2 is a height of a block, in the blockchain, where the trusted execution environment has won the bookkeeping right, Height1 is a height of a block, in the blockchain, that is generated by the previous bookkeeping in the trusted execution environment, and t is a preset constant for the blockchain system, which is used for representing an average time required for generating a block in the blockchain system.

### Claim 16 (depends on 1)

The method according to claim 1, further comprising:
receiving a block ready for bookkeeping that is broadcast by a miner node in the same chain; and
calculating a time interval from a time at which the block ready for bookkeeping is generated to a time at which a previous bookkeeping is performed in the trusted execution environment that has won the bookkeeping right for the block, and approving the block ready for bookkeeping if a calculated time interval is more than a cool-down duration, wherein the cool-down duration t2 is k times the lower-limit accumulative unused duration, wherein k is a constant greater than 0 and less than 1.

### Claim 17 (depends on 1)

The method according to claim 1, wherein the blockchain system comprises at least one parallel chain, the parallel chain comprises routing nodes and at least one miner node, the routing nodes of the at least one parallel chain are connected over a network, and the method further comprises:
receiving a block ready for bookkeeping that is broadcast by a miner node in the same parallel chain;
extracting, from the block ready for bookkeeping, public key information corresponding to the trusted execution environment that has won the bookkeeping right for the block, and calculating, according to the public key information, a chain number of a parallel chain where mining is performed by the trusted execution environment; and
approving the block ready for bookkeeping if a calculated chain number of the parallel chain is a chain number of a parallel chain where the miner node itself is located.

### Claim 18 (depends on 17)

The method according to claim 17, wherein the calculating, according to the public key information, a chain number of a parallel chain where mining is performed by the trusted execution environment comprises:
calculating the chain number of the parallel chain where mining is performed by the trusted execution environment according to the public key information in accordance with a following formula:
Num=K % N
where K is a miner identification number calculated according to the public key information, N is a total number of parallel chains in the blockchain system, and % denotes a remainder operation.

### Claim 19 (depends on 1)

The method according to claim 1, wherein the trusted execution environment has its own unique device number preset therein, and the trusted execution environment provides only an interface for one-time registration of a miner account and does not provide an interface for modifying or deleting a registered miner account.

### Claim 20

A blockchain system, comprising at least one parallel chain, the parallel chain comprising routing nodes and at least one miner node, wherein the routing nodes of the at least one parallel chain are connected over a network, an account address is bound to the miner node, and each of the routing nodes is configured to: synchronize a blockchain of a miner node in the same chain as a routing node to a local blockchain in real time, and the miner node is configured to compete for a bookkeeping right for an intrachain transaction request in a parallel chain, where the miner node is located, by a method comprising:
acquiring a lower-limit accumulative unused duration; and
executing, in a trusted execution environment associated with the miner node, a bookkeeping right determination operation comprising: determining a current accumulative unused duration for the miner node; determining whether the current accumulative unused duration is more than the lower-limit accumulative unused duration; determining, in response to a determination that the current accumulative unused duration is more than the lower-limit accumulative unused duration, that the miner node has won the bookkeeping right; and updating the current accumulative unused duration by using a difference between the current accumulative unused duration and the lower-limit accumulative unused duration.
