Detecting structural changes in blockchain transaction time series

Sergey Mastitsky
Geek Culture
Published in
8 min readOct 18, 2021

--

Using R

Photo by Ian Parker on Unsplash

Blockchain transaction times series often show conspicuous changes in their mean levels and volatility. Usually, such structural changes simply reflect the normal behaviour of blockchain users. In some cases, however, they may indicate that the blockchain is under attack by malicious agents. One of the recent examples of the latter category is a denial of service attack on the Solana blockchain. The attack was caused by trading bots that flooded the network with transactions and brought it to a complete halt for excruciating 17 hours. It took Solana validators 11 minutes to notice the transaction spike and network slowdown. If this spike were detected earlier, perhaps the network outage could be prevented altogether.

Irrespective of the root cause, it can be of great practical importance to identify regime shifts in blockchain transactions early on and in an automated way. One can achieve this with the help of various algorithms for change point detection in time series. Provided herein are examples of how this could be done in a non-parametric way using the ecp package for R. Readers are assumed to have a high-level understanding of blockchain technology and be comfortable with R and its tidyverse tools.

--

--