Monitoring Blockchain Cryptocurrency Transactions to Improve the Trustworthiness of the Fourth Industrial Revolution (Industry 4.0)

: A completely new economic system is required for the era of Industry 4.0. Blockchain technology and blockchain cryptocurrencies are the best means to confront this new trustless economy. Millions of smart devices are able to complete transparent financial transactions via blockchain technology and its related cryptocurrencies. However, via blockchain technology, internet ‐ connected devices may be hacked to mine cryptocurrencies. In this regard, monitoring the network of these blockchain ‐ based transactions can be very useful to detect the abnormal behavior of users of these cryptocurrencies. Therefore, the trustworthiness of the transactions can be assured. In this paper, a novel procedure is proposed to monitor the network of blockchain cryptocurrency transactions. To do so, a hidden Markov multi ‐ linear tensor model (HMTM) is utilized to model the transactions among nodes of the blockchain network. Then, a multivariate exponentially weighted moving average (MEWMA) control chart is applied to the monitoring of the latent effects. Average run length (ARL) is used to evaluate the performance of the MEWMA control chart in detecting blockchain network anomalies. The proposed procedure is applied to a real dataset of Bitcoin transactions.


Introduction
The fourth industrial revolution has changed the life of human beings in different ways, which means it has transformed the world into a great information system [1]. It has brought different new innovations, including the Internet of Things (IoT), smart machines, etc., to our lives. In this era, the digitalization and networking of systems increase the amount of data that can support the functions of analysis in different industries [2]. Various Industry 4.0-based applications, including manufacturing, agriculture, healthcare, logistics, and finance sectors, deal with data in large volumes [3]. Building such an automated world requires a large number of tools with connectivity to the internet [4]. Blockchain technology has brought new ways to achieve work processes in such industries. In other words, it is a new way of transferring and storing data. For example, in finance, blockchain enables business transactions to be completed safely with smart contracts [1].
A blockchain, which is a decentralized ledger system, can be defined as a collection of transactions between nodes inside each block [5]. Blockchain provides data security without any other third party organization [6]. Incorporating blockchain and Industry 4.0 offers a high level of automation, more flexible systems, smart contracts, security, and micropayments [4,7,8]. Therefore, blockchain is the most important innovation of the last industrial revolution. The inherent security of blockchain, which inhibits any of the content being changed once it has been stored in a block, and decentralization of the blockchain, incorporates collaboration and transparency. One of the most important effects of Industry 4.0 is the blockchain cryptocurrency market, which started with Bitcoin. Bitcoin is the name of the most common cryptocurrency, the one for which blockchain technology was created. Bitcoin is the world's largest digital currency known as a cryptocurrency market [9,10]. According to www.coinmarketcap.com, the number of Bitcoin nodes, as the most common blockchain cryptocurrency, is growing and is currently more than 47,000 nodes. However, the emergence of blockchain and cryptocurrencies has put internet-connected devices in more danger of being hijacked by hackers to mine cryptocurrencies [11]. In this regard, monitoring blockchain cryptocurrency networks and analyzing different factors and characteristics as well as the unobserved structure of the blockchain network can be useful to observe abnormal behaviors of nodes and transactions. A network is a structure that indicates interactions among individual entities involving relationships. With the rapid development of network data, it has become important to use these data in order to capture various information on social, biological, computer, financial etc. networks. In this regard, Luqman et al. [12] applied complex neutrosophic hypergraphs to the theory of social networks and discussed lower truncation, upper truncation, and transition levels of the proposed model to deal with the periodic nature of inconsistent information in hyper networks. Behera et al. [13] proposed a computing method to calculate network centrality value in large-scale datasets, including social networks. They focused on the centrality analysis of time-varying social network entities for a Twitter dataset. Salehi Rizi and Granitzer [14] proposed a methodology to identify graph properties explaining the similarity of the local neighborhood of a node by randomwalk based graph embedding methods. Then, they examined whether embedding can be used to predict centrality values directly. Recently, the emergence of blockchain technology gave access to stored financial transaction data [15][16][17]. Thus, the financial industry is the main user of blockchain because of the cryptocurrency application [18]. In this regard, many research studies have focused on transaction network analysis. We review some papers related to this field in Section 2.
This paper proposes an approach to monitor the latent patterns of a blockchain-based cryptocurrency transaction network. To do so, the blockchain network is modeled as a dynamic network in which every blockchain cryptocurrency account is considered as a node and edges represent the transactions between two nodes. Then, the network is modeled with a hidden Markov multi-linear tensor model (HMTM), and its parameters are estimated by a Markov Chain Monte Carlo (MCMC) algorithm. Finally, a multivariate exponentially weighted moving average (MEWMA) control chart is utilized to monitor the estimated latent parameters. Therefore, if any abnormal behavior in the blockchain cryptocurrency transactions occurs, the control chart can signal an out-ofcontrol condition. The proposed procedure can also be used to monitor other network applications, as Industry 4.0 has made network transactions an essential part of manufacturing, financial, social, etc. systems. Despite the importance of monitoring cryptocurrency transactions for a more trustful Industry 4.0 economy, this line of research has not gained much attention. Therefore, statistical modeling and monitoring of blockchain cryptocurrency transaction networks are investigated in this research. To the best of our knowledge, this is the first research study that attempts to statistically monitor the network of cryptocurrency transactions.
The remainder of this paper is organized as follows. In Section 2, we review related papers, and in Section 3, we briefly discuss the multi-linear tensor model (MTRM) and its Bayesian parameter estimation method using a MCMC algorithm. Section 4 describes the monitoring scheme of the proposed network model. In Section 5, the performance of the proposed approach is evaluated using a simulation. In Section 6, Mt. Gox blockchain Bitcoin dataset is used to reveal a real-world example. Finally, concluding remarks and future research are stated in Section 7.

Related Works
In this section, statistical monitoring methods and social network models used to analyze blockchain cryptocurrencies are reviewed. Chan et al. [19] analyzed the exchange rate of the most popular cryptocurrencies, including Bitcoin, by calculating summary statistics. Chu et al. [20] proposed statistical analysis of the log-returns of the exchange rate of Bitcoin by using the most popular parametric distributions in finance. They have predicted the log-returns of the exchange rate based on the two most popular financial risk measures, the value at risk (VaR) and the expected shortfall (ES). Bakar and Rosbi [21] evaluated the volatility condition for Bitcoin's exchange rate. They performed a normality test and used statistical control charts to detect high volatility. Szetela [22] used control charts to compare Bitcoin to USD exchange rate and EUR to USD exchange rate volatility. They used Xbar-S and cumulative sum (CUSUM) control charts to evaluate the stableness of Bitcoin and United States dollar (USD).
Li et al. [17] presented a temporal weighted MultiDiGraph that includes temporal and weighted characteristics of financial transaction networks to model Ethereum, which is a blockchain cryptocurrency network, and to capture more comprehensive properties of dynamic transaction networks. Each node is a blockchain cryptocurrency account, and each edge represents the amount of any transaction. They used a node classification method to evaluate the effectiveness of the proposed method by collecting transaction records of phishing and non-phishing accounts from Ethereum. The results indicate that the proposed method outperforms baseline embedding methods. Li et al. [23] assessed risk connectedness in the blockchain cryptocurrency market. They selected the most leading blockchain cryptocurrencies, Bitcoin, Ethereum, Ripple, Litecoin, Stellar, Monero, as well as Dash, and used daily data to investigate risk connectedness among blockchain cryptocurrency markets by applying the semi-parametric conditional autoregressive value at risk (CAViaR) method to estimate VaR models for blockchain cryptocurrencies. They monitored the proposed method using summary statistics for blockchain cryptocurrency risks. Motamed and Bahrak [24] compared the transaction graph of blockchain cryptocurrencies such as Bitcoin, Ethereum, Dash, and Z-Cash by evaluating the growth rate and density of nodes and edges of the blockchain transaction graphs over time. They defined monthly and cumulative monthly blockchain transaction graphs for real-world data. The results reveal various structural behaviors of evolving blockchain transaction networks. Elliott et al. [25] suggested a novel financial blockchain network that embeds financial accounts as nodes and money transferring as a weighted edge between pairs of nodes for a blockchain transaction network. They combined two different approaches with community detection to calculate various amounts of features for each blockchain network and used them to detect anomalies in the network. Chen et al. [9] constructed graphs from leaked transaction history of the Mt. Gox blockchain Bitcoin exchange dataset and analyzed them through various metrics as well as using singular value decomposition (SVD). They found that daily anomalies are related to Bitcoin price and market manipulation patterns. In the current paper, we intend to propose a novel procedure to monitor networks of blockchain cryptocurrencies. Therefore, a hidden Markov multi-linear tensor model and MEWMA control chart are used to model and monitor the trend of blockchain cryptocurrency transactions. Lin et al. [26] modeled a complex network of Ethereum transaction records by the amounts of features of the transactions, called a temporal weighted multidigraph. They conducted experiments on a real dataset to evaluate the effectiveness of the proposed graph model, considering temporal and weighted graph information. Ferretti and D'Angelo [27] analyzed a complex network of Ethereum blockchain transactions. They considered different amounts of transactions and network sizes during different temporal intervals to understand the changes in blockchain use. They used the number of nodes, degree distributions, distance, and clustering coefficients to analyze the complex networks. Javarone and Wright [28] constructed two kinds of networks; Bitcoin network and Bitcoin cash network, to analyze their global structure by using degree distribution, clustering coefficient, and path length. According to the literature, statistically monitoring the network of cryptocurrency transactions has not gained much attention. Therefore, this line of research is investigated in this paper.

Notations
The notations used for formulating the proposed model are defined in Table 1.

Hidden Markov Multi Linear Tensor Model
Recently, dynamic modeling of longitudinal networks has gained much more attention. These networks have found applications in many fields, such as social, economical, biological, etc. One can  [29] is used. Park and Sohn [29] extended the work of Hoff [30,31], which presented a multi-linear tensor model (MTRM). According to Hoff [30,31], network effects can be formulated as the following: Park and Sohn [29] combined MTRM with a hidden Markov model and developed a hidden Markov multi-linear tensor model (HMTM). In a HMTM that involves k breaks, the probability distribution of network data, t B , is modeled as the following: where, t  is a hidden state variable, N 1 is a N N  matrix with all one element, and t E follows a matrix normal distribution with We use the procedure and prior distributions adopted by Park and Sohn [29] for parameter estimation. For more details on MTRM, HMTM, and parameter estimation methods, readers can refer to the works of Park and Sohn [29], and Hoff [30,31].

Monitoring Scheme
The MEWMA control chart is used for the simultaneous monitoring of several variables [32]. In this research, the means of latent node positions for all nodes and node connection rules are monitored. We consider 2 R  dimensions for latent positions and connection rules. Therefore, vector   To obtain MEWMA statistics, vector t Z is defined as the following relation: In which, Λ is the vector of smoothing parameters, which is a diagonal matrix of 1 2 ,.. , where p is the number of variables. If all the variables are equally important, then 1 2 ... p       [33]. The statistic to be calculated for the MEWMA control chart is given as, where, Q is the variance-covariance matrix of the variables. 2 T statistic is monitored using a control chart with an upper control limit defined by  

Performance Evaluation Using Simulation
In this section, the ability of the MEWMA control chart to detect abrupt changes in the network is assessed through simulation. To do so, average run lengths (ARL) of simulated networks in phase II are calculated after applying different shifts to the edge creation probabilities between nodes of the network. Therefore, 500 in-control consecutive networks with 600 nodes are generated to determine the UCL. The networks are modeled with HMTM, and their parameters are estimated through the MCMC algorithm. In this regard, the following steps are followed to generate 10,000 random networks in phase I and obtain the UCL: (2) For 1 t  to 10000, calculate t Z based on relation (6); (3) For 1 t  to 10000, evaluate the 2 T statistics based on relation (7); (4) For all 2 T statistics, find a UCL that the type I error  meets.
For type I error 0.01

 
, the UCL is obtained. Therefore, the in-control ARL of the control chart is 100. For phase II, different probabilities of edges are used to evaluate the performance of the proposed control chart in detecting network anomalies. Then, the following steps are followed to evaluate the out-of-control ARL of the control chart:

Real-World Example
In this section, we used a Bitcoin transaction dataset from 2011 to 2013 of Mt. Gox leaked transactions dataset to analyze users' behavior in a Bitcoin network. Each user has a unique identity as a seller or buyer. Therefore, we used user-IDs as transaction network nodes, and the link between nodes was created if there was at least one transaction between nodes during a month. Figure 2 indicates the sample plot of the transaction network graph for one month. We estimated latent parameters for each month and calculated statistics to analyze abnormal behaviors. In this regard, the MCMC algorithm was implemented with a Markov chain with a length of 1000. The shape parameter of the inverse gamma prior distribution for U is 10, and the scale parameter is one. Additionally, the shape parameter for the inverse gamma prior to variance parameters for V is 10, and the scale parameter is the time length of Y. The prior distribution of error variances is an inverse gamma distribution with the shape and rate parameters equal to 0.1. Estimated t L vectors for 1,..., 25 t  are represented in Table 2. We used 15 months as phase I and 10 months as phase II. Figure 3 represents per month statistics and the upper control limit of phase I for 15 months and phase II statistics for the next 10 months. It is observed in Figure 3 that an increase starting from the 20th month in phase II is detected, and it is obvious that some latent variables have caused this increase in the number of statistics for the 20-25th months. Therefore, we conclude that there is a significant change in monthly transactions especially in the 23rd month in phase II.   In Figure 3, statistic 2 T is plotted versus time. In order to have a better analysis of latent effects, we also plot these effects over time.   For a better analysis of the network, one can monitor separate parts of the network to detect abrupt changes in specific parts of the transaction networks. In this regard, separate control charts can be designed for different parts of the network. In addition, the number of traded Bitcoins can also be monitored. In the current research, when the number of transactions abruptly changes, the control chart will trigger a signal. In Figure 6, the amount of money spent for buying Bitcoins is plotted versus time. This money can be expended by one user or a number of users. Figure 3 cannot be compared with Figure 6 because Figure 3 is based on the number of transactions, and Figure 6 shows the value of transactions. However, Figure 6 indicates an increase starting from the 21st month, which could be an indication of an increase in the number of transactions from the 21st to the 25th month in Figure  3. The proposed procedure can monitor the number of transactions over time. However, the value of transactions can also be a matter of importance. For future research, this procedure can be extended to take into account the value of transactions.

Conclusion
In this paper, a procedure was proposed to monitor network anomalies of transactions in blockchain cryptocurrency networks. To do so, networks of blockchain transactions were modeled by a hidden Markov multi-linear tensor model (HMTM), and the MCMC algorithm was used for parameter estimation. Then, the mean vector of latent node positions and node connection rules were monitored by a MEWMA control chart. Simulation studies confirm the ability of the MEWMA control chart to detect network anomalies. A real dataset of blockchain Bitcoin cryptocurrency was used to show the applicability of the proposed procedure. For future research, blockchain cryptocurrency transactions can be modeled by weighted networks for which the value of transactions is monitored in addition to their quantity.