Explainable Smart Contract Classification for Metaverse Applications Using Hybrid CodeBERT Embeddings and Static Code Analysis
International Journal Research on Metaverse · 02.11.2026 · 3 (4) · 289-307
DOI: 10.47738/ijrm.v3i4.88 ↗Kurz gefasst
Fachartikel in der Zeitschrift International Journal Research on Metaverse, online erschienen am 02.11.2026. Verfasst von P. Gajalakshmi.
Abstract (Originalsprache)
The rapid growth of blockchain technology has significantly increased the number of deployed smart contracts, particularly in metaverse ecosystems where they support applications such as non-fungible tokens (NFTs), decentralized finance (DeFi), tokens, decentralized autonomous organizations (DAOs), and digital marketplaces. The increasing volume and diversity of smart contracts make manual identification of their application categories inefficient and difficult to scale. Existing studies primarily focus on vulnerability detection, malware analysis, and code similarity, while research on automatic smart contract classification remains relatively limited. Furthermore, many deep learning approaches lack interpretability, making their prediction process difficult for blockchain developers to understand. This study proposes an explainable framework for automatic smart contract classification by combining CodeBERT embeddings, static Solidity code analysis, and machine learning. The proposed framework integrates semantic code representations with handcrafted structural features to construct a hybrid feature representation for classifying Solidity smart contracts into Token, NFT, DeFi, and Other categories. Four machine learning algorithms, namely Random Forest, HistGradientBoosting, XGBoost, and Support Vector Machine (SVM), were evaluated using stratified cross-validation. Experimental results on a dataset of 377 Solidity smart contracts show that the Random Forest classifier achieved the best performance, obtaining an accuracy of 90.79%, macro precision of 87.59%, macro recall of 86.09%, macro F1-score of 85.81%, and macro ROC-AUC of 98.51%. SHAP-based explainability analysis identified code_chars, code_tokens, n_mappings, n_functions, and n_requires as the most influential structural features affecting classification decisions. The results demonstrate that the proposed hybrid representation provides accurate and interpretable smart contract classification, offering a practical solution for supporting blockchain developers and researchers in managing the growing ecosystem of metaverse applications.
Zitieren
APA
Gajalakshmi, P. (2026). Explainable Smart Contract Classification for Metaverse Applications Using Hybrid CodeBERT Embeddings and Static Code Analysis. International Journal Research on Metaverse, 3(4), 289-307. https://doi.org/10.47738/ijrm.v3i4.88
Vancouver
Gajalakshmi P. Explainable Smart Contract Classification for Metaverse Applications Using Hybrid CodeBERT Embeddings and Static Code Analysis. International Journal Research on Metaverse. 2026;3(4):289-307. doi:10.47738/ijrm.v3i4.88
BibTeX
@article{Gajalakshmi2026,
author = {Gajalakshmi, P.},
title = {Explainable Smart Contract Classification for Metaverse Applications Using Hybrid CodeBERT Embeddings and Static Code Analysis},
journal = {International Journal Research on Metaverse},
year = {2026},
volume = {3},
number = {4},
pages = {289--307},
doi = {10.47738/ijrm.v3i4.88}
}
EUVIMED