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

Ye Liu, Yuqing Niu, Chengyan Ma, Ruidong Han, Wei Ma +3 more
2/20/2025
cs.SEcs.AI

No confident code implementation found for this paper.

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{liu2025towards,
  title  = {Towards Secure Program Partitioning for Smart Contracts with LLM's In-Context Learning},
  author = {Ye Liu and Yuqing Niu and Chengyan Ma and Ruidong Han and Wei Ma and Yi Li and Debin Gao and David Lo},
  year   = {2025},
  eprint = {2502.14215},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.14215v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.14215.svg)](https://codeofpaper.com/paper/2502.14215)

Discussion