Detection of Vulnerabilities in Cryptocurrency Smart Contracts Based on Image Processing

Detection of Vulnerabilities in Cryptocurrency Smart Contracts Based on Image Processing

Gabbi Evrard Tchoukouegno De Mofo (University of Ngaoundéré, Cameroon), Ali Joan Beri Wacka (University of Buea, Cameroon), Franklin Tchakounte (University of Ngaoundéré Cameroon), and Jean Marie Kuate Fotso (Ministry of Scientific Research and Innovation, Cameroon & University of Ngaoundéré, Cameroon)
DOI: 10.4018/978-1-6684-8127-1.ch004
OnDemand:
(Individual Chapters)
Available
$37.50
No Current Special Offers
TOTAL SAVINGS: $37.50

Abstract

The rate of use of cryptocurrencies through smart contracts and decentralized applications remains continually increasing. Ethereum is particularly gaining popularity in the blockchain community. In this work, the authors are interested in retraining vulnerability and timestamping. They propose a detection method based on the transformation of contracts into images and the processing of the latter using Simhash and n-gram techniques to obtain our contracts into images of size 32*32. They combine a technique to preserve the useful characteristics of images for exploitation. Training carried out with the convolutional neuronal network (CNN) model on a sample of 50 normal contracts, 50 contracts vulnerable to retraining, and 33 vulnerable to timestamping gave an accuracy of 88.98% on the detection of vulnerable contracts. The singular value decomposition (SVD) technique is capable of efficiently extracting from images, the key features that characterize contracts in Ethereum.
Chapter Preview
Top

1. Introduction

A cryptocurrency is a digital, decentralized and virtual currency (no need for banknotes, coins, credit cards, checkbooks) which uses cryptographic algorithms and a protocol called blockchain to ensure the reliability and traceability of transactions.

The idea of this currency dates back to the 1980s. But in concrete terms, we will have, in 1983, David Chaum who will introduce the possibility of withdrawing money electronically from a bank and then spending it at merchants accepting this method of payment (Yazid, 2023). In 1998, Wei Dai was the first to propose the creation of virtual currencies through consensus. He did not issue details about the implementation of the consensus method (Sudhani, Divakar, & Girish, 2022). In 2008, Satoshi Nakamoto unveiled Bitcoin (Paul, 2023), considered the first successful project that was implemented on the blockchain. To ensure its operation, the creator unveils the “proof-of-work” consensus method. This allows peers in the network to communicate with each other and agree on the validity of transactions. However, there are so many cryptocurrencies (Figure 1) these days that it can be difficult to tell them apart. We can have in others: coins, the store of value, the means of exchange, the “exchange” of tokens, Decentralized Finance (DEFI), smart contract platforms (ADAM, 2023). Since its creation, the rate of users of cryptocurrencies has continued to grow over the years. At the end of 2019, there were nearly 2,400 cryptocurrencies on the coin-marketcap site (Vitalik). In 2015, the Ethereum cryptocurrency brought a major innovation to the field of blockchains. This platform enabled the development and deployment of applications on blockchains.

Figure 1.

Popular cryptocurrencies in 2020 (Conti et al., 2018)

978-1-6684-8127-1.ch004.f01
Top

2. Smart Contracts And Mining

2.1 Smart Contract

Smart contracts are scripts stored on the blockchain. They have a unique address (Joonseok, Sumin, & Keunhyuk, 2023).

A Smart Contract, as Vitalik Buterin describes it, is “a program that directly controls digital assets”. Vitalik Buterin is the senior developer who imagined ETHEREUM, sometimes referred to as bitcoin 2.0 (Roberto, 2019).

A smart contract can define rules, like a normal contract, and enforce them automatically through code. These contracts have a wide range of possibilities (Monika & Gernot, 2019; Sujeetha and Preetha, 2021):

  • Operate as multi-signature accounts implementing additional conditions, such as the fact that funds can only be spent when a defined percentage of signatories agree;

  • Manage agreements between users, like traditional contractual agreements;

  • Can be used by other contracts, so that they “offset” certain functionalities to existing contracts;

  • Store information about an app, such as app member logs.

The blockchain makes it possible to secure and verify the data allowing the execution of a smart contract; it is not possible to modify the conditions of the contract once deployed. A smart contract has several advantages (Antonios, Christos, & Georgios, 2023):

  • Security: All data exchanged by the smart contract is protected by cryptography. It will be very difficult for a hacker to crack them;

  • Autonomy: A smart contract deployed on the blockchain does not require any intervention from a third person to carry out the various operations programmed for it;

  • Saving money: A smart contract makes it possible to eliminate the “man in the middle” (a notary in the case of a sale of real estate, for example). In this case, it allows you to save notary fees;

  • Speed: As smart contracts replace the intermediary in the case of a transaction, the time spent on paperwork is no longer necessary; so we save time.

Different programming languages have been developed for the implementation of smart contracts, such as: Solidity, Serpent, Pact, Viper, Liquidity, Chaincode, or even Mutan (Lee, Purnima, Jonathan, & Peter) (Majd, · Gısli, & Mohammad).

Complete Chapter List

Search this Book:
Reset