Towards Secure Program Partitioning for Smart Contracts with LLM's In-Context Learning

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Liu, Ye, Niu, Yuqing, Ma, Chengyan, Han, Ruidong, Ma, Wei, Li, Yi, Gao, Debin, Lo, David
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866929722178404352
author Liu, Ye
Niu, Yuqing
Ma, Chengyan
Han, Ruidong
Ma, Wei
Li, Yi
Gao, Debin
Lo, David
author_facet Liu, Ye
Niu, Yuqing
Ma, Chengyan
Han, Ruidong
Ma, Wei
Li, Yi
Gao, Debin
Lo, David
contents Smart contracts are highly susceptible to manipulation attacks due to the leakage of sensitive information. Addressing manipulation vulnerabilities is particularly challenging because they stem from inherent data confidentiality issues rather than straightforward implementation bugs. To tackle this by preventing sensitive information leakage, we present PartitionGPT, the first LLM-driven approach that combines static analysis with the in-context learning capabilities of large language models (LLMs) to partition smart contracts into privileged and normal codebases, guided by a few annotated sensitive data variables. We evaluated PartitionGPT on 18 annotated smart contracts containing 99 sensitive functions. The results demonstrate that PartitionGPT successfully generates compilable, and verified partitions for 78% of the sensitive functions while reducing approximately 30% code compared to function-level partitioning approach. Furthermore, we evaluated PartitionGPT on nine real-world manipulation attacks that lead to a total loss of 25 million dollars, PartitionGPT effectively prevents eight cases, highlighting its potential for broad applicability and the necessity for secure program partitioning during smart contract development to diminish manipulation vulnerabilities.
format Preprint
id arxiv_https___arxiv_org_abs_2502_14215
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Towards Secure Program Partitioning for Smart Contracts with LLM's In-Context Learning
Liu, Ye
Niu, Yuqing
Ma, Chengyan
Han, Ruidong
Ma, Wei
Li, Yi
Gao, Debin
Lo, David
Software Engineering
Artificial Intelligence
Smart contracts are highly susceptible to manipulation attacks due to the leakage of sensitive information. Addressing manipulation vulnerabilities is particularly challenging because they stem from inherent data confidentiality issues rather than straightforward implementation bugs. To tackle this by preventing sensitive information leakage, we present PartitionGPT, the first LLM-driven approach that combines static analysis with the in-context learning capabilities of large language models (LLMs) to partition smart contracts into privileged and normal codebases, guided by a few annotated sensitive data variables. We evaluated PartitionGPT on 18 annotated smart contracts containing 99 sensitive functions. The results demonstrate that PartitionGPT successfully generates compilable, and verified partitions for 78% of the sensitive functions while reducing approximately 30% code compared to function-level partitioning approach. Furthermore, we evaluated PartitionGPT on nine real-world manipulation attacks that lead to a total loss of 25 million dollars, PartitionGPT effectively prevents eight cases, highlighting its potential for broad applicability and the necessity for secure program partitioning during smart contract development to diminish manipulation vulnerabilities.
title Towards Secure Program Partitioning for Smart Contracts with LLM's In-Context Learning
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2502.14215