Smart contracts, as a core component of blockchain systems, play a critical role in ensuring the stability and trustworthiness of decentralized applications. The logs generated during contract execution provide essential evidence for vulnerability detection and behavior auditing. This paper proposes LogSentry, a deep neural network-based framework for real-time vulnerability detection in smart contracts. The framework leverages Long Short-Term Memory (LSTM) networks to model contract execution logs as natural language sequences, learning normal contract behavior patterns and promptly detecting log sequences that deviate from typical execution trajectories when potential anomalies occur. Furthermore, we introduce an incremental update mechanism that enables the model to dynamically adapt as contract log patterns evolve over time. Experimental results on multiple real-world smart contract datasets demonstrate that LogSentry achieves up to 97% accuracy in detecting abnormal executions and potential vulnerabilities, indicating its effectiveness and practical applicability.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

LogSentry: An LSTM-Based Framework for Real-Time Vulnerability Detection in Smart Contracts

  • Lvbin Xu,
  • Lei Wu,
  • Xingyu Wu,
  • Zhaoyu Su

摘要

Smart contracts, as a core component of blockchain systems, play a critical role in ensuring the stability and trustworthiness of decentralized applications. The logs generated during contract execution provide essential evidence for vulnerability detection and behavior auditing. This paper proposes LogSentry, a deep neural network-based framework for real-time vulnerability detection in smart contracts. The framework leverages Long Short-Term Memory (LSTM) networks to model contract execution logs as natural language sequences, learning normal contract behavior patterns and promptly detecting log sequences that deviate from typical execution trajectories when potential anomalies occur. Furthermore, we introduce an incremental update mechanism that enables the model to dynamically adapt as contract log patterns evolve over time. Experimental results on multiple real-world smart contract datasets demonstrate that LogSentry achieves up to 97% accuracy in detecting abnormal executions and potential vulnerabilities, indicating its effectiveness and practical applicability.