Skip to content
Review Open access

A Semantic Ontology-Based Model for Solidity Smart Contracts With an LLM-Assisted Natural-Language Query Use Case

2026 · IEEE Access · Vol 14, pp. 139068-139084 · 0 citations · 41 references

Abstract

Smart contracts increasingly support high-value and governance-critical blockchain applications, making precise program understanding important for reliable analysis and tooling. Many existing analysis tools rely on task-specific pipelines in which extracted program knowledge is not readily available as reusable and independently queryable semantic data. This paper presents SolOnto, an executable ontology that provides a compiler-grounded semantic representation of Solidity contract structure and selected execution-related semantics. Compared with the ontology and knowledge-graph approaches reviewed in this study, SolOnto distinguishes itself by automatically materializing compiler-produced abstract syntax trees (ASTs) as ontology-aligned Resource Description Framework (RDF) instances and supporting SPARQL-based semantic retrieval. The graphs represent core entities and selected semantics, including statement ordering, state-variable access, and external interactions. Structural semantics are assessed qualitatively, whereas execution-related semantics are evaluated through an implementation-conformance assessment using precision and recall over competency-question-driven queries within the selected contract set. The pipeline is further evaluated using publicly verified contracts from Ethereum Mainnet, Arbitrum, and Optimism Mainnet, including flattened Solidity sources and multi-file Standard JSON artifacts. An evaluated use case examines ontology-supported natural-language-to-SPARQL interaction through constrained query generation, basic query-structure validation, and predefined fallback mechanisms. The evaluated interface is characterized as a constrained hybrid pipeline whose operationally successful responses depend predominantly on predefined fallback templates. Accordingly, the reported end-to-end operational success rate reflects the complete pipeline rather than the standalone translation capability of the LLM. Within the evaluated scope, the findings support the feasibility of SolOnto as a reusable semantic foundation for transparent and queryable smart-contract inspection.

Read PDF

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.