Journals
  Publication Years
  Keywords
Search within results Open Search
Please wait a minute...
For Selected: Toggle Thumbnails
Smart contract generation framework driven by LLM and SWRL for cross-border data compliance across heterogeneous blockchains
Linkai ZHU, Lu YANG, Hongjie ZHANG, Zijin WU, Lu LIU
Journal of Computer Applications    2026, 46 (7): 2074-2084.   DOI: 10.11772/j.issn.1001-9081.2026010107
Abstract36)   HTML0)    PDF (2934KB)(3)       Save

Enterprises operating across borders often face conflicting data protection regulations and must address coordinated execution across heterogeneous blockchains, making compliant cross-border data transfer complex and risky. Therefore, a smart contract generation framework driven by Large Language Model (LLM) and Semantic Web Rule Language (SWRL) was proposed for cross-border data compliance across heterogeneous blockchains. First, centering on formalized rule definition-driven access control, cross-chain interoperability between two heterogeneous blockchains was achieved by cooperating with notarization services. Additionally, the data subject's latest authorization was injected into access decisions in real-time by utilizing an integrated consent module. Second, a rule matching framework based on finite-state decision process was constructed to decompose Semantic Web Rule Language (SWRL) compliance rules into reusable and modular logical units. Finally, a fine-tuned LLM was introduced to complete the SWRL rules semantically, which were automatically converted into executable smart contract code on the blockchain. Experimental results show that in the smart contract code generation task, the fine-tuned LLM achieves a comprehensive code generation success rate (FullRate) of 76.1%, which is improved by 18.6, 3.2, and 1.2 percentage points compared to that of the baseline models LLaMA-3-8B-Instruct, DeepSeek-V3, and DeepSeek-R1, respectively. Furthermore, the performance of the prototype system was evaluated under varying network node counts and adjustable channel configurations, demonstrating that it meets enterprise-level scalability requirements. The proposed framework significantly enhances the efficiency of smart contract generation while maintaining high security and logical correctness, demonstrating the practical feasibility and engineering application value of the framework in efficient and compliant cross-border data sharing scenarios.

Table and Figures | Reference | Related Articles | Metrics