Smart contracts are the heart of the entire blockchain industry, from meme coins to complex DeFi platforms. These automated programs, however, face the persistent threat of cyberattacks, which often lead to significant financial and reputational losses. The best defense, according to a team of researchers, is artificial intelligence.
A new study titled Deep learning-based solution for smart contract vulnerabilities detection proposes a novel solution called Lightning Cat, which employs deep learning techniques to identify vulnerabilities in smart contracts. Unlike traditional analysis tools, Lightning Cat utilizes deep learning methods to flag possible problems, resulting in better detection performance. The researchers trained the AI bot on the Solidity programming language, the language commonly used for writing smart contracts.
The results show that the proposed method has more reasonable data preprocessing and model optimization, resulting in better detection performance, the researchers said. Lightning Cat is based on three optimized deep learning models: CodeBERT, LSTM, and CNN. These models undergo training on data sets comprising thousands of vulnerable contracts. Notably, the CodeBERT model outperforms static detection tools, demonstrating an impressive f1-score of 93.53%, accurately capturing the syntax and semantics of the code.
While beneficial in enhancing smart contract security, Lightning Cat comes with some risks. The researchers call it a double-edged sword because there’s potential for malicious actors to exploit this technology, using it to detect bugs and exploit them instead of fixing them. To mitigate this, the researchers encourage proper security practices, regular code audits, and responsible vulnerability disclosure policies.
The importance of this work is underscored by the long history of smart contract breaches. In 2016, the DAO attack resulted in a $60 million Ethereum theft and led to the Ethereum blockchain’s split. Similar incidents, such as the BEC smart contract breach in 2018, have caused significant disruptions to the market.
The Lightning Cat initiative is part of a broader trend where AI and blockchain technologies are converging to enhance software security. This trend includes the development of an AI and blockchain-based decentralized software testing system, which combines the power of deep learning with the transparency and reliability of blockchain technology. Proponents argue that this approach significantly accelerates the vulnerability detection process and is proving especially beneficial in remote work scenarios.
The use of Lightning Cat is particularly valuable for developers to test their tools before deployment. Many DeFi exploits could be avoided with proper security checks, as pointed out by Halborn COO David Schwed. He emphasized that several hacks are not necessarily on-chain vulnerabilities but instead result from compromised standard Web2 security due to poor security practices.
Utilizing AI to detect code vulnerabilities is a promising solution to enhance smart contract security. The Lightning Cat initiative demonstrates the potential of deep learning and its ability to address the persistent threat of cyberattacks. By combining the power of AI and blockchain, this approach offers a comprehensive solution for secure code development and testing in decentralized environments.
In summary, artificial intelligence, represented by Lightning Cat, is emerging as a powerful tool to identify vulnerabilities in smart contracts. While its adoption brings risks, developers and organizations can benefit from leveraging this technology to enhance the security of their blockchain-based systems. By integrating AI and blockchain technologies, the industry is taking significant steps towards improving software security and preventing the financial and reputational losses associated with cyberattacks on smart contracts.