The following document explains the way Devonomics amounts are attributed to Starknet contracts in the first iteration of Devonomics. We stress that the computation applied here will be modified in the future as we manage to measure more accurately the exact fees that are attributed to each node in the transaction tree.

We consider blocks on mainnet from the beginning of the network (16/11/2021) to the end of November 2023. More precisely, we consider block numbers between 1 and 448500. The total fees collected are ~16.3K ETH. When all is said and done, we want to distribute 8% of this amount (~1,300 ETH) to dapps and an additional 2% (~320 ETH) to core devs. The protocol regarding the 2% redistribution is not described in this document. Regarding the 8%, below we describe how we computed the amounts to be distributed per contract addresses.

Step 1

Divide the data per block.

Step 2

Distribute $F_1$ and $F_2$ per contract (in the block), at the level of internal calls.

Step 3

Aggregate the data per contract over all blocks between 1 and 448500. This leads to a table of the form

Contract Fees due to storage diffs Fees due to steps and builtins
0x12345 30 ETH 1 ETH

Note that in the linked table the fees due to storage diffs are called “L1 fees” and fees due to steps and builtins are called “L2 fees”. Moreover, the table only lists the top 10K contracts by fees, therefore the total fees sum to less than the total fees of the network.

Step 4

Take a weighted sum of the [Fees due to storage diffs] column and [Fees due to steps and builtins] column, with weights $a_1, a_2$ respectively. At this stage the weights are $a_1 = 0.055, a_2 = 2$. This gives the final amount to be distributed to the contract.

Scripts