IP Library › Granted Patent US 11,558,173
Granted Patent B2
US 11,558,173 · App. 17/205,386 · Granted Jan 17, 2023

Method and system for auditing smart contracts

Inventors: Sébastien Le Callonnec (Greystones, IE); Eduardo Andrade (Dublin, IE); Rakesh Yadav (Cape Elizabeth, ME)
Assignee: MASTERCARD INTERNATIONAL INCORPORATED
H04L9/06G06F8/41
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,558,173
App. No.
17/205,386
Granted
Jan 17, 2023
Kind
B2
Abstract

A method and system are disclosed to audit smart contracts. The method includes: publishing, with a processing server, a smart contract bytecode with metadata on a blockchain; retrieving, with the processing server, the published smart contract bytecode with metadata from the blockchain; extracting, with the processing server, the smart contract bytecode from the published smart contract bytecode; and verifying the smart contract bytecode by comparing a computed hash of a high-level source code of the published smart contract bytecode with the metadata retrieved from the blockchain.

Claims (59)

1. A method to audit smart contracts, the method comprising:

publishing, with a processing server, a smart contract bytecode with metadata on a blockchain;

retrieving, with the processing server, the published smart contract bytecode with metadata from the blockchain;

extracting, with the processing server, the smart contract bytecode from the published smart contract bytecode; and

verifying the smart contract bytecode by comparing a computed hash of a high-level source code of the published smart contract bytecode with the metadata retrieved from the blockchain.

2. The method according to claim 1 , wherein the publishing of the smart contract bytecode with the metadata on the blockchain comprises:

writing, by the processing server, a smart contract into the high-level source code;

compiling, with the processing server, the high-level source code into the smart contract bytecode;

hashing, with the processing server, the high-level source code using a hash function of the high-level source code and a hash of the high-level source code; and

generating, with the processing server, the metadata for the smart contract using the hash function of the high-level source code, the hash of the high-level source code, and a version of a compiler used to compile the smart contract bytecode.

3. The method according to claim 2 , wherein the verifying of the smart contract bytecode comprises:

computing, with the processing server, a hash of the high-level source code using the hash function of the high-level source code defined in the metadata of the smart contract bytecode;

comparing, with the processing server, the computed hash of the high-level source code using the hash function of the high-level source code defined in the metadata of the smart contract bytecode to the hash of the high-level source code in the metadata; and

authenticating, with the processing server, the high-level source code by matching the computed hash of the high-level source code using the hash function of the high-level source code defined in the metadata of the smart contract bytecode and the hash of the high-level source code in the metadata.

4. The method according to claim 1 , wherein the publishing of the smart contract bytecode with the metadata on the blockchain comprises:

writing, by the processing server, a smart contract into the high-level source code;

compiling, with the processing server, the high-level source code into the smart contract bytecode;

hashing, with the processing server, the smart contract bytecode using the hash function, and a hash of a transaction publishing of the smart contract bytecode; and

generating, with the processing server, the metadata for the smart contract using the high-level source code, the hash function of the high-level source code, the hash of the smart contract bytecode, the hash of a transaction publishing of the smart contract bytecode, and a version of a compiler used to compile the smart contract bytecode.

5. The method according to claim 4 , further comprising:

publishing, with the processing server, the smart contract bytecode on the blockchain.

6. The method according to claim 4 , wherein the verifying of the smart contract bytecode comprises:

compiling, with the processing server, the published smart contract bytecode with the version of the compiler used to compile the smart contract bytecode in the metadata;

hashing, with the processing server, the compiled published smart contract bytecode using the hash function of the high-level source code;

computing, with the processing server, a hash of the smart contract bytecode using the hash function of the high-level source code in the metadata;

comparing, with the processing server, the hash of the compiled published smart contract bytecode using the hash function of the high-level source code to the computed hash of the smart contract bytecode using the hash function of the high-level source code in the metadata; and

authenticating, with the processing server, the high-level source code by matching the hash of the compiled published smart contract bytecode using the hash function of the high-level source code and the computed hash of the smart contract bytecode using the hash function of the high-level source code in the metadata.

7. The method according to claim 1 , further comprising:

auditing, with the processing server, the high-level source code of the verified smart contract bytecode.

8. A system for auditing smart contracts, the system comprising:

a processing server configured to:

publish a smart contract bytecode with metadata on a blockchain;

retrieve the published smart contract bytecode with metadata from the blockchain;

extract the smart contract bytecode from the published smart contract bytecode; and

verify the smart contract bytecode by comparing a computed hash of a high-level source code of the published smart contract bytecode with the metadata retrieved from the blockchain.

9. The system according to claim 8 , wherein the processing server is further configured to:

write a smart contract into the high-level source code;

compile the high-level source code into the smart contract bytecode;

hash the high-level source code using a hash function into a hash a hash of the high-level source code; and

generate, the metadata for the smart contract using the hash function of the high-level source code, the hash of the high-level source code, and a version of a compiler used to compile the smart contract bytecode.

10. The system according to claim 9 , wherein the processing server is further configured to:

compute a hash of the high-level source code using the hash function of the high-level source code defined in the metadata of the smart contract bytecode;

compare the computed hash of the high-level source code using the hash function of the high-level source code defined in the metadata of the smart contract bytecode to the hash of the high-level source code in the metadata; and

authenticate the high-level source code by matching the computed hash of the high-level source code using the hash function of the high-level source code defined in the metadata of the smart contract bytecode and the hash of the high-level source code in the metadata.

11. The system according to claim 8 , wherein the processing server is further configured to:

write a smart contract into the high-level source code;

compile the high-level source code into the smart contract bytecode;

hash the high-level source code using a hash function of the high-level source code into a hash of the smart contract bytecode, and a hash of a transaction publishing of the smart contract bytecode; and

generate the metadata for the smart contract using the high-level source code, the hash function of the high-level source code, the hash of the smart contract bytecode, the hash of a transaction publishing of the smart contract bytecode, and a version of a compiler used to compile the smart contract bytecode.

12. The system according to claim 11 , wherein the processing server is further configured to:

publish the smart contract bytecode on the blockchain.

13. The system according to claim 11 , wherein the processing server is further configured to:

compile the published smart contract bytecode with the version of the compiler used to compile the smart contract bytecode in the metadata;

hash the compiled published smart contract bytecode using the hash function of the high-level source code;

compute a hash of the smart contract bytecode using the hash function of the high-level source code in the metadata;

compare the hash of the compiled published smart contract bytecode using the hash function of the high-level source code to the computed hash of the smart contract bytecode using the hash function of the high-level source code in the metadata; and

authenticate the high-level source code by matching the hash of the compiled published smart contract bytecode using the hash function of the high-level source code and the computed hash of the smart contract bytecode using the hash function of the high-level source code in the metadata.

14. The system according to claim 8 , wherein the processing server is further configured to:

audit the high-level source code of the verified smart contract bytecode.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 18, 2021
From: LE CALLONNEC, SÉBASTIEN; ANDRADE, EDUARDO; YADAV, RAKESH
To: MASTERCARD INTERNATIONAL INCORPORATED
Reel/Frame 055720/0001 →
Continuity (2)
Provisional Application 62992240 · Mar 20, 2020
Related Publication 20210297234A1 · Sep 23, 2021