🚀
Estimate Tezos performances

NFT transfer performances

At the time of writing (February 2022, Hangzhou):
  • a typical NFT transfer on Tezos consumes¹ 2,691 gas units per transaction,
  • the Tezos maximum block gas limit is 5,200,000 gas units,
  • the block time is 30 seconds.
To maximize throughput, we can use batching - grouping several transactions into a single block.
We performed experiments and measured how gas consumption varies depending on how many NFT transfers we group into a single batch of transactions, as presented in the following experimental values table:
Batch size
Gas consumed
1
2,691
10
9,601
100
78,709
240
186,213
300
232,285
400
309,074
500
385,863
600
462,653
650
501,048
We had to stop at 650, because we had reached the operation size limit imposed by the protocol. Thus, the largest batch we can use is 650. Now we estimate how many batches we can have in a block, considering that the max block gas limit is 5,200,000 gas units:
Max batches=5,200,000501,04810\text{Max batches} = \frac{5,200,000}{501,048} \approx 10
We now need to process the leftover gas:
Leftover gas=5,200,000(10×501,048)189,520\text{Leftover gas} = 5,200,000 - (10 \times 501,048) \approx 189,520
By taking this value and comparing it to our experimental values table we can see that we can add an extra batch of 240 NFT transfers approximately.
That would make the total of NFT transfers per block equal to:
Max NFT transfers per block=(10×650)+(1×240)=6,740\text{Max NFT transfers per block} = (10 \times 650) + (1 \times 240) = 6,740
Since we have two blocks per minute, the number of transactions per second would be:
6,74030224 NFT transfer/second\frac{6,740}{30} \approx 224 \ \text{NFT transfer/second}

Standard Tez transfer performances

For standard tez transfers, we can process the performance of the Tezos blockchain with the following formula:
max gas per blocktx gas consumption×time per block=tx/second\frac{\text{max gas per block}}{\text{tx gas consumption} \times \text{time per block}} = \text{tx/second}
In that scenario, the gas consumption is 1,420 gas units, and we will keep the same values as in the previous calculation:
  • Tezos maximum block gas limit: 5,200,000 gas units
  • Block time: 30 seconds.
5,200,0001,420×30122 tx/second\frac{5,200,000}{1,420 \times 30} \approx 122\ \text{tx/second}
Performance should improve further with the planned Tezos upgrade to adopt the Tenderbake consensus algorithm ², and the Hangzhou amendment.
[1]: With the minimal contract implementing the FA2 standard.