With the development of blockchain technology, more and more attention has been paid to the intersection of blockchain and education, and various educational evaluation systems and E-learning systems are developed based on blockchain technology. Among them, Ethereum smart contract is favored by developers for its ``event-triggered" mechanism for building education intelligent trading systems and intelligent learning platforms. However, due to the immutability of blockchain, published smart contracts cannot be modified, so problematic contracts cannot be fixed by modifying the code in the educational blockchain. In recent years, security incidents due to smart contract vulnerabilities have caused huge property losses, so the detection of smart contract vulnerabilities in educational blockchain has become a great challenge. To solve this problem, this paper proposes a graph neural network (GNN) based vulnerability detection for smart contracts in educational blockchains. Firstly, the bytecodes are decompiled to get the opcode. Secondly, the basic blocks are divided, and the edges between the basic blocks according to the opcode execution logic are added. Then, the control flow graphs (CFG) are built. Finally, we designed a GNN-based model for vulnerability detection. The experimental results show that the proposed method is effective for the vulnerability detection of smart contracts. Compared with the traditional approaches, it can get good results with fewer layers of the GCN model, which shows that the contract bytecode and GCN model are efficient in vulnerability detection.
翻译:随着区块链技术的发展,区块链与教育的交叉领域日益受到关注,各种基于区块链技术的教育评价系统和电子学习系统被开发出来。其中,以太坊智能合约因其构建教育智能交易系统和智能学习平台的"事件触发"机制而受到开发者青睐。然而,由于区块链的不可篡改性,已发布的智能合约无法修改,因此教育区块链中的问题合约无法通过修改代码来修复。近年来,因智能合约漏洞引发的安全事件造成了巨大财产损失,因此教育区块链中智能合约漏洞的检测成为一大挑战。为解决此问题,本文提出了一种基于图神经网络(GNN)的教育区块链智能合约漏洞检测方法。首先,将字节码反编译以获取操作码;其次,划分基本块,并根据操作码执行逻辑在基本块之间添加边;然后,构建控制流图(CFG);最后,我们设计了一个基于GNN的漏洞检测模型。实验结果表明,所提方法对智能合约漏洞检测是有效的。与传统方法相比,该方法在使用较少层数的GCN模型时即可取得良好效果,这表明合约字节码与GCN模型在漏洞检测中具有高效性。