IP Library › Granted Patent US 12,659,180
Granted Patent B2
US 12,659,180 · App. 18/276,872 · Granted Jun 16, 2026

Methods and apparatuses for registering and executing smart contract in blockchain

Inventor: Kaikai Feng (Beijing, CN)
Assignee: DIGITAL CURRENCY INSTITUTE, THE PEOPLE'S BANK OF CHINA
H04L9/50
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 12,659,180
App. No.
18/276,872
Granted
Jun 16, 2026
Kind
B2
Abstract

The present disclosure relates to the technical field of computers. Provided are methods and apparatuses for registering and executing a smart contract in a blockchain. An example implementation mode of the method includes: a first smart contract deployed on a blockchain is determined, wherein the first smart contract includes an event trigger function; identification information of the first smart contract and an event corresponding to the event trigger function are registered to a bottom layer of the blockchain by means of a preset bottom layer interface; and a corresponding monitoring interface is generated for the event, and event information related to the event is obtained by means of the monitoring interface, so as to execute the first smart contract based on the event information related to the event.

Claims (65)

1 . A method for registering a smart contract in a blockchain, comprising:

determining a first smart contract deployed on the blockchain, wherein the first smart contract comprises an event trigger function;

registering identification information of the first smart contract and an event corresponding to the event trigger function to a bottom layer of the blockchain by means of a preset bottom layer interface, wherein when the first smart contract comprises at least two event trigger functions, and each of the event trigger functions corresponds to one processing logic in the first smart contract, registering the identification information of the first smart contract, events corresponding to the at least two event trigger functions and identification information of processing logics corresponding to the events to the bottom layer of the blockchain by means of the preset bottom layer interface;

generating a corresponding monitoring interface for the event, and obtaining event information related to the event by means of the monitoring interface;

inputting an event feature included in the event information into the event trigger function;

determining whether the event feature satisfies the event trigger function, and if so, executing the first smart contract corresponding to the event trigger function or executing a processing logic in the first smart contract corresponding to the event trigger function;

providing a transaction block for a second smart contract without an event trigger function, wherein a transaction corresponding to the second smart contract is recorded in the transaction block; and when an execution trigger of the second smart contract is received, executing the transaction block corresponding to the second smart contract; and

providing a built-in block or a built-in area located in a transaction block for the first smart contract, and configuring a corresponding amount of consumable resources for the built-in block or the built-in area, wherein a transaction of the first smart contract is recorded in the built-in block or the built-in area;

wherein executing the first smart contract comprises: when an execution trigger of the first smart contract is received, judging whether an amount of resources currently required is not greater than the amount of consumable resources corresponding to the built-in block or the built-in area, if so, executing the built-in block or the built-in area corresponding to the first smart contract, otherwise prohibiting the execution.

2 . The method for registering the smart contract in the blockchain as claimed in claim 1 , wherein,

the first smart contract further comprises a contract information table, wherein the identification information of the smart contract and the event corresponding to the event trigger function are collated in the contract information table;

before registering the identification information of the first smart contract and the event corresponding to the event trigger function to the bottom layer of the blockchain, the method further comprises:

obtaining the identification information of the first smart contract and the event corresponding to the event trigger function in the contract information table by means of the bottom layer interface.

3 . The method for registering the smart contract in the blockchain as claimed in claim 1 ,

further comprising: maintaining a correspondence between a type of an event trigger function and an event;

before registering the identification information of the first smart contract and the event corresponding to the event trigger function to the bottom layer of the blockchain, the method further comprises:

obtaining the identification information of the first smart contract and the event trigger function from the first smart contract by means of the bottom layer interface; and

determining the event corresponding to the event trigger function based on the correspondence.

4 . The method for registering the smart contract in the blockchain as claimed in claim 1 , further comprising:

monitoring an update condition of the first smart contract; and

when the update condition indicates that the event trigger function is updated, updating the event corresponding to the event trigger function.

5 . The method for registering the smart contract in the blockchain as claimed in claim 1 , wherein the event comprises:

any one or more of a time trigger event, a block height trigger event, and a service record trigger event.

6 . The method for registering the smart contract in the blockchain as claimed in claim 1 , wherein executing the first smart contract comprises:

when the first smart contract comprises at least two event trigger functions, and each of the event trigger functions corresponds to one processing logic in the first smart contract,

executing the processing logic corresponding to the event trigger function according to the event information.

7 . An electronic device for registering a smart contract in a blockchain, comprising:

one or more processors; and

a storage device, configured to store one or more programs,

the one or more programs are executed by the one or more processors to enable the one or more processors to implement following actions:

determining a first smart contract deployed on the blockchain, wherein the first smart contract comprises an event trigger function;

registering identification information of the first smart contract and an event corresponding to the event trigger function to a bottom layer of the blockchain by means of a preset bottom layer interface, wherein when the first smart contract comprises at least two event trigger functions, and each of the event trigger functions corresponds to one processing logic in the first smart contract, registering the identification information of the first smart contract, events corresponding to the at least two event trigger functions and identification information of processing logics corresponding to the events to the bottom layer of the blockchain by means of the preset bottom layer interface;

generating a corresponding monitoring interface for the event, and obtaining event information related to the event by means of the monitoring interface;

inputting an event feature included in the event information into the event trigger function;

determining whether the event feature satisfies the event trigger function, and if so, executing the first smart contract corresponding to the event trigger function or executing a processing logic in the first smart contract corresponding to the event trigger function;

providing a transaction block for a second smart contract without an event trigger function, wherein a transaction corresponding to the second smart contract is recorded in the transaction block; and when an execution trigger of the second smart contract is received, executing the transaction block corresponding to the second smart contract; and

providing a built-in block or a built-in area located in a transaction block for the first smart contract, and configuring a corresponding amount of consumable resources for the built-in block or the built-in area, wherein a transaction of the first smart contract is recorded in the built-in block or the built-in area;

wherein executing the first smart contract comprises: when an execution trigger of the first smart contract is received, judging whether an amount of resources currently required is not greater than the amount of consumable resources corresponding to the built-in block or the built-in area, if so, executing the built-in block or the built-in area corresponding to the first smart contract, otherwise prohibiting the execution.

8 . The electronic device for registering the smart contract in the blockchain as claimed in claim 7 , wherein,

the first smart contract further comprises a contract information table, wherein the identification information of the smart contract and the event corresponding to the event trigger function are collated in the contract information table;

before registering the identification information of the first smart contract and the event corresponding to the event trigger function to the bottom layer of the blockchain, the method further comprises:

obtaining the identification information of the first smart contract and the event corresponding to the event trigger function in the contract information table by means of the bottom layer interface.

9 . The electronic device for registering the smart contract in the blockchain as claimed in claim 7 ,

further comprising: maintaining a correspondence between a type of an event trigger function and an event;

before registering the identification information of the first smart contract and the event corresponding to the event trigger function to the bottom layer of the blockchain, the method further comprises:

obtaining the identification information of the first smart contract and the event trigger function from the first smart contract by means of the bottom layer interface; and

determining the event corresponding to the event trigger function based on the correspondence.

10 . A non-transitory computer-readable storage medium, on which a computer program is stored, wherein the program is executed by a processor to implement following actions:

determining a first smart contract deployed on the blockchain, wherein the first smart contract comprises an event trigger function;

registering identification information of the first smart contract and an event corresponding to the event trigger function to a bottom layer of the blockchain by means of a preset bottom layer interface, wherein when the first smart contract comprises at least two event trigger functions, and each of the event trigger functions corresponds to one processing logic in the first smart contract, registering the identification information of the first smart contract, events corresponding to the at least two event trigger functions and identification information of processing logics corresponding to the events to the bottom layer of the blockchain by means of the preset bottom layer interface;

generating a corresponding monitoring interface for the event, and obtaining event information related to the event by means of the monitoring interface;

inputting an event feature included in the event information into the event trigger function;

determining whether the event feature satisfies the event trigger function, and if so, executing the first smart contract corresponding to the event trigger function or executing a processing logic in the first smart contract corresponding to the event trigger function;

providing a transaction block for a second smart contract without an event trigger function, wherein a transaction corresponding to the second smart contract is recorded in the transaction block; and when an execution trigger of the second smart contract is received, executing the transaction block corresponding to the second smart contract; and

providing a built-in block or a built-in area located in a transaction block for the first smart contract, and configuring a corresponding amount of consumable resources for the built-in block or the built-in area, wherein a transaction of the first smart contract is recorded in the built-in block or the built-in area;

wherein executing the first smart contract comprises: when an execution trigger of the first smart contract is received, judging whether an amount of resources currently required is not greater than the amount of consumable resources corresponding to the built-in block or the built-in area, if so, executing the built-in block or the built-in area corresponding to the first smart contract, otherwise prohibiting the execution.

11 . The non-transitory computer-readable storage medium as claimed in claim 10 , wherein,

the first smart contract further comprises a contract information table, wherein the identification information of the smart contract and the event corresponding to the event trigger function are collated in the contract information table;

before registering the identification information of the first smart contract and the event corresponding to the event trigger function to the bottom layer of the blockchain, the method further comprises:

obtaining the identification information of the first smart contract and the event corresponding to the event trigger function in the contract information table by means of the bottom layer interface.

12 . The non-transitory computer-readable storage medium as claimed in claim 10 , wherein,

further comprising: maintaining a correspondence between a type of an event trigger function and an event;

before registering the identification information of the first smart contract and the event corresponding to the event trigger function to the bottom layer of the blockchain, the method further comprises:

obtaining the identification information of the first smart contract and the event trigger function from the first smart contract by means of the bottom layer interface; and

determining the event corresponding to the event trigger function based on the correspondence.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 10, 2023
From: FENG, KAIKAI
To: DIGITAL CURRENCY INSTITUTE,THE PEOPLE'S BANK OF CHINA
Reel/Frame 064565/0445 →
Priority Claims (1)
CN 202110185551.X · Feb 10, 2021 · national
Continuity (1)
Related Publication 20240121120A1 · Apr 11, 2024
References Cited (17)
US 11393024B1 · Kodihalli · 2022 [cited by examiner]
US 11544782B2 · Cella · 2023 [cited by examiner]
US 20200044857A1 · Snow · 2020 [cited by examiner]
US 20210019849A1 · Qian · 2021 [cited by examiner]
US 20210184845A1 · Hébert · 2021 [cited by examiner]
US 20220278857A1 · Wakabayashi · 2022 [cited by examiner]
US 20220292082A1 · Qiu · 2022 [cited by examiner]
CN 108073513A · 2018 [cited by applicant]
CN 108510251A · 2018 [cited by applicant]
CN 109670950A · 2019 [cited by applicant]
CN 110264190A · 2019 [cited by applicant]
CN 111857892A · 2020 [cited by applicant]
CN 112837155A · 2021 [cited by applicant]
EP 3594867A1 · 2020 [cited by applicant]
WO 2020224250A1 · 2020 [cited by applicant]
WO 2020233622A1 · 2020 [cited by applicant]
The search report of counterpart EP application No. 22752347.9 issued on Jan. 17, 2025. [cited by applicant]