Davinci Protocol
Block ExplorerValidator Explorer
  • Welcome
  • Learn
    • Execution Layer
    • Proof Of Stake Mechanism
    • Validator Mechanism
    • Staking Mechanism
  • Technical Network
    • Mainnet
    • Accounts
    • Transaction
    • Onchain Gas Transaction
  • Developer Hub
Powered by GitBook
On this page
  • Types of transactions
  • On gas
  • Block size
  • Base fee
  • EIP-1559
  1. Technical Network

Onchain Gas Transaction

PreviousTransactionNextDeveloper Hub

Last updated 3 months ago

Types of transactions

On DaVinci there are a few different types of transactions:

  • Regular transactions: a transaction from one account to another.

  • Contract deployment transactions: a transaction without a 'to' address, where the data field is used for the contract code.

  • Execution of a contract: a transaction that interacts with a deployed smart contract. In this case, 'to' address is the smart contract address.

On gas

As mentioned, transactions cost gas to execute. Simple transfer transactions require 21000 units of Gas.

So for Bob to send Alice 1 DCOIN at a baseFeePerGas of 190 gwei and maxPriorityFeePerGas of 10 gwei, Bob will need to pay the following fee:

(190 + 10) * 21000 = 4,200,000 gwei
--or--
0.0042 DCOIN
  • Bob's account will be debited -1.0042 DCOIN (1 DCOIN for Alice + 0.0042 DCOIN in gas fees)

  • Alice's account will be credited +1.0 DCOIN

  • The base fee will be burned -0.00399 DCOIN

  • Validator keeps the tip +0.000210 DCOIN

Block size

Each block has a target size of 15 million gas, but the size of blocks will increase or decrease in accordance with network demand, up until the block limit of 30 million gas (2x the target block size). The protocol achieves an equilibrium block size of 15 million on average through the process of tâtonnement. This means if the block size is greater than the target block size, the protocol will increase the base fee for the following block. Similarly, the protocol will decrease the base fee if the block size is less than the target block size. The amount by which the base fee is adjusted is proportional to how far the current block size is from the target. More on blocks.

Base fee

Every block has a base fee which acts as a reserve price. To be eligible for inclusion in a block the offered price per gas must at least equal the base fee. The base fee is calculated independently of the current block and is instead determined by the blocks before it - making transaction fees more predictable for users. When the block is created this base fee is "burned", removing it from circulation.

The base fee is calculated by a formula that compares the size of the previous block (the amount of gas used for all the transactions) with the target size. The base fee will increase by a maximum of 12.5% per block if the target block size is exceeded. This exponential growth makes it economically non-viable for block size to remain high indefinitely.

EIP-1559

Parameter
DaVinci Value
Ethereum Value

Block gas limit

30,000,000 gas

30,000,000 gas

Block gas target

5,000,000 gas

15,000,000 gas

EIP-1559 elasticity multiplier

6

2

EIP-1559 denominator

250

8

Maximum base fee increase (per block)

2%

12.5%

Maximum base fee decrease (per block)

0.4%

12.5%

Block time in seconds

2

12

The base fee on DaVinci is, like Ethereum, computed via the mechanism. The EIP-1559 parameters used by DaVinci differ from those used by Ethereum as follows.

EIP-1559
DaVinci Virtual Machine Ilustrated