Raab, R. (2021). Towards platform-agnostic smart contracts [Diploma Thesis, Technische Universität Wien]. reposiTUm. https://doi.org/10.34726/hss.2021.93502
Durch den Erfolg von Kryptowährungen über die letzten Jahre ist auch das Interesse an der darunterliegenden Technologie gestiegen. Wissenschaftler aus verschiedensten Bereichen untersuchen, ob Blockchains für ihre Zwecke verwendet werden können. Dieses große Forschungsinteresse sorgt für schnelle Entwicklung und damit auch für rasche Veränderung. Dies hindert vor allem im kommerziellen Bereich die Adaption von Blockchains, da hohe Risiken mit der Wahl einer nicht zukunftsträchtigen Technologie verbunden sind. Ein Weg um die Adaption von Blockchain-Technologie voranzutreiben und das damit verbundene Risiko zu mindern, ist die Entwicklungsarbeit für verteilte Applikationen plattformunabhängig zu gestalten. Aus diesem Grund hat sich diese Arbeit das Ziel gesetzt zu zeigen, dass es möglich ist, Smart Contracts unabhängig von der darunterliegenden Plattform zu definieren und anzusprechen. Um dieses Ziel zu erreichen wurde die Ledger Access (LA) API entwickelt. Die LA API enthält ein Programmiermodell für Smart Contracts welches es ermöglicht, das Datenmodell, die Geschäftslogik und die Konsensregeln zu definieren. Die Ausführung eines solchen Kontraktes funktioniert über eine Abstraktion der Client APIs der unterstützten Plattformen. Ein universeller Kontrakt, welcher im Zielnetzwerk installiert ist, nimmt die Kommandos über die Client API entgegen und führt die gewünschte Transaktion aus. Es wurden zwei Plattform ausgewählt, welche stellvertretend für die breite Bandbreite und verfügbaren Plattformen stehen. Hyperledger Fabric und Corda sind beide beliebte Plattformen, welche zwar ähnliche Ziele verfolgen, sich allerdings in vielen Bereichen stark unterscheiden. Die Kompatibilität von LA API mit diesen beiden Plattformen zeigt, dass die LA API mit verschiedensten Plattformen verwendet werden kann. Zusätzlich wurde eine Referenz-Implementierung erstellt, welche anstatt einer Blockchain eine SQL-Datenbank als Datenspeicher verwendet. Die Referenz- Implementierung wurde verwendet, um die Plattform-Integrationen für Corda und Fabric zu evaluieren. Dabei wird davon ausgegangen, dass die Referenz-Implementierung immer das richtige Ergebnis liefert. Die Corda und Fabric Implementierungen müssen unter allen Umständen das gleiche Ergebnis liefern, um zu zeigen, dass sie korrekt implementiert wurden und die vorgegebenen Anforderung erfüllen. Es wurde eine Reihenfolge von Interaktionen definiert welche alle zuvor erhobenen Anforderungen abdecken. Diese Interaktionen wurden dann auf allen drei Plattformen (Referenz, Corda, Fabric) ausgeführt. Ein Vergleich der Ergebnisse hat ergeben, dass alle Implementierungen das gleiche Ergebnis liefern. Durch diesen Proof of Concept wurde bestätigt, dass plattformunabhängige Smart Contracts möglich sind.
de
The success of cryptocurrency over the last few years has generated a lot of interest in the underlying technology. Scientists from various research areas are trying to adopt blockchain technology. This research interest drives rapid development and causes frequent technological changes. Commercial adoption of blockchain technology is currently limited because adopting a technology that may not be successful brings a lot of risk for enterprises. One way to reduce this risk and advance the adaption of blockchain technology is to make the development of distributed blockchain applications platform-independent. For this reason, the goal of this work was to show that it is possible to develop and execute smart contracts independent from the underlying target platform. To reach this goal, the Ledger Access (LA) API was developed. The LA API provides a programming model that allows the data model, the business logic, and the consensus rules of smart contracts to be defined independent from the underlying platform. The execution of such contracts works by utilizing an abstraction over the client APIs of the supported platforms. A universal contract installed on the target platform receives commands over the client API and executes the respective transaction. Two different platforms representative of the wide variety of blockchain platforms on the market were selected. Hyperledger Fabric and Corda are both widely used platforms that follow similar goals, but are different in many aspects. The compatibility of the LA API with these two platforms shows that the LA API can be used with a wide range of platforms. In addition, a reference implementation that uses an SQL database instead of a blockchain in the background was created. The reference implementation was used to evaluate the presented platform integrations for Fabric and Corda. For that, it is assumed that the reference implementation always returns the correct result. All other adapters have to return the same result under all circumstances. To test the functionality of the integrations, a use case was designed and implemented. A scenario containing all the important requirements was developed from the use case. This scenario was executed on all three platforms (Reference, Fabric, and Corda) and the results were compared. The comparison showed that all executions on all platforms delivered the same results. This proof-of-concept confirms that it is possible to create and execute platform-agnostic smart contracts.