Abstract:The widespread deployment of smart contracts on Ethereum has injected vitality into the blockchain ecosystem, while the irreversibility and anonymity of smart contracts have posed great challenges to supervision. Criminals take the opportunity to deploy Ponzi schemes on Ethereum, causing serious security risks and economic losses. Therefore, it is essential to detect Ponzi scheme smart contracts quickly and efficiently. The main challenges of the current Ponzi scheme detection method include the neglect of the behavior characteristics of smart contract opcodes, incomplete feature extraction, unstable performance, and low accuracy of the detection method when the method is subjected to anti-interference. To overcome these shortcomings, this study proposes an Ethereum Ponzi scheme detection method that combines TextCNN and adversarial training. This method extracts the behavioral characteristics of smart contracts by the static analysis of smart contracts, and combines the Word2Vec model to retain the semantic information of smart contracts to ensure the integrity of the opcode features. Meanwhile, the improved dynamic step projection gradient descent algorithm is adopted to train the TextCNN model to enhance the robustness of the detection model and improve the detection accuracy. Experiments carried out on the XBlock dataset show that the proposed method achieves a Recall of 98.36% and F1-score of 98.31% while ensuring precision and robustness. The method focuses on smart contract opcodes without relying on transaction features, and can quickly and efficiently detect Ponzi scheme smart contracts at the time of smart contract deployment.