Abstract
Smart contracts are autonomous software executing predefined conditions. Two of the biggest advantages of the smart contracts are secured protocols and transaction costs reduction. On the Ethereum platform, an open-source blockchain-based platform, smart contracts implement a distributed virtual machine on the distributed ledger. To avoid denial of service attacks and monetize the services, payment transactions are executed whenever code is being executed between contracts. It is thus natural to investigate if predictive analysis is capable to forecast these interactions. We have addressed this issue and propose an innovative application of the tensor decomposition CANDECOMP/PARAFAC to the temporal link prediction of smart contracts. We introduce a new approach leveraging stochastic processes for series predictions based on the tensor decomposition that can be used for smart contracts predictive analytics.
Introduction
As blockchain ecosystems like Ethereum grow, they generate millions of interactions between smart contracts. While much research has focused on the security, optimization, or legal status of these contracts, there is a significant gap in predictive analytics. The challenge lies in the high dimensionality and sparsity of the data: identifying who is sending Ether, to whom, and when. Traditional time-series models struggle to capture the complex, multi-way relationships between thousands of unique accounts. This paper aims to provide a framework to forecast these interactions, facilitating the identification of significant activities for speculative investment and anti-money laundering (AML) efforts.
Methodology
Data Representation and Preprocessing
The study utilizes real-world data from the Ethereum platform spanning August 7, 2015, to March 2, 2016. Initially comprising 2 million transactions, the data was filtered to focus on the 1% most active contracts to ensure meaningful pattern recognition. The resulting dataset was structured as a three-way tensor with dimensions of 459 senders, 813 receivers, and 52 weekly time intervals.
Tensor Decomposition
To handle the sparsity and high dimensionality, the researchers employed Non-negative CANDECOMP/PARAFAC (CP) decomposition. This method breaks the massive transaction tensor into a sum of rank-one tensors, effectively identifying latent factors that represent hidden patterns of interaction across the network.
Hybrid Stochastic Modeling
To predict the evolution of these latent factors, a hybrid stochastic approach was developed:
- Geometric Brownian Motion (GBM): Used to model the general log-normal path of transaction returns.
- Ornstein-Uhlenbeck (OU) Process: Used to model the drift of the transaction series as a mean-reverting process, capturing the tendency of contract activity to return to a long-term average.
- Monte Carlo Simulations: One million simulations were conducted to calculate a "digital payoff," representing the probability that a contract's activity will exceed a specific "strike" level in the future.
Results and Discussion
By setting the decomposition rank to five, the model successfully categorized the network into distinct tiers of activity, ranging from small to very active exchanges. Statistical validation using the Shapiro log-normal test confirmed that the latent factors followed a log-normal distribution, justifying the choice of stochastic models.
The model demonstrated high predictive accuracy, particularly over shorter horizons. For a 5-week prediction window, it achieved a 98% True Positive Rate (TPR) with a 2% False Positive Rate (FPR). Over a longer 26-week horizon, the TPR remained robust at 78%, though the FPR increased to 22% due to cumulative uncertainty.
Conclusion
This research introduces a novel framework for smart contract predictive analytics. While the model shows strong performance, current limitations include the use of static parameters for volatility and correlation. Future work will explore stochastic volatility models to improve long-term accuracy and alternative decomposition methods like DEDICOM to better capture directed relationships. Additionally, optimizing the computational efficiency of the Monte Carlo simulations remains a priority.
Summary updated