Method and contract rewriting framework system for supporting smart contracts in a blockchain network

US11914721B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-11914721-B2
Application numberUS-202017608759-A
CountryUS
Kind codeB2
Filing dateJun 9, 2020
Priority dateJun 12, 2019
Publication dateFeb 27, 2024
Grant dateFeb 27, 2024

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

A blockchain smart contract rewriting framework system has a vulnerability detection tool, a rewriter tool, and a deployment component. The deployment component obtains a permission to upgrade the smart contract, which granted by a smart contract creator/owner. The contract rewriting framework system retrieves the smart contract from the blockchain network, and passes it to the vulnerability detection tool. The vulnerability detection tool detects a vulnerability in the smart contract, and determines a type of the vulnerability and an instruction location of the vulnerability. The rewriter tool rewrites the smart contract to include a patch for fixing the vulnerability, a patched smart contract being generated by the rewriter tool based on the type of the vulnerability and the instruction location of the vulnerability. The deployment component issues an upgrade transaction including the patched smart contract to the blockchain network, such that the patched smart contract is deployed in the blockchain network.

First claim

Opening claim text (preview).

The invention claimed is: 1. A method for supporting smart contracts in a blockchain network, the blockchain network being a distributed blockchain network having nodes, each node, of the nodes, that validates transactions running a virtual machine for executing a smart contract, a contract rewriting framework system being provided, the contract rewriting framework system comprising a vulnerability detection tool, a rewriter tool, and a deployment component, the method comprising: obtaining, by the deployment component, a permission to upgrade the smart contract, the permission being granted to the deployment component by a creator or owner of the smart contract during a creation phase of the smart contract; retrieving, by the contract rewriting framework system, the smart contract from the blockchain network, the smart contract being passed to the vulnerability detection tool; detecting, by the vulnerability detection tool, a vulnerability in the smart contract, the vulnerability detection tool determining a type of the vulnerability and an instruction location of the vulnerability; rewriting, by the rewriter tool, the smart contract to include a patch for fixing the vulnerability, a patched smart contract being generated by the rewriter tool based on the type of the vulnerability and the instruction location of the vulnerability; and issuing, by the deployment component, an upgrade transaction including the patched smart contract to the blockchain network, such that the patched smart contract is deployed in the blockchain network. 2. The method according to claim 1 , wherein the smart contract retrieved by the contract rewriting framework system is a smart contract code in a binary format, in particular in bytecode. 3. The method according to claim 1 , wherein the patched smart contract, generated by the rewriter tool, is a new or modified smart contract code in a binary format, in particular in bytecode. 4. The method according to claim 1 , wherein the patched smart contract is generated by preparing a patched code in a binary format for replacing a vulnerable block of the original smart contract code. 5. The method according to claim 1 , wherein the instruction location of the vulnerability includes a program counter. 6. The method according to claim 1 , wherein the smart contract, which is retrieved by the contract rewriting framework system from the blockchain network, is passed to the rewriter tool, wherein the rewriter tool patches the smart contract based on the type of the vulnerability and the instruction location of the vulnerability, such that the patched smart contract is generated. 7. The method according to claim 1 , wherein the rewriter tool lifts the smart contract to an intermediate representation while the instruction location of the vulnerability is interpreted, and wherein after including a patch code snippet in the intermediate representation, the intermediate representation is compiled back in a binary format such that the patched smart contract is generated. 8. The method according to claim 1 , wherein the rewriter tool adds a patch code snippet to an unused address space, wherein the rewriter tool replaces a vulnerable code in the smart contract with a trampoline jump such that an instruction pointer jumps to the patch code snippet, and wherein, after the patch code snippet finishes execution, the instruction pointer jumps back to original subsequent code of the smart contract to continue executing of the remaining part of the smart contract. 9. The method according to claim 1 , wherein the deployment component of the contract rewriting framework system represents a predetermined account, wherein the predetermined account is used for upgrading the smart contract of the blockchain network, wherein the upgrade transaction is accepted by a node of the blockchain network, from which the smart contract is retrieved, based upon determining that the upgrade transaction is signed by the predetermined account. 10. The method according to claim 1 , wherein a predetermined address for smart contract deployment is defined, such that a transaction that is sent to the predetermined address is understood as the upgrade transaction for upgrading the smart contract. 11. The method according to claim 1 , wherein the upgrade transaction has a payload that comprises the patched smart contract and an address. 12. The method according to claim 11 , wherein the nodes of the blockchain network, which receive the upgrade transaction, check the original smart contract at the address based on the upgrade transaction and retrieve the predetermined account represented by the deployment component. 13. The method according to claim 11 , wherein the nodes of the blockchain network verify a signature of the upgrade transaction, wherein the blockchain nodes replace the smart contract at the address with the patched smart contract, abased upon determining that the upgrade transaction is valid. 14. The method according to claim 1 , wherein the contract rewriting framework system further comprises a patch verifier, wherein the rewriting tool passes the patched smart contract to the patch verifier, wherein the patch verifier extracts transactions that were sent to the original smart contract and re-executes them, wherein collected execution traces resulting from the original smart contract and the patched smart contract are compared to verify that they do not lead to different state update, except for those malicious transactions that are reverted by the patched smart contract, such that the patch verifier can confirm consistency of the logic of the patched smart contract. 15. A contract rewriting framework system for supporting smart contracts in a blockchain network, the blockchain network being a distributed blockchain network having nodes, each node, of the nodes that validates transactions running a virtual machine for executing a smart contract, the contract rewriting framework system comprises: a vulnerability detection tool; a rewriter tool; and a deployment component, wherein the deployment component is configured to obtain a permission to upgrade the smart contract, wherein the permission is granted to the deployment component by a creator or owner of the smart contract during a creation phase of the smart contract, wherein the contract rewriting framework system is configured to retrieve the smart contract from the blockchain network, wherein the smart contract is passed to the vulnerability detection tool, wherein the vulnerability detection tool is configured to detect a vulnerability in the smart contract, the vulnerability detection tool determines a type of the vulnerability and an instruction location of the vulnerability, wherein the rewriter tool is configured to rewrite the smart contract to include a patch for fixing the vulnerability, wherein a patched smart contract is generated by the rewriter tool based on the type of the vulnerability and the instruction location of the vulnerability, and wherein the deployment component is configured to issue an upgrade transaction including the patched smart contract to the blockchain network, such that the patched smart contract is deployed in the blockchain network.

Assignees

Inventors

Classifications

  • G06F21/577Primary

    Assessing vulnerabilities and evaluating computer system security · CPC title

  • while running · CPC title

  • Protecting data integrity, e.g. using checksums, certificates or signatures · CPC title

  • Keeping log of transactions for guaranteeing non-repudiation of a transaction · CPC title

  • Test or assess software · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US11914721B2 cover?
A blockchain smart contract rewriting framework system has a vulnerability detection tool, a rewriter tool, and a deployment component. The deployment component obtains a permission to upgrade the smart contract, which granted by a smart contract creator/owner. The contract rewriting framework system retrieves the smart contract from the blockchain network, and passes it to the vulnerability de…
Who is the assignee on this patent?
NEC Laboratories Europe GmbH, Nec Corp
What technology area does this patent fall under?
Primary CPC classification G06F21/577. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Feb 27 2024 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 2 related publications on this page (citations in our corpus or others sharing the same primary CPC).