StarkNet Full Analysis

    ETH OPEN ANALYTICS

    What Is StarkNet

    StarkNet is a general-purpose ZK-Rollup built using the STARK cryptographic proof system. ZK-rollups are a favorable scaling solution for Ethereum because they drastically reduce transaction costs while speeding up the time it takes for transactions to be confirmed. The way they do this is by rolling up transactions together for processing off-chain. Once verified, they are moved back on-chain and recorded as a single transaction. This reduces the number of transactions needed to be written to the blockchain in order to verify a single block, therefore significantly reducing the cost.

    Method

    For this analysis I used tokenflow_starknet.decoded.blocks and tokenflow_starknet.l1_data.blocks tables for seeking the number of L2 transactions, L2 block hash, and Transactions hash on L1 which has been verified on the mainnet. For fee calculation, I used the ethereum.core.fact_transactions table which has joined with the mentioned tables.

    Metrics part 1

    This analysis examines the following cases:

    1. Overall Data for each L2 Block
    2. Number of L2 Blocks
    3. Number of L2 Transactions
    4. Generated Fees on L1
    5. Amount of Saving Fee Costs
    Loading...

    In the table you can see the L2 Block hash with the number of transactions in it which sent to L1 for verification. when the L2 block is sent to L1, all the transactions in it counted as one transaction in L1. So the Batch Fee actually refers to one transaction in L1 and batch transactions in L2. The TX_FEE column refers to the fee cost of 1 transaction in L2 that is achieved by dividing Batch_Fee by TX_Count and the FEE_DIFF column is the difference between Batch_FEE and TX_FEE and refers to the saving fee cost for an L2 transaction.

    Loading...


    In terms of over-time data, we can see the number of accepted layer 2 Starknet blocks is 12 on most of the time. we can see a light increasing uptrend over time especially with those high spikes on May and June (during market price crash) and also late July.

    Loading...

    In this chart, you can see the daily number of transactions. There is a total of 329k transactions on L2 that have been accepted on L1.

    In this chart you can see the number of transactions per block and it's increasing over time. The average number of transactions per block is about 120

    Loading...
    Loading...
    Loading...
    Loading...

    In this chart, you can see the batch fee cost for each block. The average fee cost for an L2 block is about: 28.5$

    Loading...

    As you can see, During the time the fee cost for one transaction on L2 has been reduced and it's because of the increasing number of transactions on L2. The average L1 fee cost for one transaction in L2 is 0.713

    Loading...
    Loading...
    Loading...
    • Now we can calculate the saving fee cost for one transaction on L2:

    Conclusion - part 1

    Unlike the Ethereum mainnet, in StarkNet, an increasing number of transactions leads to lower fee costs and it's because of the fee cost divided by all transactions on L2 blocks. If these L2 transactions were done on the L1 as you saw the batch fee costs, they would incur heavy costs. So as a result, we can say the StarkNet team has succeeded in dramatically decreasing the fee cost with their solution.

    The fee calculation formula in StarkNet is very complex. In the ethereum.core.fact_blocks table, by filtering the blocks created by StarkNet, we can access the size of each transaction, which is very useful for calculating the fee. So what is clear is that the size of a transaction is directly related to the GAS for that transaction. But StarkWare’s sequencer will only charge the fee required to cover the proof cost (potentially less than the max fee).

    However, when a number of transactions are performed in a block, all of these transactions are aggregated and sent to Layer 1 of the atrium. Because the StarkWare organizer only receives the cost needed to cover the proof cost, the payout is potentially lower than the fee at Ethereum Layer 1 itself.

    Therefore, since transactions are sent and registered to Layer 1 in bulk, it does not cost users much. However, this low cost does not mean that you can not take advantage of Ethereum Layer 1. While users pay less for their transactions, they can also have Layer 1 features such as high security and reliability for their transactions.

    StarkNet is a decentralized and trustless layer-2 STARK-based ZK-Rollup that allows developers to create and run smart contracts on its platform. Decentralized applications can be deployed independently on StarkNet just like on Ethereum for extremely low fees with increased speed and high throughput. StarkNet also aims to be interoperable with the Ethereum main chain and other layer-2 solutions, enabling liquidity for the general layer-2 crypto market.

    Which platforms are using Starkware :

    DiversiFi: a decentralized exchange that allows you to invest, trade, and swap tokens on Ethereum without paying the expensive gas fees required by the network. DiversiFi makes use of the innovative StarkEx scaling solution to provide high-speed, low-latency, and gas-free self-custodial trading.

    dYdX: one of the most popular decentralized exchanges (DEXes) in the crypto market, offering autonomous derivatives trading. dYdX offers layer-2 perpetual smart contracts via the StarkEx scalability engine, enabling traders to enjoy reduced gas and trading fees, more trading pairs, reduced minimum trade size, instant trade settlements, higher leverage, and lower liquidation penalties.

    Sorare: a fantasy football NFT gaming platform on the Ethereum network that allows users to buy, sell, trade, and manage a virtual football team with digital players. StarkEx allows instant offers, rewards, claims, and transfers on Sorare while also reducing gas fees.

    Read More on Cryptonews

    Read More on Medium

    Loading...
    Loading...

    Based on the chart, we can see total paid fee for accepting blocks on L1 had some high spikes on Nov 2021, but number of transactions was not very high.

    after Nov 2021 and especially since beginning of 2022 , we can see transactions fee trend is lower than number of transactions, it means that despite increasing trend on number of transactions, the generated Fee are being controlled and this can be because of ==Starkware optimization methods==. this is so obvious especially on May and June high spikes.

    So, based on the above analysis we can conclude that StarkNet contributed well to saving in transaction fees for its users.

    Loading...

    part 2 - Deposits and Withdraws to/from Starkware

    Method

    Deposit

    • The ethereum.core.fact_traces table was used.

    • In the table above, the following conditions were applied to apply the most accurate and comprehensive filter possible:

      > > 1. identifier = 'CALL_ORIGIN' > 2. to_address = '0xae0ee0a63a2ce6baeeffe56e7714fb4efe48d419' > 3. ETH_VALUE> '0' > 4. TX_STATUS = 'SUCCESS'

      Withdraw

      • The ethereum.core.fact_traces table was used.

      • In the table above, the following conditions were applied to apply the most accurate and comprehensive filter possible:

        > > 1. from_address = '0xae0ee0a63a2ce6baeeffe56e7714fb4efe48d419' > 2. input = '0x' > 3. ETH_VALUE > '0' > 4. TX_STATUS = 'SUCCESS'

        \

    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    part 2 - conclusion :

    • In all three parameters examined (number of unique wallets, number of actions and amount of ETH), the deposit is at least 10 times larger in terms of numbers than Withdraw.
    • May has probably been the most important month for the Starknet network to date.
    • In June, users' willing behavior towards deposit and withdraw has changed a lot and the tendency to withdraw is more.