Перейти к содержимому
Hub Nexus

Автора пока нетВзять себе

Версия 3Обновлено 3 мин чтения

Поддержка

Decentralized applications (dApps) on blockchains such as Ethereum are built from several smart contracts, each with functions that can be called to trigger an action such as a token transfer. How are they actually put together? A paper posted on arXiv turns the code of 66 dApps into networks and finds a consistent structure across them, along with a possible weak point.

What they studied

The authors took the smart contract code of each dApp from its GitHub repository and parsed it with a tool built for Solidity, the main smart contract language, called MindTheDApp. The dataset has 51 dApps based mainly on Ethereum and 15 on other blockchains (Binance, Optimism, Polygon, Astar, Shiden and ThunderCore), in categories such as decentralized finance (DeFi), art and collectibles, gaming, technology, gambling and staking. They concentrated on DeFi because DeFi protocols were the main targets of cryptocurrency hackers in 2021, a pattern that grew in 2022. For each dApp they built two weighted directed networks: one of contracts calling other contracts, and one of functions, obtained by projecting the function-to-contract links onto functions with a probabilistic-spreading method and then filtering out statistically insignificant links. Smaller dApps have only a few contracts: the smallest, 1inch Network, has 2 contracts and 6 functions, and the largest, Balancer, has 193 contracts and 531 functions. On average a dApp has about 5.09 times as many functions as contracts, which the authors read as a way of spreading tasks so that a single failure does less damage, as in ordinary software engineering.

Findings

Scatter plots for DeFi dApps: diameter of the largest component and clustering against the number of components

Top: diameter of the largest connected component against the number of components. Bottom: global clustering coefficient in the largest components against the number of components. Each dot is a DeFi dApp, sized by its number of functions. Figure from the paper, CC BY 4.0.

  • Contracts mostly work alone. The contract networks are sparse, mostly with 2 to 3 connections per node. Most links are self-loops, meaning a contract calling its own functions: 54 networks have at least 40% of their nodes with self-loops, and 33 networks have at least 60% of their nodes connected only through self-loops. Average modularity (how clearly a network divides into communities) is 0.8. The authors read this as deliberate independence between contracts, perhaps to improve security and avoid chain failures, since deployed contracts cannot be changed.
  • Functions form a core and satellites. Function networks are denser, with average modularity 0.69. Each has one largest component containing functions from multiple contracts, which holds the dApp's main functionality, and smaller components that each sit inside a single contract and handle secondary tasks. In Aave, for instance, the core includes functions for setting a reserve's interest rate and liquidation fee. The authors speculate that the core was developed in a planned way and the satellites added as needed.
  • Small-world features. The largest components have high clustering and short average paths, like a small-world network. Functions tend to have high clustering or high betweenness (acting as bridges between communities), but not both, and a comparison with a randomized model shows the structure is not just a consequence of modularity.
  • Few critical functions. Removing the few functions with the highest betweenness quickly disconnects the largest component, while random removal does not. Among 29 dApps with more than 50 nodes in the largest component, in 20 the component disconnected after removing about 2% of nodes, which the authors take as a critical threshold. In one case, removing two functions that control and carry out token withdrawals disconnected it.

Clustering coefficient against betweenness for real function networks and a randomized null model

Left: clustering coefficient against betweenness in the real networks. Right: the same for a random null model. Figure from the paper, CC BY 4.0.

What the authors conclude

The consistent structure suggests different development teams, on different blockchains, follow similar coding practices. Giving each function a precise role limits the effects of faults and makes interactions easier to trace and verify, and optimizing calls could cut gas fees. But the small group of bridge functions could be targets for attackers, so the authors call for strong protection of them. They note the study looks only at code structure, and the next step is to look at real transaction data, on-chain execution and the use of functions, and the history of code changes on GitHub.

Sources

  • Sabrina Aufiero, Giacomo Ibba, Silvia Bartolucci et al., "DApps Ecosystems: Mapping the Network Structure of Smart Contract Interactions," arXiv (https://arxiv.org/abs/2401.01991), licensed under CC BY 4.0. Figures 11 and 12 are the paper's own, CC BY 4.0. Changed here: rewritten in hubnx's own words and shortened; the dataset's count of small, medium and large dApps, which does not match its total, is not given; the mathematics, tables, appendices and references are left out.

Комментарии

Spinner Logo

Ещё на тему «Наука»

Автор: Hub Nexus editors
Top 10 in AI, week of 12 October 2026
Автор: Hub Nexus editors
Top 10 in AI, week of 2 November 2026
Автор: Hub Nexus editors
Top 10 in AI, week of 26 October 2026
Автор: Hub Nexus editors
Top 10 in AI, week of 19 October 2026
CC0 1.0 (общественное достояние)
NEW YORK (January 29, 2015) – The NFL, GE (NYSE:GE) and Under Armour (NYSE:UA), today announced that they have joined with the U.S.
CC0 1.0 (общественное достояние)
Sea ice grows throughout the winter and melts throughout the summer, reaching its maximum extent in late February or March, and its minimum extent in September. The ice that survives at least one summer melt season is typically thicker and more likely to survive future summers. Since the 1980s, the