Smart Contract Vulnerability Detection via Semantic and Interface Fusion

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing deep learning-based vulnerability detection methods for smart contracts on the Ethereum blockchain primarily focus on opcode sequences, neglecting semantic features and function interface data, which limits their effectiveness in detecting vulnerabilities.

Innovation Solution

The method constructs a control flowchart, collects opcodes and operands in SSA form, crawls application binary interfaces, and uses sequence-to-sequence models to infer function parameters, combining semantic and function interface features to detect vulnerabilities through a fusion of hidden-layer features.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If deep learning-based vulnerability detection methods focus only on opcode sequences, then the detection method is simple to implement, but the detection accuracy is limited due to neglecting semantic features and function interface data

Engineering Contradiction:
Improvevulnerability detection accuracyVSAvoiddetection method complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent segments the smart contract analysis into multiple independent feature extraction modules: opcode sequence extraction, semantic feature extraction from operands, and function interface data extraction. Each module processes a specific aspect independently, then the features are fused together. This segmentation allows comprehensive feature analysis while maintaining manageable complexity through modular design.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent transitions from one-dimensional opcode sequence analysis to multi-dimensional feature analysis by incorporating semantic features from operands and function interface data as additional dimensions. This dimensional expansion enriches the feature space, enabling more accurate vulnerability detection through comprehensive multi-perspective analysis.

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Measurement precision

If comprehensive multi-dimensional data including operands and function interfaces is used, then vulnerability classification accuracy improves, but the data processing complexity increases

Engineering Contradiction:
Improvevulnerability classification accuracyVSAvoiddata processing complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent merges multiple feature sources (opcode sequences, semantic features from operands, function interface data) into a unified feature representation. The encoder-fuser-decoder architecture combines these diverse features through learned fusion mechanisms, achieving comprehensive vulnerability classification while managing complexity through integrated processing.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent introduces an encoder-fuser-decoder architecture as an intermediary mechanism that bridges the gap between raw multi-dimensional data and vulnerability classification results. This intermediary structure processes and integrates complex features systematically, reducing the burden of direct complex data processing while maintaining high classification accuracy.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If function parameters are extracted and analyzed, then the vulnerability detection comprehensiveness improves, but the computational resources required increase

Engineering Contradiction:
Improvevulnerability detection comprehensivenessVSAvoidcomputational resource consumption
Core Design Contradiction:
ReliabilityVSUse of energy by moving object

Solution Approach 1:

The patent performs preliminary extraction and processing of function parameters and interface data before the main vulnerability detection process. By pre-processing this data and organizing it into structured representations, the system reduces the computational burden during the actual detection phase, achieving comprehensive analysis with optimized resource consumption.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS12093399B1Vulnerability detection method and device for smart contract, and storage medium
Publication Date: 2024.09.17 HAINAN UNIV
  • US12093399B1 patent drawing
  • US12093399B1 patent drawing
  • US12093399B1 patent drawing

AI summary

Disclosed are a vulnerability detection method and device for a smart contract, and a storage medium. The method includes the following steps: constructing a control flowchart for the smart contract and collecting opcodes, operands, and opcodes in a static single assignment (SSA) form based on a call flow thereof; crawling application binary interfaces in a blockchain browser based on an address of the smart contract; using the opcodes and the operands as an input, and outputting function parameters; monitoring whether there are specified actions in functions to determine function attributes; and fusing the opcodes in the SSA form and the application binary interfaces or a concatenation form of the function parameters and the function attributes by an encoder, and obtaining existent vulnerability types by a decoder. With the technical solution of the present disclosure, semantic and function interface information in bytecodes is effectively used, and multi-label vulnerability detection is implemented.