scieee AI-readable full text Open interactive document viewer

Enhancing Smart Contract Security: A Machine Learning Framework Using Natural Language Processing and Unsupervised Techniques

Macovei, Andrei

Abstract

This thesis explored smart contract security using natural language processing and unsupervised machine learning techniques. By analyzing reports from Code4Arena and applying k-means and Latent Dirichlet Allocation, I aimed to identify trends in smart contract usage, vulnerabilities, and potential attack methods. My analysis yielded valuable insights for blockchain developers and cybersecurity professionals. The research identified trends in smart contract security threats and the potential of using machine learning for vulnerability detection. I propose a framework to enhance smart contract security based on real-world case studies and data from various blockchain platforms. This framework, informed by the identified trends, can contribute to building more secure blockchain ecosystems. The results indicate that the developed pipeline can efficiently evaluate various smart contracts, uncovering new vulnerabilities and attack types using a severity score.

Full text

Master Degree Program in Data Science and Advanced Analytics Enhancing Smart Contract Security: A Machine Learning Framework Using Natural Language Processing and Unsupervised Techniques NOVA Information Management School Instituto Superior de Estatística e Gestão de Informação Master Degree Program in Data Science and Advanced Analytics Enhancing Smart Contract Security: A Machine Learning Framework Using Natural Language Processing and Unsupervised Techniques Macovei Andrei Master Thesis NOVA Information Management School Instituto Superior de Estatística e Gestão de Informação Universidade Nova de Lisboa Enhancing Smart Contract Security: A Machine Learning Framework Using Natural Language Processing and Instituto Superior de Estatística e Gestão de Informação NOVA Information Management School Instituto Superior de Estatística e Gestão de Informação Universidade Nova de Lisboa Enhancing Smart Contract Security: A Machine Learning Framework Using Natural Language Processing and Unsupervised Techniques by Macovei Andrei Master Thesis presented as partial requirement for obtaining the Master’s degree in Data Science and Advanced Analytics, with a specialization in Business Analytics Supervised by Ian James Scott, PhD, NOVA Information Management School June, 2024 i STATEMENT OF INTEGRITY I hereby declare having conducted this academic work with integrity. I confirm that I have not used plagiarism or any form of undue use of information or falsification of results along the process leading to its elaboration. I further declare that I have fully acknowledged the Rules of Conduct and Code of Honor from the NOVA Information Management School. [Lisbon, July 12,2024] ii DEDICATION I want to dedicate this thesis to my family for allowing me to pursue this master's degree here and to my fiancée, Atenea, who has supported me. iii ACKNOWLEDGEMENTS I would like to express my gratitude to Professor Ian James Scott for trusting me with the chance to write this thesis under his guidance. Working with the professor was a pleasure, and his advice was useful in finishing my master's thesis. This thesis explored smart contract security using natural language proce unsupervised machine learning techniques. By analyzing reports from Code4Arena and applying kmeans and Latent Dirichlet Allocation, I aimed to identify trends in smart contract usage, vulnerabilities, and potential attack methods. My analysis yi blockchain developers and cybersecurity professionals. The research identified trends in smart contract security threats and the potential of using machine learning for vulnerability detection. I propose a framework to enhance s case studies and data from various blockchain platforms. This framework, informed by the identified trends, can contribute to building more secure blockchain ecosystems. indicate that the developed uncovering new vulnerabilities and attack types using a severity Natural language processing; Blockchain Sustainable Development ABSTRACT This thesis explored smart contract security using natural language proce unsupervised machine learning techniques. By analyzing reports from Code4Arena and means and Latent Dirichlet Allocation, I aimed to identify trends in smart contract usage, vulnerabilities, and potential attack methods. My analysis yi elded valuable insights for blockchain developers and cybersecurity professionals. The research identified trends in smart contract security threats and the potential of using machine learning for vulnerability detection. I propose a framework to enhance s mart contract security based on real case studies and data from various blockchain platforms. This framework, informed by the identified trends, can contribute to building more secure blockchain ecosystems. indicate that the developed pipeline can efficiently evaluate various smart contracts, uncovering new vulnerabilities and attack types using a severity score. KEYWORDS Natural language processing; Blockchain ; Smart contracts; Smart contract security Sustainable Development Goals (SDG): iv This thesis explored smart contract security using natural language proce ssing and unsupervised machine learning techniques. By analyzing reports from Code4Arena and means and Latent Dirichlet Allocation, I aimed to identify trends in smart contract elded valuable insights for blockchain developers and cybersecurity professionals. The research identified trends in smart contract security threats and the potential of using machine learning for vulnerability mart contract security based on real -world case studies and data from various blockchain platforms. This framework, informed by the identified trends, can contribute to building more secure blockchain ecosystems. The results pipeline can efficiently evaluate various smart contracts, Smart contracts; Smart contract security v TABLE OF CONTENTS Statement of Integrity ........................................................................................................ i Dedication ......................................................................................................................... ii Acknowledgements .......................................................................................................... iii Abstract ............................................................................................................................ iv List of Figures ................................................................................................................... vii List of Tables ................................................................................................................... viii List of Abbreviations and Acronyms ................................................................................. ix 1. Introduction .................................................................................................................. 1 2. Literature review .......................................................................................................... 2 2.1. Blockchain and smart contracts ............................................................................ 2 2.1.1. Blockchain and Smart contract elements ...................................................... 2 Transactions .......................................................................................................... 3 Cryptographic Hash Function ................................................................................ 3 2.2. Smart Contracts ..................................................................................................... 4 2.2.1. Oracles ............................................................................................................ 5 2.2.2. Security of Smart Contracts ............................................................................ 6 2.2.3. Vulnerability Types of a Smart Contract ........................................................ 6 2.2.4. Smart Contracts Attack Types ........................................................................ 7 2.2.5. Smart Contracts Protection Techniques ...................................................... 10 2.2.6. Natural language processing ........................................................................ 12 2.2.7. NLP-classified smart contract vulnerabilities ............................................... 13 2.2.8. Smart contract reports analysis ................................................................... 14 2.2.9. Real word projects ........................................................................................ 15 2.2.10.Summary and gap ....................................................................................... 15 3. Methodology .............................................................................................................. 17 3.1. Data Collection .................................................................................................... 17 3.2. Data Preprocessing .............................................................................................. 17 3.3. Modelling ............................................................................................................. 18 4. Results and discussion ................................................................................................ 28 4.1. Results ................................................................................................................. 28 4.2. Discussion ............................................................................................................ 36 5. Conclusions and future works .................................................................................... 37 5.1. Conclusions .......................................................................................................... 37 5.2. Future Works ....................................................................................................... 38 vi Bibliographical References .............................................................................................. 39 Appendix A ...................................................................................................................... 46 Appendix B ...................................................................................................................... 47 Appendix c ....................................................................................................................... 48 Appendix D ...................................................................................................................... 49 Appendix E ....................................................................................................................... 50 vii LIST OF FIGURES Figure 1 - Simplified Blockchain schema (Bosu et al., 2019) ...................................................... 2 Figure 2 – SHA-256 Hash Algorithm (Baivab Kumar Jena, 2024) ............................................... 3 Figure 3 – How Smart Contracts Work (Hines, 2021) pag 54..................................................... 4 Figure 4 – How Oracle works (CoinCodeCap, 2023) .................................................................. 5 Figure 5 – A Classification of Exploitation Based on the Fragile Method (Sayeed et al., 2020) pag 3. .................................................................................................................................. 7 Figure 6 – Smart Contract Attacks and Protections Overview. (Sayeed et al., 2020) pag 1. ..... 9 Figure 7 - DDoS attack schema (Kumar et al., 2021) ................................................................ 10 Figure 8 - Smart contract security vulnerabilities and testing procedures. (Gupta et al., 2020) pag 9. ................................................................................................................................ 11 Figure 9 - Text Processing Steps before modelling (Analytics Vidhya & Chaitanya Krishna Kasaraneni, 2020) ............................................................................................................. 12 Figure 10 - The process of vulnerability analysis (Li et al., 2023) pag 6. ................................. 13 Figure 11 - How a Ponzi Schema Works (Michael Henris, 2019) ............................................. 14 Figure 12 - Empirical research pseudocode ............................................................................. 18 Figure 13 - Preprocessing for the second notebook using tokenize and BERT ........................ 20 Figure 14 - K-mean algorithm (Leo, 2024) ............................................................................... 21 Figure 15 - Euclidian distance ................................................................................................... 21 Figure 16 - Elbow Method to determine the k number of clusters ......................................... 22 Figure 17 - Silhouette Analysis for Optimal k ........................................................................... 23 Figure 18 – How Latent Dirichlet Allocation works (Naskar, 2019) ......................................... 24 Figure 19 - Perplexity formula (Hörster et al., 2007). .............................................................. 24 Figure 20 - Pseudocode Evaluating an LDA Model for Text Analysis ....................................... 25 Figure 21 - Pseudocode shows cluster vulnerabilities and attack types ................................. 26 Figure 22 - Severity Rating (National Institute of Standards and Technology, 2024) .............. 27 Figure 23 - Empirical Study Results .......................................................................................... 28 Figure 24 - Cluster of topics ..................................................................................................... 29 Figure 25 – Number of potential Vulnerabilities per Cluster ................................................... 30 Figure 26 - Vulnerabilities and attack types from human detection cluster ........................... 31 Figure 27 - Vulnerabilities and attack types from machine detection cluster ......................... 31 Figure 28 - Vulnerabilities and attack types from unknown detection cluster ....................... 32 Figure 29 - LDA with Non-negative Matrix to extract topics from clusters ............................ 32 Figure 30 - Top ten most dangerous vulnerabilities in smart contracts .................................. 35 Figure 31 - LDA Perplexity evaluation ...................................................................................... 35 2.2. SMART CONTRACTS Contracts play a crucial role in the success of a business by outlining legal responsibili ownership r ights for all parties involved. transactions, ensure mutual unde technology incorporates encryption, timestamping, con methods to create a decentralized system that safeguards user privacy and data integrity (Wu et al., 2021). Smart contracts are complex programs incorpor (Lantz & Cawrey, 2020). The concept of using smart contracts as a digital transaction mechanism to carry out an agreement's terms initially put forth in the 1990s. (Pay to Pubkey) and P2PH (Pay to Pubkey Hash) contracts are simply encapsulated and replicated in smart contracts, w containers of code (Taherdoost, 2023) Figure 3 – How Smart Contracts Work Every time a contract method is invoked, the node the chain, b y figuring out how to execute the transaction and understanding it, the contract state can be updated (Weerapanpisit et al., 2022) the network, the other nodes will alter their contract states in a similar manner (Weerapanpisit et al., 2022). Smart contracts are incredibly adaptable to manage substantial quantities of data and value while executing immutable logic bas on blockchaindeployed code. trustless apps has emerged, offering several benefits over o they offer chances for hackers who want to make money by taking advantage of holes in smart contracts (Ethereum.org, 2024) Contracts play a crucial role in the success of a business by outlining legal responsibili ights for all parties involved. They establish the guidelines for business transactions, ensure mutual unde rstanding, and settle disputes (Hines, 2021) technology incorporates encryption, timestamping, con sensus, smart contracts, and other methods to create a decentralized system that safeguards user privacy and data integrity Smart contracts are complex programs incorpor ated into bl The concept of using smart contracts as a digital transaction carry out an agreement's terms ,which can be observed initially put forth in the 1990s. The first "smart" contract developed by Bitcoin features P2PK (Pay to Pubkey) and P2PH (Pay to Pubkey Hash) (van Flymen, 2020). The terms of real contracts are simply encapsulated and replicated in smart contracts, w (Taherdoost, 2023) . How Smart Contracts Work (Hines, 2021) pag 54. Every time a contract method is invoked, the node will add the methodca y figuring out how to execute the transaction and understanding it, the contract (Weerapanpisit et al., 2022) . After the transaction has been sent over the network, the other nodes will alter their contract states in a similar manner Smart contracts are incredibly adaptable and have the capacity to manage substantial quantities of data and value while executing immutable logic bas deployed code. As a result, a thriving ecosystem of decentralized and trustless apps has emerged, offering several benefits over o utdated methods. Additionally, they offer chances for hackers who want to make money by taking advantage of holes in (Ethereum.org, 2024) . 4 Contracts play a crucial role in the success of a business by outlining legal responsibili ties and They establish the guidelines for business (Hines, 2021) . Blockchain sensus, smart contracts, and other methods to create a decentralized system that safeguards user privacy and data integrity ated into bl ockchains The concept of using smart contracts as a digital transaction ,which can be observed in figure 3, was Bitcoin features P2PK The terms of real -world contracts are simply encapsulated and replicated in smart contracts, w hich are actually ca lling transaction to y figuring out how to execute the transaction and understanding it, the contract . After the transaction has been sent over the network, the other nodes will alter their contract states in a similar manner and have the capacity to manage substantial quantities of data and value while executing immutable logic bas ed As a result, a thriving ecosystem of decentralized and utdated methods. Additionally, they offer chances for hackers who want to make money by taking advantage of holes in 5 2.2.1. Oracles Oracles are intermediary agents that can collect and authenticate data from the outside world and feed it to a blockchain for usage by smart contracts. They could be inbound or external, consensus-based software or hardware. While humans can serve as oracles to start communication between the on-chain and off-chain worlds, doing so is interruptive, timeconsuming, and error-prone (Lu et al., 2021). Oracles play a crucial role in smart contracts by providing access to real-world data, ensuring accurate and reliable inputs, and expanding the functionality and applicability of smart contracts across various industries (Beniiche, 2020), as can be seen in figure below. Here's how they function:  Data Retrieval - Oracles gather information from various sources, including APIs, sensors, and offchain data providers (Mühlberger et al., 2020).  Verification- Oracles verify the accuracy and validity of data after retrieving it (Khan et al., 2021).  On-Chain Transmission - Once confirmed, oracles securely send external data to the blockchain. Smart contracts can then carry out conditional actions depending on this data (trakx, 2024). Figure 4 – How Oracle works (CoinCodeCap, 2023) 6 2.2.2. Security of Smart Contracts According to (Chaliasos et al., 2023) the necessity for dependable and safe smart contract development has increased due to the rapid growth of the blockchain-based, smart contract-based decentralized finance (DeFi) ecosystem. However, there is an increase in smart contract attacks, which are thought to have resulted in losses of $6.45 billion. Because smart contracts are written in resource-intensive programming languages such as Solidity, they can contain exploitable vulnerabilities or programming errors that are hard to rectify and are frequently missed or found only after the contract has been deployed on the blockchain (Sendner et al., 2023). The immutability of the blockchain has contributed to technology’s increased reach in recent years. However, if there is a security issue with the smart contract on the chain after it becomes immutable, clients will suffer significant financial losses. Determining the vulnerabilities in smart contracts is essential. There are two primary categories of smart contract vulnerability detection: automatic detection and detection by humans (Ma et al., 2023). The problem of safeguarding smart contracts is made more difficult by public blockchains like Ethereum. There are some flaws in the programming languages that the smart contract is built in, including problems with endless loops, arithmetic errors, memory allocation issues, and unintentional mistakes that might result in reentrancy issues and money loss (Porkodi & Kesavaraja, 2023). Static analysis tools, dynamic analysis tools, or machine learning-based techniques can all be used to analyze a smart contract's vulnerabilities.  Static Analysis Tools - Tools for static analysis rely on analyzing smart contracts without running them. The static tool's property is that it typically obtains a high coverage rate (Mi et al., 2023).  Dynamic Analysis Tools - A few tools for dynamic analysis are available. Some rely on constraint solvers' symbolic execution, while others use test cases as program input and examine the outcomes (Mi et al., 2023).  Machine learning-based Tools - Several studies tried to automate the process of smart contract detection by using machine learning techniques, use simple machine learning algorithms to find vulnerabilities (Mi et al., 2023). 2.2.3. Vulnerability Types of a Smart Contract As an element of software, smart contracts are inherently fragile, and their vulnerability continues growing (Deng et al., 2023). Hackers can take advantage of a variety of vulnerabilities to cause major issues and financial loss, as shown in the figure below. Figure 5 – A Classi fication of Vulnerabilities in smart contracts are weaknesses in security or gaps in the contract that can be used to change terms or steal technology, once a smart contract is implemented on the blockchain, it is impossible to alter the code— not even when a vulnerability is found susceptible to a variety of vulnerabilities, with the most common ones listed below being those that hackers can use to compromise a smart contract.  Malicious Acts - Vulnerable smart contracts can be used by a malicious person to access blockchain data  Weak Protocol - The blockchain is driven by protocols, as opposed to conventional databases and networks. The flaws in the protocol could result in an abrupt takeover of the system by hackers  Defraud - starting a flash loan that led to a smart contract exploit on the DeFi platform, which caused investors and the project's developers to Bureau of Investi gation, 2022)  Application Bugs - Because of their non make it difficult to upgrade given programs or fix defects by simply releasing new software versions (Destefanis et al., 2018) 2.2.4. Smart Contracts Attack T There have been numerous attacks on blockchain (Ivanov et al., 2021). A selection of the attacks that can happen w provided below, also a schema fication of Exploitation Based on the Fragile Method al., 2020) pag 3. Vulnerabilities in smart contracts are weaknesses in security or gaps in the contract that can be used to change terms or steal resources. Because of the immutability of blockchain technology, once a smart contract is implemented on the blockchain, it is impossible to alter not even when a vulnerability is found (Chen et al., 2023). Smart contracts are susceptible to a variety of vulnerabilities, with the most common ones listed below being those that hackers can use to compromise a smart contract. Vulnerable smart contracts can be used by a malicious person to access blockchain data (Gupta et al., 2022). blockchain is driven by protocols, as opposed to conventional databases and networks. The flaws in the protocol could result in an abrupt takeover of the system by hackers (Innocent, 2020). starting a flash loan that led to a smart contract exploit on the DeFi platform, which caused investors and the project's developers to l ose gation, 2022) . Because of their non -standard software lifecycle, smart contracts make it difficult to upgrade given programs or fix defects by simply releasing new (Destefanis et al., 2018) . Attack T ypes There have been numerous attacks on blockchain and smart contracts in the past few years A selection of the attacks that can happen w ith smart contracts is also a schema . 7 Exploitation Based on the Fragile Method (Sayeed et Vulnerabilities in smart contracts are weaknesses in security or gaps in the contract that can resources. Because of the immutability of blockchain technology, once a smart contract is implemented on the blockchain, it is impossible to alter Smart contracts are susceptible to a variety of vulnerabilities, with the most common ones listed below being Vulnerable smart contracts can be used by a malicious person to blockchain is driven by protocols, as opposed to conventional databases and networks. The flaws in the protocol could result in an abrupt takeover starting a flash loan that led to a smart contract exploit on the DeFi ose money (Federal cycle, smart contracts make it difficult to upgrade given programs or fix defects by simply releasing new smart contracts in the past few years ith smart contracts is 8  Reentrancy attack - One of the frequent risks on the Ethereum blockchain, related to the Solidity programming language, is reentrancy attacks. Attacks occur when an outsider uses a smart contract's external call to force the contract to run extra code by calling itself using a fallback function (Alkhalifah et al., 2021).  Front-running - Front-running attacks are possible because the users' activities and signatures used to invoke this contract are made public once the relayer submits the transaction (Zhang et al., 2023).  Integer overflow - In the event of an integer overflow, the software keeps running the next line of code without explicitly throwing an exception. Thus, it is very crucial to test smart contracts for integer overflow errors (Sun et al., 2022).  Simple logic error - Since formal verification offers a strict mathematical model for smart contract verification to cover the entire program without omitting any situations, it can uncover new or unknown vulnerabilities as well as logical errors (Y. Wang et al., 2021).  Block gas limit vulnerability - When the gas limit for the smart contract execution is exceeded, an out-of-gas exception is triggered, stopping the current execution (Khan et al., 2021).  Default visibility - Functions in Solidity can be made external, public, internal, or private via visibility specifiers. When these visibility specifiers are used incorrectly, smart contracts become susceptible to attack and attract attackers (Kushwaha et al., 2022).  Timestamp dependence (Yatchenko, 2022) - The timestamp is often set to the local system time of the miner. The miner can alter this number while still getting the block accepted by other miners, though. When the timestamp is utilized as a trigger condition to carry out particular actions (like delivering money), there is a security risk since the attacker can influence the outcome of the contract by using different block timestamps (S. Wang et al., 2018).  The DAO, or Decentralized Autonomous Organization, was founded in May 2016 as a venture capital fund focused on the decentralized and cryptocurrency industries. Anyone might deposit Ether to a specific wallet address to receive DAO tokens during the DAO's founding phase (Samreen & Alalfi, 2021). Figure 6 – Smart Contract Attacks and Protections Overview. An online application vulnerability known as cross run a script in the user's brows the internet no wadays is cross A backdoor attack is a method of getting past a computer system's standard security measures and accessing encrypted data. To enable access to an operating system (OS), data, or application for debugging or other uses, a developer may build a backdoor. Attackers utilize backdoors installed by software developers as well as backdoors they install on their own as a component One prevalent risk in smart contracts is race circumstances change the same state variable at the same time, a race condition happens. When this occurs, the contract's conclusion becomes unexpected and it is unknown which transaction will be completed first (SoliditySavvy, 2023) A replay attack vulnerability in many smart contract implementations allows attackers to carry out a replay attack in two similar contracts. This is because many smart contracts use the same method to verify the validity of th properly limit the contents of the signature DDOS Attack refers to distributed denial of service assault places utilizing many systems Contract Attacks and Protections Overview. (Sayeed et al., 2020) pag 1. An online application vulnerability known as cross - site scripting (XSS) lets an outside entity run a script in the user's brows er on the website's behalf. One of the most common flaws on wadays is cross -site scripting (geeksforgeeks.org, 2019). A backdoor attack is a method of getting past a computer system's standard security measures and accessing encrypted data. To enable access to an operating system (OS), data, or application for debugging or other uses, a developer may build a backdoor. Attackers utilize backdoors installed by software developers as well as backdoors they install on their own as a component of a computer attack (Ben Lutkevich, 2023). One prevalent risk in smart contracts is race circumstances . When many transactions try to change the same state variable at the same time, a race condition happens. When this occurs, the contract's conclusion becomes unexpected and it is unknown which transaction (SoliditySavvy, 2023) . A replay attack vulnerability in many smart contract implementations allows attackers to carry out a replay attack in two similar contracts. This is because many smart contracts use the same method to verify the validity of th e signature, but the smart contracts need to properly limit the contents of the signature (baizhenxuan, 2018). DDOS Attack refers to distributed denial of service assault s, which occur from a variety of (geeksforgeeks.org, 2020), a s illustrated by the figure below. 9 (Sayeed et al., 2020) site scripting (XSS) lets an outside entity er on the website's behalf. One of the most common flaws on A backdoor attack is a method of getting past a computer system's standard security To enable access to an operating system (OS), data, or application for debugging or other Attackers utilize backdoors installed by software developers as well as backdoors they install . When many transactions try to change the same state variable at the same time, a race condition happens. When this occurs, the contract's conclusion becomes unexpected and it is unknown which transaction A replay attack vulnerability in many smart contract implementations allows attackers to carry out a replay attack in two similar contracts. This is because many smart contracts use e signature, but the smart contracts need to s, which occur from a variety of s illustrated by the figure below. 10 Figure 7 - DDoS attack schema (Kumar et al., 2021) Phishing schemes deceive people into disclosing personal information, installing malware, and exposing themselves or their companies to criminality (Matthew Kosinski, 2024). Phishing attacks are bogus emails, text messages, phone calls, or websites that are intended to fool consumers into doing the following:  Downloading Malware  Sharing sensitive information, like Social Security and credit card numbers, bank account numbers, and login passwords, can put individuals or businesses at risk of cybercrime (Matthew Kosinski, 2024) 2.2.5. Smart Contracts Protection Techniques In recent years, an immense amount of effort has been put into developing techniques and tools for recognizing vulnerabilities and privacy protection to build and implement safe smart contracts (Y. Wang et al., 2021). Following a brief introduction to smart contract vulnerabilities and forms of smart contract attacks found in sections 2.2.3 and 2.2.4, I go over the primary methods for safeguarding the smart contract. Even if they are unable to identify every vulnerability, therefore nefarious users will continue to search for ways to compromise the system. The fundamental instruments used for protection during column testing are shown in the image below. Figure 8 - S mart contract security vulnerabilities and testing procedures  Fuse - A smart contract created by a developer is often ready for testing but not accessible to the general public. Using a web interface, s/he first sends Fuse an encrypted binary of the smart contract to be tested or the URL of a deployed smart contract (Chan & Jiang, 2018)  The Bugs Framework - in an initial review of over one million smart contracts utilizing a single analytical approach for confirming correctness  The goal of GOATCasino sample of the many typical vulnerabilities that are discovered in them so they can see them and not make the same mistakes 2018).  Truffle Framework - represented by the truffle application framework. It is possible to replay an existing transaction on the blockchain, stepping into and over calls, execution of the bytecode, and other features by providing the unique hash of the transaction to the command truffle debug  MythX - MythX performs source code and generates bytecode analyses for smart contracts. After that, MythX combines the output from all three tools to enhance the outcomes from various methods. Mythril is one of the components that uses symbolic execution to go through every route conceivable for a smart contract & Lee, 2020).  Oyente Framework - is a symbolic execution tool released by Melonport to uncover possible security vulnerabilities such as reentrancy, timestamp dependencies, and logic errors in smart contracts mart contract security vulnerabilities and testing procedures 2020) pag 9. contract created by a developer is often ready for testing but not accessible to the general public. Using a web interface, s/he first sends Fuse an encrypted binary of the smart contract to be tested or the URL of a deployed smart (Chan & Jiang, 2018) . - 34,200 Ethereum smart contracts were identified as insecure in an initial review of over one million smart contracts utilizing a single analytical approach for confirming correctness (Ferreira et al., 2020). GOATCasino is to give auditors and developers of smart contracts a sample of the many typical vulnerabilities that are discovered in them so they can see them and not make the same mistakes twice (NCC Gro up Publication Archive, - For debugging smart contracts, modern technology is represented by the truffle application framework. It is possible to replay an existing transaction on the blockchain, stepping into and over calls, single execution of the bytecode, and other features by providing the unique hash of the transaction to the command truffle debug (Hartel & van Staalduinen, 2019) MythX performs source code and generates bytecode analyses for smart After that, MythX combines the output from all three tools to enhance the outcomes from various methods. Mythril is one of the components that uses symbolic execution to go through every route conceivable for a smart contract is a symbolic execution tool released by Melonport to uncover possible security vulnerabilities such as reentrancy, timestamp dependencies, and logic errors in smart contracts (Shi et al., 2021). 11 mart contract security vulnerabilities and testing procedures . (Gupta et al., contract created by a developer is often ready for testing but not accessible to the general public. Using a web interface, s/he first sends Fuse an encrypted binary of the smart contract to be tested or the URL of a deployed smart 34,200 Ethereum smart contracts were identified as insecure in an initial review of over one million smart contracts utilizing a single analytical is to give auditors and developers of smart contracts a sample of the many typical vulnerabilities that are discovered in them so they can up Publication Archive, For debugging smart contracts, modern technology is represented by the truffle application framework. It is possible to replay an existing single -stepping the execution of the bytecode, and other features by providing the unique hash of the (Hartel & van Staalduinen, 2019) . MythX performs source code and generates bytecode analyses for smart After that, MythX combines the output from all three tools to enhance the outcomes from various methods. Mythril is one of the components that uses symbolic execution to go through every route conceivable for a smart contract (Kim is a symbolic execution tool released by Melonport to uncover possible security vulnerabilities such as reentrancy, timestamp dependencies, and 2.2.6. Natural language processing The field of creating ma chines that can control written, spoken, and structured human language, or data that mimics human language, is known as natural language processing (NLP). It developed from computational linguistics, which applies computer science to the study of language principles. However, NLP is an engineering field that aims to create technology that can be used to carry out practical tasks, not theoretical frameworks (deeplearning.ai, 2023). Natural Language Processing (NLP) may be divided into two categories: Natural Language Generation and Natural Language Understanding. NLP advances the process of text generation and comprehension Important measures to take while processing the text befor follows:  Tokenization is the process of locating certain tokens text (Nadkarni et al., 2011)  Part-of-speech assignment to individual words, or "POS tagging," is made more difficult in English by homographs (such as "set") and gerunds (verbs with the suffix "ing" that are employed as nouns)  Morphological breakdown of compound words: understanding many medical phrases, such as "nasogastric," requires  Lemmatization , or reducing suffixes to reduce (Nadkarni et al., 2011) Figure 9 - Text Processing Steps before modelling The next step after phase cleaning is feature extraction, which may involve: BERT training involves corrupting text with an arbitrary noising function and learning a model to recover the original text. The conventional Transformer translation architecture, albeit simple, may be considered generalizable Natural language processing chines that can control written, spoken, and structured human language, or data that mimics human language, is known as natural language processing (NLP). It developed from computational linguistics, which applies computer science to the principles. However, NLP is an engineering field that aims to create technology that can be used to carry out practical tasks, not theoretical frameworks Processing (NLP) may be divided into two categories: Natural Language Generation and Natural Language Understanding. NLP advances the process of text generation and comprehension (Khurana et al., 2023). As demonstrated by the figure below. Important measures to take while processing the text befor e the modeling phase are as is the process of locating certain tokens —wor ds and punctuation (Nadkarni et al., 2011) . assignment to individual words, or "POS tagging," is made more difficult in English by homographs (such as "set") and gerunds (verbs with the suffix "ing" that are employed as nouns) (Nadkarni et al., 2011). breakdown of compound words: understanding many medical phrases, such as "nasogastric," requires a breakdown (Nadkarni et al., 2011) , or reducing suffixes to reduce a word to a root, is a useful subtask (Nadkarni et al., 2011) . Text Processing Steps before modelling (Analytics Vidhya & Chaitanya Krishna Kasaraneni, 2020) The next step after phase cleaning is feature extraction, which may involve: training involves corrupting text with an arbitrary noising function and learning a model to recover the original text. The conventional Transformer - based neural machine translation architecture, albeit simple, may be considered generalizable (Lewis et al., 2019) 12 chines that can control written, spoken, and structured human language, or data that mimics human language, is known as natural language processing (NLP). It developed from computational linguistics, which applies computer science to the principles. However, NLP is an engineering field that aims to create technology that can be used to carry out practical tasks, not theoretical frameworks Processing (NLP) may be divided into two categories: Natural Language Generation and Natural Language Understanding. NLP advances the process of text As demonstrated by the figure below. e the modeling phase are as ds and punctuation —in a assignment to individual words, or "POS tagging," is made more difficult in English by homographs (such as "set") and gerunds (verbs with the suffix breakdown of compound words: understanding many medical (Nadkarni et al., 2011) . a word to a root, is a useful subtask (Analytics Vidhya & Chaitanya The next step after phase cleaning is feature extraction, which may involve: training involves corrupting text with an arbitrary noising function and learning a based neural machine (Lewis et al., 2019) . Generalization is one of the main objectives of training NLP models. The conventional appro ach for evaluation uses train validation model, including the use of leaderboards the wild" is costly and does not allow for quick iterations 2.2.7. NLP- classified smart contract vulnerabilities Smart contract security is becoming more and more been conducted so far have not come up with a common categorization for smart contract vulnerabilities (Wu et al., 2021) there are two main approaches for detecting smart contract vulnerabilities: traditional techniques, which rely on expert development knowledge, and deep learning methods. Deep learning techniques, however, are data vulnerabilities, the accuracy of some machine learning smart contracts' vulnerability identification is limited. Stated alternatively, the accuracy of rewritten codes reduces dramatically from the ori apparent in the figure below. Figure 10 - The process of vulnerability analysis Natural language models may not have detected several types of attacks and vulnerabilities. Some of these frauds may include:  Token Sale Scams investors into sending cryptocurrency to chance to buy a new token that will reportedly have a high value in the (Block Education, 2023a)  Fake ICOs - Scammers create a smart contract that claims to be associated with an Initial Coin Offering  Fake Decentralized Applications (dApps) creating a fake dApp that appears to be authent strategies to promote the dApp and encourage others to invest in it Education, 2023a) .  Honeypot Scams - activities in cybersecurity. For instance, in a "crypto honeypot," the trap is Generalization is one of the main objectives of training NLP models. The conventional ach for evaluation uses train validation -test splits to evaluate the accuracy of the model, including the use of leaderboards to measure progress on a task, because testing "in the wild" is costly and does not allow for quick iterations (Ribeiro et al., 2020) classified smart contract vulnerabilities Smart contract security is becoming more and more of a priority. Still, the studies that have been conducted so far have not come up with a common categorization for smart contract (Wu et al., 2021) . From the viewpoint of technologydriven development, there are two main approaches for detecting smart contract vulnerabilities: traditional techniques, which rely on expert development knowledge, and deep learning methods. Deep learning techniques, however, are data -driven (Deng et al., 202 3) vulnerabilities, the accuracy of some machine learning - based static analysis methods for smart contracts' vulnerability identification is limited. Stated alternatively, the accuracy of rewritten codes reduces dramatically from the ori ginal codes (Ashizawa et al., 2021) The process of vulnerability analysis (Li et al., 2023) Natural language models may not have detected several types of attacks and of these frauds may include: Token Sale Scams - This form of smart contract fraud is intended to dupe investors into sending cryptocurrency to scammers' wallets by offering them the chance to buy a new token that will reportedly have a high value in the (Block Education, 2023a) . Scammers create a smart contract that claims to be associated with an Initial Coin Offering (Block Education, 2023a). Fake Decentralized Applications (dApps) - This sort of fraud involves criminals creating a fake dApp that appears to be authent ic. They employ marketing strategies to promote the dApp and encourage others to invest in it . - A honeypot is a trap designed to detect and divert hostile activities in cybersecurity. For instance, in a "crypto honeypot," the trap is 13 Generalization is one of the main objectives of training NLP models. The conventional splits to evaluate the accuracy of the to measure progress on a task, because testing "in (Ribeiro et al., 2020) . of a priority. Still, the studies that have been conducted so far have not come up with a common categorization for smart contract driven development, there are two main approaches for detecting smart contract vulnerabilities: traditional techniques, which rely on expert development knowledge, and deep learning methods. 3) . Even for known based static analysis methods for smart contracts' vulnerability identification is limited. Stated alternatively, the accuracy of (Ashizawa et al., 2021) . As (Li et al., 2023) pag 6. Natural language models may not have detected several types of attacks and This form of smart contract fraud is intended to dupe scammers' wallets by offering them the chance to buy a new token that will reportedly have a high value in the future Scammers create a smart contract that claims to be associated with This sort of fraud involves criminals ic. They employ marketing strategies to promote the dApp and encourage others to invest in it (Block A honeypot is a trap designed to detect and divert hostile activities in cybersecurity. For instance, in a "crypto honeypot," the trap is Figure 13 - Preprocessing for the second notebook using tokenize and BERT I used K- means clustering and Latent smart contract vulnerabilities were discovered by humans or machines. The next step is to identify the most common vulnerabilities in the reports and prioritize the mo Because I do not hav e labeled data, this group the vulnerabilities based on human, machine, and unknown det clustering, I used LDA to identify the types of vulnerabilities and attacks in each group. K-Means an unsuper vised learning process called clustering seeks to create groups out of the observations in a given dataset. An input of the number of clusters is given. Reducing total distance of points from their mean algorithm divides a collection of data into k distinct clusters, using a predetermined k value. The algorithm c onsists of two distin  The first process involves defining k centroids, one for each cluster.  The next step is to link each point in the data set with the nearest centroid Preprocessing for the second notebook using tokenize and BERT means clustering and Latent Dirichlet Allocation (LDA) to determine whether the smart contract vulnerabilities were discovered by humans or machines. The next step is to identify the most common vulnerabilities in the reports and prioritize the mo e labeled data, this is an unsupervised problem. I used group the vulnerabilities based on human, machine, and unknown det LDA to identify the types of vulnerabilities and attacks in each group. vised learning process called clustering seeks to create groups out of the observations in a given dataset. An input of the number of clusters is given. Reducing total distance of points from their cluster centroids creates the clusters mean algorithm divides a collection of data into k distinct clusters, using a predetermined k onsists of two distin ct phases: The first process involves defining k centroids, one for each cluster. The next step is to link each point in the data set with the nearest centroid 20 Preprocessing for the second notebook using tokenize and BERT Dirichlet Allocation (LDA) to determine whether the smart contract vulnerabilities were discovered by humans or machines. The next step is to identify the most common vulnerabilities in the reports and prioritize the mo st serious ones. is an unsupervised problem. I used K-means to group the vulnerabilities based on human, machine, and unknown det ection. After LDA to identify the types of vulnerabilities and attacks in each group. vised learning process called clustering seeks to create groups out of the observations in a given dataset. An input of the number of clusters is given. Reducing the creates the clusters (D, 2020). The kmean algorithm divides a collection of data into k distinct clusters, using a predetermined k The first process involves defining k centroids, one for each cluster. The next step is to link each point in the data set with the nearest centroid Figure Euclidean distance is commonly used to determine the distance between data points and centroids (Singh et al., 2013). 𝑑 ( Figure An effective way to figure out how many clusters to employ is the elbow method, which uses visualization to calculate the number of clusters technique is a visual approach for calculating the number of clusters in a data collection. "elbow," or point of inflexion on the curve, is a useful indicator of wher model fits best if the line chart resembles an arm Figure 14 - K-mean algorithm (Leo, 2024) Euclidean distance is commonly used to determine the distance between data points and ( 𝑥,𝜇)=∑𝑥−𝜇   Figure 15 - Euclidian distance out how many clusters to employ is the elbow method, which uses visualization to calculate the number of clusters , as it can be seen below technique is a visual approach for calculating the number of clusters in a data collection. "elbow," or point of inflexion on the curve, is a useful indicator of wher model fits best if the line chart resembles an arm (Cui, n.d.). 21 Euclidean distance is commonly used to determine the distance between data points and out how many clusters to employ is the elbow method, which uses be seen below . The elbow technique is a visual approach for calculating the number of clusters in a data collection. The "elbow," or point of inflexion on the curve, is a useful indicator of wher e the underlying Figure 16 - Elbow Method to determin After determining the idea l number of clusters, I picked three Latent Dirichlet Allocation includes themes that can be determined by both humans an machines, and I chose three for k. I also conducted s ilhouette analysis, which can be used to study the distance between the clusters that were created. The silhouette plot illustrates how close each point in one cluster is to points in neighboring clusters, enabling you to visually assess charact cluster number (Scikitlearn developers, n.d.) measurement used in clustering analysis. To calculate the silhouette value at a point, p, in the data set, follow these steps:  Define AvgDistIn(p) as the average distance between p and the other points in the same cluster. This is the average distance within the cluster that p belongs to.  Calculate the average distance between p and the points in all the other clusters. If there are k clusters, this will yield k of these average dist between clusters. The silhouette statistic for point p is expressed as s(p) = (AvgDistOut(p) max(AvgDistOut(p), AvgDistIn(p)). This value falls within the range of value indicates that the point is well clustered Elbow Method to determin e the k number of clusters l number of clusters, I picked three since the list of terms for Latent Dirichlet Allocation includes themes that can be determined by both humans an for k. ilhouette analysis, which can be used to study the distance between the clusters that were created. The silhouette plot illustrates how close each point in one cluster is to points in neighboring clusters, enabling you to visually assess charact learn developers, n.d.) . The silhouette st atistic is a distance measurement used in clustering analysis. To calculate the silhouette value at a point, p, in the data set, follow these steps: Define AvgDistIn(p) as the average distance between p and the other points in the is the average distance within the cluster that p belongs to. Calculate the average distance between p and the points in all the other clusters. If there are k clusters, this will yield k - 1 results. Define AvgDistOut(p) as the minimum of these average dist ances. This represents the minimum of the average distance The silhouette statistic for point p is expressed as s(p) = (AvgDistOut(p) max(AvgDistOut(p), AvgDistIn(p)). This value falls within the range of - 1 to 1, where value indicates that the point is well clustered (Rick Wicklin, 2023). 22 the k number of clusters since the list of terms for Latent Dirichlet Allocation includes themes that can be determined by both humans an d ilhouette analysis, which can be used to study the distance between the clusters that were created. The silhouette plot illustrates how close each point in one cluster is to points in neighboring clusters, enabling you to visually assess charact eristics such as atistic is a distance -based measurement used in clustering analysis. To calculate the silhouette value at a point, p, in Define AvgDistIn(p) as the average distance between p and the other points in the is the average distance within the cluster that p belongs to. Calculate the average distance between p and the points in all the other clusters. If 1 results. Define AvgDistOut(p) as the minimum ances. This represents the minimum of the average distance The silhouette statistic for point p is expressed as s(p) = (AvgDistOut(p) - AvgDistIn(p)) / 1 to 1, where a higher Figure After conducting Silhouette analysis, I decid detection can be assumed: machine, human, and unknown. used PCA. PCA is a statistical approach used to compress and extract meaningful information from multivariate data sets (Deeman Yousif Mahmood, 2018) data analysis, from neuroscience to computer graphics, due to its easy to underst parametric approach to extracting useful information from complex For the PCA, I utilized topic embeddings, which are high groups labelled "Human Detection," "Machine Detection," and "Unknown." I identified the most common vulnerabilities generated a top list of the most dangerous vulnerabilities using the severity score, which will be discussed l ater in the results Factorization, a decomposition technique for high automatically selects sparse and significant features from a set of nonnegative input vectors. It is also commonly utilized in dimensionality reduction, fea decomposition, clustering, feature learning, topic recovery, signal enhancement, and other domains, making it a versatile technique A generative probabilistic model of a corpus fundamental concept is that texts are represented as random mixes across latent with a word distribution defining each topic approach called Latent Dirichlet Allocation (LDA) aims to characterize a set of observations as a combination of several categories. The m specified number of themes that documents in a text corpus share. In this case, every observation is a document, every word's existence represents a feature, and the subjects represent the categories (Amazon Web Services, n.d.) Figure 17 - Silhouette Analysis for Optimal k After conducting Silhouette analysis, I decid ed to apply the three groups since three types of detection can be assumed: machine, human, and unknown. For visualization of the clusters, I PCA is a statistical approach used to compress and extract meaningful information (Deeman Yousif Mahmood, 2018) . PCA is widely used in current analysis, from neuroscience to computer graphics, due to its easy to underst approach to extracting useful information from complex datase For the PCA, I utilized topic embeddings, which are high - dimensional vectors with three groups labelled "Human Detection," "Machine Detection," and "Unknown." the most common vulnerabilities and attack types found in the reports and a top list of the most dangerous vulnerabilities using the severity score, which will ater in the results . To use LDA, I needed to develop the N on decomposition technique for high - dimensional data analysis that automatically selects sparse and significant features from a set of nonnegative input vectors. It is also commonly utilized in dimensionality reduction, fea ture extraction, matrix decomposition, clustering, feature learning, topic recovery, signal enhancement, and other domains, making it a versatile technique (Madala, 2023). A generative probabilistic model of a corpus is called Latent Dirichlet A llocation (LDA). The fundamental concept is that texts are represented as random mixes across latent with a word distribution defining each topic (Blei et al., 2003). An unsupervised learning approach called Latent Dirichlet Allocation (LDA) aims to characterize a set of observations as a combination of several categories. The m ost popular use of LDA is finding a user specified number of themes that documents in a text corpus share. In this case, every observation is a document, every word's existence represents a feature, and the subjects (Amazon Web Services, n.d.) . 23 since three types of For visualization of the clusters, I PCA is a statistical approach used to compress and extract meaningful information PCA is widely used in current analysis, from neuroscience to computer graphics, due to its easy to underst and nondatase ts (Shlens,2014). dimensional vectors with three groups labelled "Human Detection," "Machine Detection," and "Unknown." found in the reports and a top list of the most dangerous vulnerabilities using the severity score, which will on -Negative Matrix dimensional data analysis that automatically selects sparse and significant features from a set of nonnegative input vectors. ture extraction, matrix decomposition, clustering, feature learning, topic recovery, signal enhancement, and other llocation (LDA). The fundamental concept is that texts are represented as random mixes across latent subjects, An unsupervised learning approach called Latent Dirichlet Allocation (LDA) aims to characterize a set of observations ost popular use of LDA is finding a user - specified number of themes that documents in a text corpus share. In this case, every observation is a document, every word's existence represents a feature, and the subjects The steps to implement LDA are as follows:  Assign each word in a document at random to one of the K pre where K is the number of topics.  Regarding every document d:Compute: for each word w in the document.  P(topic t| document d): The percentage of words attributed to subject t in document d  P(word w| topic t): The percentage of assignments from words that origina in all publications that are related to topic t  Reassign topic T' to word w, taking into account all other words and their topic assignments, with probability p(t'|d)*p(w|t') Figure 18 T he most common and dangerous vulnerabiliti cluster. This analysis used a higher degree of abstraction in line with official academic norms. I've observed the distribution of potential vulnerabilities across clusters. The Unknown cluster notably contains numerous elements that can be identified by both machines and humans. LDA's performance is commonly evaluated by testing it on secondary tasks such as document categorization or information retrieval. Another approach is to estimate the likelihood of unob training documents, a measure known as holdout perplexity perplexity is calculated using the following formula: Figure 19 M refers to the number of documents in the test sample, while wd represents the words in document d, and Nd represents the total number of words in document d Network, 2011). Researchers use hold The steps to implement LDA are as follows: Assign each word in a document at random to one of the K pre K is the number of topics. Regarding every document d:Compute: for each word w in the document. P(topic t| document d): The percentage of words attributed to subject t in document P(word w| topic t): The percentage of assignments from words that origina in all publications that are related to topic t Reassign topic T' to word w, taking into account all other words and their topic assignments, with probability p(t'|d)*p(w|t') (Dutta, 2021). 18 – How Latent Dirichlet Allocation works (Naskar, 2019) he most common and dangerous vulnerabiliti es and attack types were discovered for each cluster. This analysis used a higher degree of abstraction in line with official academic norms. I've observed the distribution of potential vulnerabilities across clusters. The Unknown numerous elements that can be identified by both machines and LDA's performance is commonly evaluated by testing it on secondary tasks such as document categorization or information retrieval. Another approach is to estimate the likelihood of unob served heldout documents using the training documents, a measure known as holdout perplexity (Wallach et al., 2009) perplexity is calculated using the following formula: 19 - Perplexity formula (Hörster et al., 2007). documents in the test sample, while wd represents the words in document d, and Nd represents the total number of words in document d Researchers use hold -out perplexity to evaluate a model performance 24 Assign each word in a document at random to one of the K pre -defined subjects, Regarding every document d:Compute: for each word w in the document. P(topic t| document d): The percentage of words attributed to subject t in document P(word w| topic t): The percentage of assignments from words that origina te from w Reassign topic T' to word w, taking into account all other words and their topic (Naskar, 2019) es and attack types were discovered for each cluster. This analysis used a higher degree of abstraction in line with official academic norms. I've observed the distribution of potential vulnerabilities across clusters. The Unknown numerous elements that can be identified by both machines and LDA's performance is commonly evaluated by testing it on secondary tasks such as out documents using the (Wallach et al., 2009) . The documents in the test sample, while wd represents the words in document d, and Nd represents the total number of words in document d (Stack Exchange evaluate a model performance to generalize and avoid overfitting training data. It is commonly used in topic modeling and language models to assess how well the model represents the d (Mimno & McCallum, 2012). previously analyzed, and also for future reports Figure 20 - Pseudocode As mentioned previously, I automatically extracted the vulnerabilities per cluster. This allowed me to gain a deeper understanding of the smart contract distribution of attack types across clusters, which included Machine, Human, and Unknown detection. generalize and avoid overfitting training data. It is commonly used in topic modeling and language models to assess how well the model represents the d istribution of topics or words This approach can also be used with data that has not been and also for future reports . Pseudocode Evaluating an LDA Model for Text Analysis As mentioned previously, I automatically extracted the vulnerabilities per cluster. This allowed me to gain a deeper understanding of the smart contract vulnerabilities and the distribution of attack types across clusters, which included Machine, Human, and Unknown 25 generalize and avoid overfitting training data. It is commonly used in topic modeling and istribution of topics or words This approach can also be used with data that has not been Evaluating an LDA Model for Text Analysis As mentioned previously, I automatically extracted the vulnerabilities per cluster. This vulnerabilities and the distribution of attack types across clusters, which included Machine, Human, and Unknown Figure 21 - Pseudocode shows cluster vulnerabilities and attack types NLP has significant ly improved cybersecurity. unstructured text from several perspectives, including lexical, syntactic, and semantic studies (Gutierr ez & Namin, 2022) CVSS has three metric groups: base, temporal, and environmental. the Common Vulnerability Scoring System. It is a method for evaluating and ranking disclosed vulnerabilities in a consistent and repeatable manner. CVSS's purpose is to assist in comparing vulnerabilities in various applications and suppliers using a consistent, repeatable, vendoragnostic technique score between 0 and 10, which may subsequently be adjusted by rating the Temporal and Environmental measurements. A CVSS score is compressed textual representation of the values required to calculate the score Institute of Standards and Technology, 2024) Pseudocode shows cluster vulnerabilities and attack types ly improved cybersecurity. NLP may be applied in cybersecurity to analyze unstructured text from several perspectives, including lexical, syntactic, and semantic ez & Namin, 2022) . The CVSS provides a qualitative assessment of severity. CVSS has three metric groups: base, temporal, and environmental. CVSS is an acronym for the Common Vulnerability Scoring System. It is a method for evaluating and ranking disclosed vulnerabilities in a consistent and repeatable manner. CVSS's purpose is to assist in comparing vulnerabilities in various applications and suppliers using a consistent, agnostic technique (Jonathan Risto, 2023). The Base metrics generate a score between 0 and 10, which may subsequently be adjusted by rating the Temporal and Environmental measurements. A CVSS score is also expressed as a vector string, which is a compressed textual representation of the values required to calculate the score Institute of Standards and Technology, 2024) which can be seen in the figure below 26 Pseudocode shows cluster vulnerabilities and attack types NLP may be applied in cybersecurity to analyze unstructured text from several perspectives, including lexical, syntactic, and semantic The CVSS provides a qualitative assessment of severity. CVSS is an acronym for the Common Vulnerability Scoring System. It is a method for evaluating and ranking disclosed vulnerabilities in a consistent and repeatable manner. CVSS's purpose is to assist in comparing vulnerabilities in various applications and suppliers using a consistent, The Base metrics generate a score between 0 and 10, which may subsequently be adjusted by rating the Temporal and also expressed as a vector string, which is a compressed textual representation of the values required to calculate the score (National which can be seen in the figure below . Figure 22 - Severity Rating 2024) Research suggests that static analysis technologies can produce false positives and due to their reliance on predefined criteria more syntax and semantic analysis; their inflexible and generalizing to new information blockchain is, even the world's greatest developer is capable of making an inadvertent error that might lead to catastrophic Severity Rating (National Institute of Standards and Technology, that static analysis technologies can produce false positives and due to their reliance on predefined criteria (Tang et al., 2023) . These technologies need syntax and semantic analysis; their predefined rules can quickly become outdated and to new information (Tang et al., 2023). No matter how inventive blockchain is, even the world's greatest developer is capable of making an inadvertent error that might lead to catastrophic issues (Hacken, 2022). 27 (National Institute of Standards and Technology, that static analysis technologies can produce false positives and negatives . These technologies need become outdated and No matter how inventive blockchain is, even the world's greatest developer is capable of making an inadvertent error 4. RESULTS AND DISCUSSI 4.1. RESULTS This study attempts to discover patterns of smart contract vulnerabilities identified in reports, classify them using natural language dangerous vulnerabilities. The classification process was completed using the severity score, which can be reviewed in the previous section, which The study responses address the q pertinent despite new vulnerabilities or exploitation techniques surfacing. Also, my analysis takes an empirical approach in which I attempt to determine roughly which smart contract vulnerabilities i The empirical research results are shown in the figure below. Figure As shown in Figure 23 , the majority of the vulnerabilities were found by machines, followed by human detection and an unknown label. beneficial to understand how previous vulnerabilities we calculation, which will assist in determining the percentage, is provided below. Percentage= (Measured Value / Actual Value) * 100 Percentage Machine-De tection = (158/242)*100 = 65.29 Percentage Human-D etection Percentage Unknown- Dectection =( The NLP technique produces essentially comparable findings, although it must be noted that it is based on the severity score. RESULTS AND DISCUSSI ON This study attempts to discover patterns of smart contract vulnerabilities identified in reports, classify them using natural language processing, and then identify the most The classification process was completed using the severity score, which can be reviewed in the previous section, which extensively addressed what it means. The study responses address the q uestion and provide valuable information, which remains pertinent despite new vulnerabilities or exploitation techniques surfacing. Also, my analysis takes an empirical approach in which I attempt to determine roughly which smart contract vulnerabilities i n reports were identified by humans, machines, or unknown. The empirical research results are shown in the figure below. Figure 23 - Empirical Study Results , the majority of the vulnerabilities were found by machines, followed by human detection and an unknown label. Even if I do an empirical investigation first, it is beneficial to understand how previous vulnerabilities we re identified. calculation, which will assist in determining the percentage, is provided below. (Measured Value / Actual Value) * 100 tection = (158/242)*100 = 65.29 % etection = (82/242)*100 = 33.88% Dectection =( 2/242)*100=0.83% The NLP technique produces essentially comparable findings, although it must be noted that it is based on the severity score. 28 This study attempts to discover patterns of smart contract vulnerabilities identified in processing, and then identify the most The classification process was completed using the severity score, extensively addressed what it means. uestion and provide valuable information, which remains pertinent despite new vulnerabilities or exploitation techniques surfacing. Also, my analysis takes an empirical approach in which I attempt to determine roughly which n reports were identified by humans, machines, or unknown. , the majority of the vulnerabilities were found by machines, followed Even if I do an empirical investigation first, it is identified. The percentage calculation, which will assist in determining the percentage, is provided below. The NLP technique produces essentially comparable findings, although it must be noted that The calculus below illustrates the distribution o human, machine, or unknown detection. This detection relies on NLP and machine learning techniques. For Machine Detection: 242*(25.21 For Human Detection: 242*(48.35/100)=117 For Unknown Detection : 242*(26.45/100)=64 After completing the empirical study, I employed two different approaches: K unsupervised clustering technique, and Latent Dirichlet Allocation, another unsupervised clustering technique. These methods were methodology, and the results can be found on the following pages. The data indicates that human identifications, with 117 ou t of 242 detections ( 60.5 (25.21 %), while unknown detection a distribution highlights the effectiveness and reliance on machine can be seen in the figure below. below illustrates the distribution o f vulnerabilities into clusters based on human, machine, or unknown detection. This detection relies on NLP and machine learning 242*(25.21 /100)=60.5 For Human Detection: 242*(48.35/100)=117 Detection : 242*(26.45/100)=64 After completing the empirical study, I employed two different approaches: K unsupervised clustering technique, and Latent Dirichlet Allocation, another unsupervised clustering technique. These methods were explained in the literature review and methodology, and the results can be found on the following pages. The data indicates that human detection was responsible for the majority of vulnera t of 242 detections ( 48.35%). Mac hine detection accounted for %), while unknown detection a ccounted for the remaining 64 (26.35 distribution highlights the effectiveness and reliance on machine - based detection tools figure below. Figure 24 - Cluster of topics 29 f vulnerabilities into clusters based on human, machine, or unknown detection. This detection relies on NLP and machine learning After completing the empirical study, I employed two different approaches: K -means, an unsupervised clustering technique, and Latent Dirichlet Allocation, another unsupervised explained in the literature review and detection was responsible for the majority of vulnera bility hine detection accounted for ccounted for the remaining 64 (26.35 %). This based detection tools , as 36 4.2. DISCUSSION As was discussed in the previous chapter of results, the patterns and vulnerabilities that were identified using unsupervised machine learning techniques combined with natural language processing show important insights of potential vulnerabilities and create a new framework to be used and optimized for further work. Using natural language processing (NLP) on the reports from smart contracts can help find trends and methods by which attackers can exploit vulnerabilities. Having this information on hand might be beneficial even if the smart contract audit has already been completed. As shown in the results section, I have developed an NLP pipeline that can effectively identify the most serious vulnerabilities and attack types of smart contracts. This pipeline can be adapted in various ways to pinpoint vulnerabilities or patterns that can aid cybersecurity experts in enhancing smart contract security. It is important to note that once a smart contract is deployed, it cannot be modified until the next smart contract is created, making it critical to ensure its security before its deployment. The results from this process can help improve the security of future smart contracts. This approach can be applied to various smart contract reports by following the same steps of cleaning, preprocessing, using Kmeans for clustering, and implementing LDA to identify patterns between vulnerabilities and types of attacks in smart contracts. This method can be utilized to categorize smart contract reports, detect vulnerabilities, and predict their severity scores. Furthermore, using LDA, we can extract the top ten vulnerabilities and attack types from smart contract reports in the results area. With this information, cybersecurity professionals and blockchain engineers may be more cautious when testing smart contracts before publishing them to the blockchain, assuring solid protection against hackers. Additionally, it can be used to evaluate the model using perplexity and hold out perplexity. For further works, as can be observed in the next section, I can add to be developed an NLP pipeline that includes more models, and also to collect data from different websites and not be limited only to Code4Arena. Even if the reports have a good quality, the number of the reports is reduced and my model can have an issue with underfitting the model, which is why I consider that as a discussion; and as for further work that can improve this work is to consider analyzing more smart content. However, fresh methods to attack and exploit smart contracts will develop, and cybersecurity employees should remain vigilant and conduct investigations even on reports to identify patterns and similar vulnerabilities or kinds of attacks that can be prevented for future smart contracts or future versions of smart contracts. 37 5. CONCLUSIONS AND FUTURE WORKS 5.1. CONCLUSIONS Smart contracts are a valuable and simple approach to reaching an agreement in which a transaction may be completed in a few seconds. Even so, flaws and attack types that exploit smart contract vulnerabilities can be identified using smart contract security reports. Using natural language processing to identify smart contract vulnerabilities and attack types in reports is useful for observing patterns between smart contract vulnerabilities, and cybersecurity employees can be valuable assets in the fight against cybercriminals who attempt to corrupt smart contracts; in this way, cybersecurity employees can assist blockchain developers in creating better and more secure smart contracts. This thesis offers an alternative method of analyzing smart contracts, which involves studying the language of smart contract reports to find trends, weaknesses, and potential attack vectors that future smart contracts can defend against. By using K-means clustering and LDA to analyze smart contracts, vulnerabilities and attack types provide a comprehensive perspective of patterns. This method organizes similar vulnerabilities according to severity score and identifies key subjects from textual descriptions. When it does so, it reveals prevalent patterns, severe vulnerabilities, and emerging attack types. Consequently, this strategy allows for improved prioritizing of security operations and money distribution. Nevertheless, criminals will always find new ways to exploit smart contracts and launch attacks. As such, developers must exercise caution whenever they release a new smart contract, strive to prevent common attack vectors and vulnerabilities, and utilize available tools and strategies to safeguard their creations. Moreover, unsupervised machine learning models combined with NLP show the capacity to identify potential vulnerabilities in smart contracts. If analyzed, historical data and developing threat trends, these algorithms can predict possible attack types, enabling developers to secure smart contracts to prevent exploitation. Smart contracts have numerous advantages, but it is crucial for them to be secure. Developers can enhance the reliability of smart contracts by utilizing NLP techniques, machine learning models, and strong cybersecurity protocols. This will ensure their dependability and security in the midst of evolving threats. 38 5.2. FUTURE WORKS Smart contracts offer numerous benefits, but it is crucial for them to be secure. Developers can enhance their reliability by utilizing NLP techniques, machine learning models, and robust cybersecurity measures. NLP can improve code clarity and identify ambiguities, while machine learning can detect unforeseen patterns and potential risks in real time. Strong cybersecurity measures such as encryption, multi-factor authentication, and regular audits are essential. Additionally, formal verification methods can rigorously demonstrate the accuracy of the contract's logic, ensuring consistent behavior. Collaborative research involving blockchain developers, cybersecurity specialists, and data scientists can lead to innovative solutions, while regulatory compliance can safeguard against legal risks. Lastly, it is crucial to train developers and users in standard practices to minimize human error and enhance security. 39 BIBLIOGRAPHICAL REFERENCES Alkhalifah, A., Ng, A., Watters, P. A., & Kayes, A. S. M. (2021). A Mechanism to Detect and Prevent Ethereum Blockchain Smart Contract Reentrancy Attacks. Frontiers in Computer Science, 3, 598780. https://doi.org/10.3389/fcomp.2021.598780 Amazon Web Services. (n.d.). Latent Dirichlet Allocation (LDA) Algorithm—Amazon SageMaker.Retrieved,March4,2024,from https://docs.aws.amazon.com/sagemaker/latest/dg/lda.html Analytics Vidhya & Chaitanya Krishna Kasaraneni. (2020). Understanding NLP Pipeline. https://medium.com/analytics-vidhya/understanding-nlp-pipeline-9af8cba78a56 Ashizawa, N., Yanai, N., Cruz, J. P., & Okamura, S. (2021). Eth2Vec: Learning Contract-Wide Code Representations for Vulnerability Detection on Ethereum Smart Contracts. Proceedings of the 3rd ACM International Symposium on Blockchain and Secure Critical Infrastructure, 47–59. https://doi.org/10.1145/3457337.3457841 Baivab Kumar Jena. (2024). What Is SHA-256 Algorithm: How it Works and Applications | Simplilearn. Simplilearn.Com. https://www.simplilearn.com/tutorials/cyber-security- tutorial/sha-256-algorithm baizhenxuan. (2018). Defcon26/docs/Replay Attacks on Ethereum Smart Contracts.md at master · nkbai/defcon26 · GitHub. GitHub. https://github.com/nkbai/defcon26/tree/master Ben Lutkevich. (2023). What is a Backdoor Attack? Tips for Detection and Prevention | Definition from TechTarget. Security. https://www.techtarget.com/searchsecurity/definition/back-door Beniiche, A. (2020). A Study of Blockchain Oracles (arXiv:2004.07140). arXiv. http://arxiv.org/abs/2004.07140 Blei, David. M., Ng, Andrew. Y., & Jordan, M. I. (2003). Latent dirichlet allocation. Journal of Machine Learning Research, 3, pp 993-1022. https://jmlr.csail.mit.edu/papers/v3/blei03a.html Block Education. (2023a). An Overview of Smart Contracts Scams. Crypto Adventure. https://cryptoadventure.com/community/articles/an-overview-of-smart-contracts- scams/ Block Education. (2023b). What Are Crypto Ponzi Schemes? Crypto Adventure. https://cryptoadventure.com/community/articles/what-are-crypto-ponzi-schemes/ Block Education. (2023c). What is a HoneyPot Crypto Scam? Crypto Adventure. https://cryptoadventure.com/community/articles/short-series-what-is-a-honeypot- crypto-scam/ Bosu, A., Iqbal, A., Shahriyar, R., & Chakraborty, P. (2019). Understanding the motivations, challenges and needs of Blockchain software developers: A survey. Empirical Software Engineering, 24(4), 2636–2673. https://doi.org/10.1007/s10664-019- 09708-7 Casino, F., Dasaklis, T. K., & Patsakis, C. (2019). A systematic literature review of blockchainbased applications: Current status, classification and open issues. Telematics and Informatics, 36, 55–81. https://doi.org/10.1016/j.tele.2018.11.006 Chainlink. (2024). How To Audit a Smart Contract? | Chainlink. https://chain.link/educationhub/how-to-audit-smart-contract 40 Chaliasos, S., Charalambous, M. A., Zhou, L., Galanopoulou, R., Gervais, A., Mitropoulos, D., & Livshits, B. (2023). Smart Contract and DeFi Security: Insights from Tool Evaluations and Practitioner Surveys (arXiv:2304.02981). arXiv. http://arxiv.org/abs/2304.02981 Chan, W. K., & Jiang, B. (2018). Fuse: An Architecture for Smart Contract Fuzz Testing Service. 2018 25th Asia-Pacific Software Engineering Conference (APSEC), 707–708. https://doi.org/10.1109/APSEC.2018.00099 Chen, C., Su, J., Chen, J., Wang, Y., Bi, T., Wang, Y., Lin, X., Chen, T., & Zheng, Z. (2023). When ChatGPT Meets Smart Contract Vulnerability Detection: How Far Are We? (arXiv:2309.05520). arXiv. http://arxiv.org/abs/2309.05520 Chu, H., Zhang, P., Dong, H., Xiao, Y., Ji, S., & Li, W. (2023). A survey on smart contract vulnerabilities: Data sources, detection and repair. Information and Software Technology, 159, 107221. https://doi.org/10.1016/j.infsof.2023.107221 Coinbase. (n.d.). Crypto basics—What is cryptography? Retrieved February 28, 2024, from https://www.coinbase.com/learn/crypto-basics/what-is-cryptography CoinCodeCap. (2023). smart contract oracle—CoinCodeCap. https://coincodecap.com/ethereum-smart-contracts-and-the-oracle-problem Cui, M. (n.d.). Introduction to the K-Means Clustering Algorithm Based on the Elbow Method. D, V. A. (2020, April 26). K-Means Clustering Algorithm from Scratch. Machine Learning Plus. https://www.machinelearningplus.com/predictive-modeling/k-means-clustering/ Deeman Yousif Mahmood. (2018). Principal Component Analysis (PCA). ResearchGate. https://www.researchgate.net/publication/324149818_Principal_Component_Analy sis_PCA deeplearning.ai. (2023). Natural Language Processing (NLP)—A Complete Guide. https://www.deeplearning.ai/resources/natural-language-processing/ Deng, W., Wei, H., Huang, T., Cao, C., Peng, Y., & Hu, X. (2023). Smart Contract Vulnerability Detection Based on Deep Learning and Multimodal Decision Fusion. Sensors, 23(16), 7246. https://doi.org/10.3390/s23167246 Destefanis, G., Marchesi, M., Ortu, M., Tonelli, R., Bracciali, A., & Hierons, R. (2018). Smart contracts vulnerabilities: A call for blockchain software engineering? 2018 International Workshop on Blockchain Oriented Software Engineering (IWBOSE), 19– 25. https://doi.org/10.1109/IWBOSE.2018.8327567 Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2019). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding (arXiv:1810.04805). arXiv. http://arxiv.org/abs/1810.04805 Diana Zozulia. (2023). Smart Contract Audit Process and Why It’s Important | 4IRE. https://4irelabs.com/articles/how-to-audit-smart-contracts/ Dutta, M. (2021). Topic Modelling With LDA -A Hands-on Introduction. Analytics Vidhya. https://www.analyticsvidhya.com/blog/2021/07/topic-modelling-with-lda-a-hands- on-introduction/ Eldin, S. M. S., El-Latif, A. A. Abd., Chelloug, S. A., Ahmad, M., Eldeeb, A. H., Diab, T. O., Sobky, W. I. A., & Zaky, H. N. (2023). Design and Analysis of New Version of Cryptographic Hash Function Based on Improved Chaotic Maps With Induced DNA Sequences. IEEE Access, 11, 101694–101709. https://doi.org/10.1109/ACCESS.2023.3298545 Ethereum.org. (2024). Smart contract security. Ethereum.Org. https://ethereum.org/en/developers/docs/smart-contracts/security/ 41 Explosion. (2024). spaCy 101: Everything you need to know · spaCy Usage Documentation. spaCy 101: Everything You Need to Know. https://spacy.io/usage/spacy-101 Federal Bureau of Investigation. (2022). Cyber Criminals Increasingly Exploit Vulnerabilities in Decentralized Finance Platforms to Obtain Cryptocurrency, Causing Investors to Lose Money. https://www.ic3.gov/Media/Y2022/PSA220829 Ferreira, J. F., Cruz, P., Durieux, T., & Abreu, R. (2020). SmartBugs: A Framework to Analyze Solidity Smart Contracts (arXiv:2007.04771). arXiv. http://arxiv.org/abs/2007.04771 geeksforgeeks.org. (2019). What is Cross Site Scripting (XSS) ? GeeksforGeeks. https://www.geeksforgeeks.org/what-is-cross-site-scripting-xss/ geeksforgeeks.org. (2020). Difference between DOS and DDOS attack. GeeksforGeeks. https://www.geeksforgeeks.org/difference-between-dos-and-ddos-attack/ Grefenstette, G. (1999). Tokenization. In H. Van Halteren (Ed.), Syntactic Wordclass Tagging (Vol. 9, pp. 117–133). Springer Netherlands. https://doi.org/10.1007/978-94-015- 9273-4_9 Gupta, R., Gupta, P., & Singh, J. (2019). Security and Cryptography. In Software Engineering for Embedded Systems (pp. 501–547). Elsevier. https://doi.org/10.1016/B978-0-12- 809448-8.00014-X Gupta, R., Patel, M. M., Shukla, A., & Tanwar, S. (2022). Deep learning-based malicious smart contract detection scheme for internet of things environment. Computers & Electrical Engineering, 97, 107583. https://doi.org/10.1016/j.compeleceng.2021.107583 Gupta, R., Tanwar, S., Al-Turjman, F., Italiya, P., Nauman, A., & Kim, S. W. (2020). Smart Contract Privacy Protection Using AI in Cyber-Physical Systems: Tools, Techniques and Challenges. IEEE Access, 8, 24746–24772. https://doi.org/10.1109/ACCESS.2020.2970576 Gutierrez, L. F., & Namin, A. (2022). ContextMiner: Mining Contextual Features for Conceptualizing Knowledge in Security Texts. IEEE Access, 10, 85891–85904. https://doi.org/10.1109/ACCESS.2022.3198944 Hacken. (2022). 7 Most Common Smart Contract Attacks. Hacken. https://hacken.io/discover/most-common-smart-contract-attacks/ Hartel, P., & van Staalduinen, M. (2019). Truffle tests for free—Replaying Ethereum smart contracts for transparency (arXiv:1907.09208). arXiv. http://arxiv.org/abs/1907.09208 Hassan, M. (2024). Qualitative Research—Methods, Analysis Types and Guide. Research Method. https://researchmethod.net/qualitative-research/ Hines, B. (with John Wiley & Sons, Inc). (2021). Digital finance: Security tokens and unlocking the real potential of blockchain. John Wiley & Sons, Inc. Hörster, E., Lienhart, R., & Slaney, M. (2007). Image retrieval on large-scale image databases. Proceedings of the 6th ACM International Conference on Image and Video Retrieval, 17–24. https://doi.org/10.1145/1282280.1282283 IBM Cloud Education. (2024). Structured vs. unstructured data: What’s the difference? https://www.ibm.com/think/topics/structured-vs-unstructured-data Innocent, O. (2020). Smart Contract Security: The Attacks and Solutions. Medium. https://medium.com/xord/smart-contract-security-the-attacks-and-solutions- 9d3a48e5604d Ivanov, N., Lou, J., Chen, T., Li, J., & Yan, Q. (2021). Targeting the Weakest Link: Social Engineering Attacks in Ethereum Smart Contracts (arXiv:2105.00132). arXiv. http://arxiv.org/abs/2105.00132 42 Jonathan Risto. (2023, May 22). What is CVSS - Common Vulnerability Scoring System. https://www.sans.org/blog/what-is-cvss/ Kavita Ganesan. (2019, February 23). All you need to know about text preprocessing for NLP and Machine Learning. freeCodeCamp.Org. https://www.freecodecamp.org/news/all-you-need-to-know-about-text- preprocessing-for-nlp-and-machine-learning-bc1c5765ff67/ Khan, S. N., Loukil, F., Ghedira-Guegan, C., Benkhelifa, E., & Bani-Hani, A. (2021). Blockchain smart contracts: Applications, challenges, and future trends. Peer-to-Peer Networking and Applications, 14(5), 2901–2925. https://doi.org/10.1007/s12083-021-01127-0 Khan Sial, M. F. (2019). Blockchain Technology – Prospects, Challenges and Opportunities. IEEE Blockchain Technical Briefs. https://blockchain.ieee.org/technicalbriefs/june- 2019/blockchain-technology-prospects-challenges-and-opportunities Khurana, D., Koli, A., Khatter, K., & Singh, S. (2023). Natural language processing: State of the art, current trends and challenges. Multimedia Tools and Applications, 82(3), 3713– 3744. https://doi.org/10.1007/s11042-022-13428-4 Kim, K. B., & Lee, J. (2020). Automated Generation of Test Cases for Smart Contract Security Analyzers. IEEE Access, 8, 209377–209392. https://doi.org/10.1109/ACCESS.2020.3039990 Kumar, P., Kumar, R., Gupta, G. P., & Tripathi, R. (2021). A Distributed framework for detecting DDoS attacks in smart contract-based Blockchain-IoT Systems by leveraging Fog computing. Transactions on Emerging Telecommunications Technologies, 32(6), e4112. https://doi.org/10.1002/ett.4112 Kushwaha, S. S., Joshi, S., Singh, D., Kaur, M., & Lee, H.-N. (2022). Systematic Review of Security Vulnerabilities in Ethereum Blockchain Smart Contract. IEEE Access, 10, 6605–6621. https://doi.org/10.1109/ACCESS.2021.3140091 Lantz, L., & Cawrey, D. (2020). Mastering blockchain: Unlocking the power of cryptocurrencies, smart contracts, and decentralized applications (First edition). O’Reilly Media, Inc. Laurence, T. (2017). Blockchain. John Wiley & Sons. Leo, C. (2024, February 18). The Math Behind K-Means Clustering. Medium. https://towardsdatascience.com/the-math-and-code-behind-k-means-clustering- 795582423666 Lewis, M., Liu, Y., Goyal, N., Ghazvininejad, M., Mohamed, A., Levy, O., Stoyanov, V., & Zettlemoyer, L. (2019). BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension (arXiv:1910.13461). arXiv. http://arxiv.org/abs/1910.13461 Li, H., Dang, R., Yao, Y., & Wang, H. (2023). A Review of Approaches for Detecting Vulnerabilities in Smart Contracts within Web 3.0 Applications. Blockchains, 1(1), 3– 18. https://doi.org/10.3390/blockchains1010002 Lin, P. Y. (2023, March 9). 6 Key Elements of Blockchain Technology. CFTE. https://blog.cfte.education/6-key-elements-of-blockchain-technology/ Lu, W., Li, X., Xue, F., Zhao, R., Wu, L., & Yeh, A. G. O. (2021). Exploring smart construction objects as blockchain oracles in construction supply chain management. Automation in Construction, 129, 103816. https://doi.org/10.1016/j.autcon.2021.103816 Ma, C., Liu, S., & Xu, G. (2023). HGAT: Smart contract vulnerability detection method based on hierarchical graph attention network. Journal of Cloud Computing, 12(1), 93. https://doi.org/10.1186/s13677-023-00459-x 43 Madala, S. (2023, March 20). Non-Negative Matrix Factorization. Scaler Topics. https://www.scaler.com/topics/nlp/non-negative-matrix-factorization/ Matthew Kosinski. (2024, May 17). What is a Phishing Attack? | IBM. https://www.ibm.com/topics/phishing Mi, F., Zhao, C., Wang, Z., Halim, S. M., Li, X., Wu, Z., Khan, L., & Thuraisingham, B. (2023). An Automated Vulnerability Detection Framework for Smart Contracts. https://doi.org/10.48550/ARXIV.2301.08824 Michael Henris. (2019, November 28). Ponzi schemes: Explanation and samples. https://www.forexnewsnow.com/top-stories/ponzi-schemes-explanation-and- samples Mimno, D., & McCallum, A. (2012). Topic Models Conditioned on Arbitrary Features with Dirichlet-multinomial Regression (arXiv:1206.3278). arXiv. http://arxiv.org/abs/1206.3278 Mühlberger, R., Bachhofner, S., Castelló Ferrer, E., Di Ciccio, C., Weber, I., Wöhrer, M., & Zdun, U. (2020). Foundational Oracle Patterns: Connecting Blockchain to the Off- Chain World. In A. Asatiani, J. M. García, N. Helander, A. Jiménez-Ramírez, A. Koschmider, J. Mendling, G. Meroni, & H. A. Reijers (Eds.), Business Process Management: Blockchain and Robotic Process Automation Forum (pp. 35–51). Springer International Publishing. https://doi.org/10.1007/978-3-030-58779-6_3 Nadkarni, P. M., Ohno-Machado, L., & Chapman, W. W. (2011). Natural language processing: An introduction. Journal of the American Medical Informatics Association, 18(5), 544– 551. https://doi.org/10.1136/amiajnl-2011-000464 Naskar, A. (2019, February 14). Latent Dirichlet Allocation for Beginners: A high level overview. ThinkInfi. https://thinkinfi.com/latent-dirichlet-allocation-for-beginners-a- high-level-overview/ National Institute of Standards and Technology. (2024, June 27). NVD - Vulnerability Metrics. https://nvd.nist.gov/vuln-metrics/cvss NCC Group Publication Archive. (2018, March 22). Discovering Smart Contract Vulnerabilities with GOATCasino. NCC Group Research Blog. https://research.nccgroup.com/2018/03/22/discovering-smart-contract- vulnerabilities-with-goatcasino/ Nguyen, S. (2023, August 15). Text preprocessing techniques in natural language processing. StageZero Technologies. https://stagezero.ai/blog/text-preprocessing-techniques- nlp/ Oliva, G. A., Hassan, A. E., & Jiang, Z. M. (2020). An exploratory study of smart contracts in the Ethereum blockchain platform. Empirical Software Engineering, 25(3), 1864– 1904. https://doi.org/10.1007/s10664-019-09796-5 Parisi, O. M., Carlo. (2023, May 22). How To Audit A Smart Contract: A Deep Dive Into Hacken’s Process. Hacken. https://hacken.io/discover/smart-contract-audit-process/ Paul Kirvan. (2023, May 25). How to conduct a smart contract audit and why it’s needed | TechTarget. Security. https://www.techtarget.com/searchsecurity/tip/How-to- conduct-a-smart-contract-audit-and-why-its-needed Porkodi, S., & Kesavaraja, D. (2023). Smart contract: A survey towards extortionate vulnerability detection and security enhancement. Wireless Networks. https://doi.org/10.1007/s11276-023-03587-z 44 Ribeiro, M. T., Wu, T., Guestrin, C., & Singh, S. (2020). Beyond Accuracy: Behavioral Testing of NLP models with CheckList (arXiv:2005.04118). arXiv. http://arxiv.org/abs/2005.04118 Richardson, L. (2024). Beautiful Soup Documentation—Beautiful Soup 4.4.0 documentation. https://beautiful-soup-4.readthedocs.io/en/latest/ Rick Wicklin. (2023, May 15). What is the silhouette statistic in cluster analysis? The DO Loop. https://blogs.sas.com/content/iml/2023/05/15/silhouette-statistic-cluster.html Samreen, N. F., & Alalfi, M. H. (2021). A Survey of Security Vulnerabilities in Ethereum Smart Contracts (arXiv:2105.06974). arXiv. http://arxiv.org/abs/2105.06974 Sayeed, S., Marco-Gisbert, H., & Caira, T. (2020). Smart Contract: Attacks and Protections. IEEE Access, 8, 24416–24427. https://doi.org/10.1109/ACCESS.2020.2970495 Scikit-learn developers. (n.d.). Selecting the number of clusters with silhouette analysis on KMeans clustering. Scikit-Learn. Retrieved June 29, 2024, from https://scikitlearn.org/stable/auto_examples/cluster/plot_kmeans_silhouette_analysis.html Sendner, C., Chen, H., Fereidooni, H., Petzi, L., König, J., Stang, J., Dmitrienko, A., Sadeghi, A.- R., & Koushanfar, F. (2023). Smarter Contracts: Detecting Vulnerabilities in Smart Contracts with Deep Transfer Learning. Proceedings 2023 Network and Distributed System Security Symposium. Network and Distributed System Security Symposium, San Diego, CA, USA. https://doi.org/10.14722/ndss.2023.23263 Shi, C., Xiang, Y., Doss, R. R. M., Yu, J., Sood, K., & Gao, L. (2021). A Bytecode-based Approach for Smart Contract Classification (arXiv:2106.15497). arXiv. http://arxiv.org/abs/2106.15497 Shlens, J. (2014). A Tutorial on Principal Component Analysis (arXiv:1404.1100). arXiv. http://arxiv.org/abs/1404.1100 Singh, A., Yadav, A., & Rana, A. (2013). K-means with Three different Distance Metrics. International Journal of Computer Applications, 67(10), 13–17. https://doi.org/10.5120/11430-6785 SoliditySavvy. (2023, March 31). Race Conditions and Front Running Vulnerabilities in Smart Contracts: A Comprehensive Overview. Coinmonks. https://medium.com/coinmonks/race-conditions-and-front-running-vulnerabilities- in-smart-contracts-a-comprehensive-overview-5ea67cfd9d01 Stack Exchange Network. (2011, November 10). text mining—How to calculate perplexity of a holdout with Latent Dirichlet Allocation? Cross Validated. https://stats.stackexchange.com/questions/18167/how-to-calculate-perplexity-of-a- holdout-with-latent-dirichlet-allocation Stuart, D. L., & Lipton, A. B. (2018). An Introduction to Smart Contracts and Their Potential and Inherent Limitations. https://corpgov.law.harvard.edu/2018/05/26/anintroduction-to-smart-contracts-and-their-potential-and-inherent-limitations/ Sun, J., Huang, S., Zheng, C., Wang, T., & Zong, C. (2022). Mutation Testing for Integer Overflow in Ethereum Smart Contracts. TSINGHUA SCIENCE AND TECHNOLOGY, 27, 27–40. https://doi.org/1 0. 2 6 5 9 9/T ST. 2 0 2 0. 9 0 1 0 0 3 6 SWC Registry. (n.d.). Smart Contract Weakness Classification (SWC). Retrieved April 9, 2024, from https://swcregistry.io/ Taherdoost, H. (2023). Smart Contracts in Blockchain Technology: A Critical Review. Information, 14(2), 117. https://doi.org/10.3390/info14020117 45 Tang, X., Du, Y., Lai, A., Zhang, Z., & Shi, L. (2023). Deep learning-based solution for smart contract vulnerabilities detection. Scientific Reports, 13(1), 20106. https://doi.org/10.1038/s41598-023-47219-0 Tann, W. J.-W., Han, X. J., Gupta, S. S., & Ong, Y.-S. (2019). Towards Safer Smart Contracts: A Sequence Learning Approach to Detecting Security Threats (arXiv:1811.06632). arXiv. http://arxiv.org/abs/1811.06632 trakx. (2024, June 13). What Are Blockchain Oracles And Why Are They So Important? https://trakx.io/resources/insights/what-are-blockchain-oracles/ van Flymen, D. (2020). Learn blockchain by building one: A concise path to understanding cryptocurrencies. Apress. Wallach, H. M., Murray, I., Salakhutdinov, R., & Mimno, D. (2009). Evaluation methods for topic models. Proceedings of the 26th Annual International Conference on Machine Learning, 1105–1112. https://doi.org/10.1145/1553374.1553515 Wang, S., Yuan, Y., Wang, X., Li, J., Qin, R., & Wang, F.-Y. (2018). An Overview of Smart Contract: Architecture, Applications, and Future Trends. 2018 IEEE Intelligent Vehicles Symposium (IV), 108–113. https://doi.org/10.1109/IVS.2018.8500488 Wang, Y., He, J., Zhu, N., Yi, Y., Zhang, Q., Song, H., & Xue, R. (2021). Security enhancement technologies for smart contracts in the blockchain: A survey. Transactions on Emerging Telecommunications Technologies, 32(12), e4341. https://doi.org/10.1002/ett.4341 Weerapanpisit, P., Trilles, S., Huerta, J., & Painho, M. (2022). A Decentralized Location-Based Reputation Management System in the IoT Using Blockchain. IEEE Internet of Things Journal, 9(16), 15100–15115. https://doi.org/10.1109/JIOT.2022.3147478 Wu, H., Zhang, Z., Wang, S., Lei, Y., Lin, B., Qin, Y., Zhang, H., & Mao, X. (2021). Peculiar: Smart Contract Vulnerability Detection Based on Crucial Data Flow Graph and Pretraining Techniques. 2021 IEEE 32nd International Symposium on Software Reliability Engineering (ISSRE), 378–389. https://doi.org/10.1109/ISSRE52982.2021.00047 Xing, C., Chen, Z., Chen, L., Guo, X., Zheng, Z., & Li, J. (2020). A new scheme of vulnerability analysis in smart contract with machine learning. Wireless Networks. https://doi.org/10.1007/s11276-020-02379-z Xu, M., Tian, Y., Li, J., Kui, H., & Liu, J. (2018). Blockchain: An illustrated guidebook to understanding Blockchain. Skyhorse Publishing. Yang, Z., Keung, J., Zhang, M., Xiao, Y., Huang, Y., & Hui, T. (2020). Smart Contracts Vulnerability Auditing with Multi-semantics. 2020 IEEE 44th Annual Computers, Software, and Applications Conference (COMPSAC), 892–901. https://doi.org/10.1109/COMPSAC48688.2020.0-153 Yatchenko, D. (2022, December 16). 7 Smart Contract Vulnerabilities & How to Prevent Them [2024]. PixelPlex. https://pixelplex.io/blog/smart-contract-vulnerabilities/ Zhang, W., Wei, L., Cheung, S.-C., Liu, Y., Li, S., Liu, L., & Lyu, M. R. (2023). Combatting Front- Running in Smart Contracts: Attack Mining, Benchmark Construction and Vulnerability Detector Evaluation. IEEE Transactions on Software Engineering, 1–17. https://doi.org/10.1109/TSE.2023.3270117