Enhancing smart contract security: Leveraging pre‐trained language models for advanced vulnerability detection
Abstract The burgeoning interest in decentralized applications (Dapps), spurred by advancements in blockchain technology, underscores the critical role of smart contracts. However, many Dapp users, often without deep knowledge of smart contracts, face financial risks due to hidden vulnerabilities. T...
Saved in:
| Main Authors: | , , |
|---|---|
| Format: | Article |
| Language: | English |
| Published: |
Wiley
2024-12-01
|
| Series: | IET Blockchain |
| Subjects: | |
| Online Access: | https://doi.org/10.1049/blc2.12072 |
| Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
| _version_ | 1850099378258182144 |
|---|---|
| author | Fei He Fei Li Peili Liang |
| author_facet | Fei He Fei Li Peili Liang |
| author_sort | Fei He |
| collection | DOAJ |
| description | Abstract The burgeoning interest in decentralized applications (Dapps), spurred by advancements in blockchain technology, underscores the critical role of smart contracts. However, many Dapp users, often without deep knowledge of smart contracts, face financial risks due to hidden vulnerabilities. Traditional methods for detecting these vulnerabilities, including manual inspections and automated static analysis, are plagued by issues such as high rates of false positives and overlooked security flaws. To combat this, the article introduces an innovative approach using the bidirectional encoder representations from transformers (BERT)‐ATT‐BiLSTM model for identifying potential weaknesses in smart contracts. This method leverages the BERT pre‐trained model to discern semantic features from contract opcodes, which are then refined using a Bidirectional Long Short‐Term Memory Network (BiLSTM) and augmented by an attention mechanism that prioritizes critical features. The goal is to improve the model's generalization ability and enhance detection accuracy. Experiments on various publicly available smart contract datasets confirm the model's superior performance, outperforming previous methods in key metrics like accuracy, F1‐score, and recall. This research not only offers a powerful tool to bolster smart contract security, mitigating financial risks for average users, but also serves as a valuable reference for advancements in natural language processing and deep learning. |
| format | Article |
| id | doaj-art-46f61c31e91c4d4fbfd7a1948ca6390b |
| institution | DOAJ |
| issn | 2634-1573 |
| language | English |
| publishDate | 2024-12-01 |
| publisher | Wiley |
| record_format | Article |
| series | IET Blockchain |
| spelling | doaj-art-46f61c31e91c4d4fbfd7a1948ca6390b2025-08-20T02:40:30ZengWileyIET Blockchain2634-15732024-12-014S154355410.1049/blc2.12072Enhancing smart contract security: Leveraging pre‐trained language models for advanced vulnerability detectionFei He0Fei Li1Peili Liang2College of Blockchain Industry Chengdu University of Information Technology Chengdu Sichuan ChinaCollege of Blockchain Industry Chengdu University of Information Technology Chengdu Sichuan ChinaCollege of Blockchain Industry Chengdu University of Information Technology Chengdu Sichuan ChinaAbstract The burgeoning interest in decentralized applications (Dapps), spurred by advancements in blockchain technology, underscores the critical role of smart contracts. However, many Dapp users, often without deep knowledge of smart contracts, face financial risks due to hidden vulnerabilities. Traditional methods for detecting these vulnerabilities, including manual inspections and automated static analysis, are plagued by issues such as high rates of false positives and overlooked security flaws. To combat this, the article introduces an innovative approach using the bidirectional encoder representations from transformers (BERT)‐ATT‐BiLSTM model for identifying potential weaknesses in smart contracts. This method leverages the BERT pre‐trained model to discern semantic features from contract opcodes, which are then refined using a Bidirectional Long Short‐Term Memory Network (BiLSTM) and augmented by an attention mechanism that prioritizes critical features. The goal is to improve the model's generalization ability and enhance detection accuracy. Experiments on various publicly available smart contract datasets confirm the model's superior performance, outperforming previous methods in key metrics like accuracy, F1‐score, and recall. This research not only offers a powerful tool to bolster smart contract security, mitigating financial risks for average users, but also serves as a valuable reference for advancements in natural language processing and deep learning.https://doi.org/10.1049/blc2.12072artificial intelligenceblockchain applications and digital technologyblockchainscontractsdecentralized applications |
| spellingShingle | Fei He Fei Li Peili Liang Enhancing smart contract security: Leveraging pre‐trained language models for advanced vulnerability detection IET Blockchain artificial intelligence blockchain applications and digital technology blockchains contracts decentralized applications |
| title | Enhancing smart contract security: Leveraging pre‐trained language models for advanced vulnerability detection |
| title_full | Enhancing smart contract security: Leveraging pre‐trained language models for advanced vulnerability detection |
| title_fullStr | Enhancing smart contract security: Leveraging pre‐trained language models for advanced vulnerability detection |
| title_full_unstemmed | Enhancing smart contract security: Leveraging pre‐trained language models for advanced vulnerability detection |
| title_short | Enhancing smart contract security: Leveraging pre‐trained language models for advanced vulnerability detection |
| title_sort | enhancing smart contract security leveraging pre trained language models for advanced vulnerability detection |
| topic | artificial intelligence blockchain applications and digital technology blockchains contracts decentralized applications |
| url | https://doi.org/10.1049/blc2.12072 |
| work_keys_str_mv | AT feihe enhancingsmartcontractsecurityleveragingpretrainedlanguagemodelsforadvancedvulnerabilitydetection AT feili enhancingsmartcontractsecurityleveragingpretrainedlanguagemodelsforadvancedvulnerabilitydetection AT peililiang enhancingsmartcontractsecurityleveragingpretrainedlanguagemodelsforadvancedvulnerabilitydetection |