In this post I will talk about the (i) dynamic fee system, (ii) how to calculate dynamic-fees (spreadsheet and code sample provided) and (iii) what are the variables we introduced in Ark Improvement Proposal 16, that is already implemented and running on our brand new Mainnet with Core v2 engine.

ARK is all about making development of blockchain solutions easier by empowering developers with the tools and libraries they can use in almost any popular programming language. The immense efficiency of such an ecosystem, supported by the delegate community who runs the network, are also some of my personal reasons for sailing together with the Ark Ecosystem.

With Core v2 a new era begins — enabling developers to build new modular features and customizations with minimum effort.

Dynamic Fee System

ARK Core V2 is the first implementation of a dynamic fees system within a DPoS network model. We envisioned that creating a “fee marketplace” between users and delegates will move ARK even closer to creating a dynamic, responsive and resilient network. Both delegates and end-users stand to benefit from dynamic fees: end-users benefit from delegate competition in the form of lower transaction fees, while delegates gain another tool in their arsenal to contend with potential attack vectors such as spam attacks.

Dynamic fees is a protocol-level change. On the one hand, delegates (block producers) set their own minimum acceptable fee for each transaction type. Meanwhile, ARK users define how much they are prepared to pay for a transaction to get included in the block and blockchain.

The bigger the set fee from the user, the quicker the inclusion of the transaction in the block.

Node operators have an option to customize fees in the config file according to the network they are running their node for. The configuration consists of the following variables:

minFeePool — minimum fee pool entry multiplier.

minFeeBroadcast — minimum broadcast multiplier.

transaction offsets — are transaction type offsets/addon bytes that are used in dynamic fee formula calculation. Their main purpose is to adjust the fee calculation for a specific transaction type.

Dynamic fee calculation

The calculation formula: Fee = (T+S) * C

T: offset value depending on transaction type, defined by the network. T is here to account for extra processing power to process special transaction whose transfer value is null, and thus reducing economic interest to spam the network.

offset value depending on transaction type, defined by the network. T is here to account for extra processing power to process special transaction whose transfer value is null, and thus reducing economic interest to spam the network. C: fee multiplier constant (Arktoshi/byte) defined by the delegates for including the transaction in his forged block/transaction pool. The C constant is replaced with the settings value from your network.json file (mainnet.json), the minFeePool and minFeeBroadcast.

fee multiplier constant (Arktoshi/byte) defined by the delegates for including the transaction in his forged block/transaction pool. The C constant is replaced with the settings value from your network.json file (mainnet.json), the minFeePool and minFeeBroadcast. S: size of the serialised transaction. For instance, for transfer we have offset T = 100, C = 3000 Arktoshi/byte. For a classic transfer transaction with empty VendorField size is 153 bytes, the fee is:

Fee:= (100 + 153) * 3000 = 759000 ARKTOSHI === 0.00759 ARK

Dynamic Fee calculation simulator

For default values and fee calculations related to transaction type please see the calculated values in the table below.