Cargando…

Synthesis of Super-Optimized Smart Contracts Using Max-SMT

With the advent of smart contracts that execute on the blockchain ecosystem, a new mode of reasoning is required for developers that must pay meticulous attention to the gas spent by their smart contracts, as well as for optimization tools that must be capable of effectively reducing the gas require...

Descripción completa

Detalles Bibliográficos
Autores principales: Albert, Elvira, Gordillo, Pablo, Rubio, Albert, Schett, Maria A.
Formato: Online Artículo Texto
Lenguaje:English
Publicado: 2020
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7363236/
http://dx.doi.org/10.1007/978-3-030-53288-8_10
_version_ 1783559629564805120
author Albert, Elvira
Gordillo, Pablo
Rubio, Albert
Schett, Maria A.
author_facet Albert, Elvira
Gordillo, Pablo
Rubio, Albert
Schett, Maria A.
author_sort Albert, Elvira
collection PubMed
description With the advent of smart contracts that execute on the blockchain ecosystem, a new mode of reasoning is required for developers that must pay meticulous attention to the gas spent by their smart contracts, as well as for optimization tools that must be capable of effectively reducing the gas required by the smart contracts. Super-optimization is a technique which attempts to find the best translation of a block of code by trying all possible sequences of instructions that produce the same result. This paper presents a novel approach for super-optimization of smart contracts based on Max-SMT which is split into two main phases: (i) the extraction of a stack functional specification from the basic blocks of the smart contract, which is simplified using rules that capture the semantics of the arithmetic, bit-wise, relational operations, etc. (ii) the synthesis of optimized blocks which, by means of an efficient Max-SMT encoding, finds the bytecode blocks with minimal gas cost whose stack functional specification is equal (modulo commutativity) to the extracted one. Our experimental results are very promising: we are able to optimize 55.41 % of the blocks, and prove that 34.28 % were already optimal, for more than 61000 blocks from the most called 2500 Ethereum contracts.
format Online
Article
Text
id pubmed-7363236
institution National Center for Biotechnology Information
language English
publishDate 2020
record_format MEDLINE/PubMed
spelling pubmed-73632362020-07-16 Synthesis of Super-Optimized Smart Contracts Using Max-SMT Albert, Elvira Gordillo, Pablo Rubio, Albert Schett, Maria A. Computer Aided Verification Article With the advent of smart contracts that execute on the blockchain ecosystem, a new mode of reasoning is required for developers that must pay meticulous attention to the gas spent by their smart contracts, as well as for optimization tools that must be capable of effectively reducing the gas required by the smart contracts. Super-optimization is a technique which attempts to find the best translation of a block of code by trying all possible sequences of instructions that produce the same result. This paper presents a novel approach for super-optimization of smart contracts based on Max-SMT which is split into two main phases: (i) the extraction of a stack functional specification from the basic blocks of the smart contract, which is simplified using rules that capture the semantics of the arithmetic, bit-wise, relational operations, etc. (ii) the synthesis of optimized blocks which, by means of an efficient Max-SMT encoding, finds the bytecode blocks with minimal gas cost whose stack functional specification is equal (modulo commutativity) to the extracted one. Our experimental results are very promising: we are able to optimize 55.41 % of the blocks, and prove that 34.28 % were already optimal, for more than 61000 blocks from the most called 2500 Ethereum contracts. 2020-06-13 /pmc/articles/PMC7363236/ http://dx.doi.org/10.1007/978-3-030-53288-8_10 Text en © The Author(s) 2020 Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made. The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.
spellingShingle Article
Albert, Elvira
Gordillo, Pablo
Rubio, Albert
Schett, Maria A.
Synthesis of Super-Optimized Smart Contracts Using Max-SMT
title Synthesis of Super-Optimized Smart Contracts Using Max-SMT
title_full Synthesis of Super-Optimized Smart Contracts Using Max-SMT
title_fullStr Synthesis of Super-Optimized Smart Contracts Using Max-SMT
title_full_unstemmed Synthesis of Super-Optimized Smart Contracts Using Max-SMT
title_short Synthesis of Super-Optimized Smart Contracts Using Max-SMT
title_sort synthesis of super-optimized smart contracts using max-smt
topic Article
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7363236/
http://dx.doi.org/10.1007/978-3-030-53288-8_10
work_keys_str_mv AT albertelvira synthesisofsuperoptimizedsmartcontractsusingmaxsmt
AT gordillopablo synthesisofsuperoptimizedsmartcontractsusingmaxsmt
AT rubioalbert synthesisofsuperoptimizedsmartcontractsusingmaxsmt
AT schettmariaa synthesisofsuperoptimizedsmartcontractsusingmaxsmt