Decentralized applications, the driving force behind the new Web3 paradigm, require continuous access to blockchain data. Their adoption, however, is hindered by the constantly increasing size of blockchains and the sequential scan nature of their read operations, which introduce a clear inefficiency bottleneck. Also, the growing amount of data recorded on the blockchain makes resource-constrained light nodes dependent on untrusted full nodes for fetching information, with a consequent need for query authentication protocols ensuring result integrity. Motivated by these reasons, in this paper we propose the skip index, an indexing data structure that allows users to quickly retrieve information simultaneously from multiple blocks of a blockchain. Our solution is also designed to be used as an authenticated data structure to guarantee the integrity of query results for light nodes. We discuss the theoretical properties of skip indices, propose efficient algorithms for their construction and querying, and detail their computational complexity. Finally, we assess the effectiveness of our proposal through an experimental evaluation on the Ethereum blockchain. As a reference use case, we focus on the popular CryptoKitties application and simulate a scenario where users seek to retrieve the events generated by the service. Our experimental results suggest that the use of skip indices offers a constant multiplicative speedup, thanks to search times that are at most logarithmic within a chosen search window. This allows to reduce the number of visited blocks by up to two orders of magnitude if compared to the naive sequential approach currently in use.
Read full abstract