Im Zeitalter der Kryptowährungen gewinnt die zugrunde liegende Blockchain-Technologie an Relevanz. Während die erste Kryptowährung Bitcoin eine Plattform mit eingeschränkten Funktionen für Programme auf ihrer Blockchain ist, konzentrieren sich einige der Nachfolger ausdrücklich auf blockchainbasierte Programme, die häufig als Smart Contracts bezeichnet werden. Ein etabliertes Beispiel ist die Plat...
Im Zeitalter der Kryptowährungen gewinnt die zugrunde liegende Blockchain-Technologie an Relevanz. Während die erste Kryptowährung Bitcoin eine Plattform mit eingeschränkten Funktionen für Programme auf ihrer Blockchain ist, konzentrieren sich einige der Nachfolger ausdrücklich auf blockchainbasierte Programme, die häufig als Smart Contracts bezeichnet werden. Ein etabliertes Beispiel ist die Plattform Ethereum, die nicht nur eine eigene Kryptowährung bereitstellt, sondern mithilfe ihrer universellen virtuellen Maschine (EVM) auch die Entwicklung verschiedener blockchainbasierter Anwendungen ermöglicht. Die EVM ist eine quasi Turing-vollständige, stackbasierte Maschine, die den Bytecode der Smart Contracts auf Ethereum ausführt. Smart Contracts werden jedoch üblicherweise in der Hochsprache Solidity implementiert und zu EVM-Bytecode kompiliert, bevor sie in der Ethereum-Blockchain bereitgestellt werden. Smart Contracts werden häufig für Anwendungen eingesetzt, die mit Vermögenswerten umgehen und bei Fehlern Geldverluste verursachen können. Daher ist die Prüfung des EVM-Bytecodes von Smart Contracts ein wertvolles Mittel zur Analyse. Dieser Bytecode ist jedoch für Menschen schwer zu lesen. Obwohl viele Anwendungen in Solidity entwickelt wurden, ist der Code dieser Applikationen häufig erst nach der Kompilierung als EVM-Bytecode verfügbar. Daher ist eine Dekompilierung erforderlich, die den Bytecode zurück in eine höhere Programmiersprache übersetzt, um ihn besser lesbar zu machen. Da hinsichtlich der Dekompilierung des EVM-Bytecodes noch Forschungsbedarf besteht, soll in dieser Arbeit untersucht werden, inwieweit dieses Problem gelöst werden kann. Wir untersuchen vorhandene Tools und Methoden zum Dekompilieren von Smart Contracts. Darüber hinaus untersuchen wir die Struktur des EVM-Bytecodes. Basierend auf diesen Ergebnissen entwickeln wir den Prototyp Soldec, der den Open-Source-Decompiler Erays erweitert und verbessert. Schließlich evaluieren wir den Prototyp hinsichtlich seiner Fähigkeit, Solidity-ähnlichen Code zu rekonstruieren.
de
In the age of cryptocurrencies, the underlying blockchain technology is gaining relevance. While the first cryptocurrency Bitcoin is a platform with limited capabilities for programs on its blockchain, some of its successors put an explicit focus on blockchain-based programs often called smart contracts. A well-established example is the platform Ethereum, which not only provides its own cryptocur...
In the age of cryptocurrencies, the underlying blockchain technology is gaining relevance. While the first cryptocurrency Bitcoin is a platform with limited capabilities for programs on its blockchain, some of its successors put an explicit focus on blockchain-based programs often called smart contracts. A well-established example is the platform Ethereum, which not only provides its own cryptocurrency, but also enables the development of various blockchain-based applications by means of its general-purpose virtual machine (the EVM). The EVM is a quasi-Turing-complete stack-based machine that executes the bytecode of the smart contracts on Ethereum. However, smart contracts are commonly implemented in the high-level language Solidity and compiled to EVM bytecode before being deployed onto the Ethereum blockchain.Smart contracts are often employed for applications that handle valuable assets and if erroneous, may cause money losses. Therefore, the examination of the EVM bytecode of smart contracts is a valuable means for analysis. However, this bytecode is hard to read for humans. Even though many applications are developed in Solidity, the code of these applications often is only available as EVM bytecode after compilation. Decompilation is therefore required, which translates the bytecode back into a higher programming language in order to make it easier to read.Since there is still a need for research in regard to the decompilation of EVM bytecode, the aim of this thesis is to investigate to what extent this issue can be solved. We survey existing tools and methods for decompiling smart contracts. Moreover, we explore the structure of EVM bytecode. Based on these results we develop the prototype Soldec, which extends and improves on the open-source decompiler Erays. Finally, we evaluate the prototype regarding its ability to reconstruct Solidity-like code.