Network Fee

A Message is a standard format of information on the Lino blockchain similar to a Bitcoin transaction. A Transaction can contain multiple Messages. In order to prevent spam and on-chain attack, Lino blockchain applies 2 types of network fees to different types of messages, Developer Signed Messages(DSM) and General Messages(GM).

Maximum Messages Per Second (\inline p={MPS_{max}}) is an on-chain parameter that describes the maximum number of messages can be processed per second. It's initially set in the Genesis File and automatically updated whenever the actual MPS surpasses \inline p={MPS_{max}}.

MPS Quotas are set for DSM and GM: \inline p={Q_{dsm}} and \inline p={Q_{gm}}. If the EMA of DSM(see below) surpasses \inline p={Q_{dsm}}, the cost of each DSM will be significantly higher. Similarly, if the EMA of GM(see below) surpasses \inline p={Q_{gm}}, the cost of each GM will be significantly higher.

Q_{dsm}=MPS_{max}*0.8

Q_{gm}=MPS_{max}*0.2

Developer Signed Messages(DSM)

It's counter-intuitive to charge a network fee for micro-donation or creating posts. Network fee also discourages users to donate or create content. In order to provide a user-friendly experience, we use the Dynamic Bandwidth Model for all the developer signed messages, i.e., messages signed by App Developer Account or Affiliated Account. In other words, all developer signed messages are free, costing no network fees.

Bandwidth

Each DSM sent by an App Developer Account (@app) will consume a certain amount of bandwidth (C_{dsm}^{app}).

All App Developer Accounts share the MPS Quota for DSM (\inline p={Q_{dsm}}). The MPS quota allocated to each App Developer Account (\inline p={Q_{dsm}^{app}}) is proportional to the App Developer Account's LS. For example, if @app has 1,000,000 LS while all App Developer Accounts have 2,000,000 LS in total, @app's allocated MPS Quota should be:

Q_{dsm}^{app} = Q_{dsm}*\frac{1,000,000}{2,000,000}=\frac{1}{2}Q_{dsm}

An App Developer Account's bandwidth (\inline p={B_{app}}) is replenished at the speed of its allocated MPS quota (\inline p={Q_{dsm}}) per second. \inline p={Q_{dsm}^{app}} has a hard limit that cannot exceed 50 times of \inline p={Q_{dsm}^{app}}. An App Developer Account cannot send any message if its \inline p={B_{app}} is less than 0.

Bandwidth Consumption

EMA of DSM (\inline p={EMA_{gm}}) is the exponential moving average number of DSM per second.

EMA_{gm} = EMA_{gm}*(1-k)+MPS_{gm}*k,\ k=\frac{1}{n}

When \inline p={EMA_{gm}} is low, each DSM should just consume a small amount of bandwidth. The Utilization Coefficient (\inline p={\mu}) is a parameter that describes how busy the blockchain is:

\mu=exp(\frac{EMA_{dsm}-Q_{dsm}}{Q_{dsm}} * 0.69)

Current MPS of DSM of an App (\inline p={MPS_{dsm}^{app}}) is the current number of DSM sent by @app per second. It can be simply calculated based on the number of DSM sent by @app in the current block and the block time. For example, if the current block contains 300 DSM sent by @app, the Current MPS of DSM of @app should be 100(based on a 3-second block time).

When \inline p={MPS_{dsm}^{app}} is high, each DSM should consume a larger amount of bandwidth. The App Utilization Coefficient (\inline p={U_{app}}) for each App Developer Account is a parameter that describes how much the allocated bandwidth is consumed by this App Developer Account:

U_{app}=exp(\frac{max(MPS_{dsm}^{app}-Q_{dsm}^{app},0)}{Q_{dsm}^{app}}*\frac{14}{5})

The bandwidth consumption of each DSM sent by @app (C_{dsm}^{app}) is simply the multiple of two coefficients:

C_{dsm}^{app}=\mu*U{app}

Example

\inline p={Q_{dsm}=66}

\inline p={\mu} \inline p={MPS_{dsm}^{app}/Q_{dsm}^{app}} C_{dsm}^{app}
0.5 125% 1
0.5 100% 0.5

General Messages(GM)

Any message that is not signed by an App Developer Account or Affiliated Account is a General Message. Lino blockchain charges a Message Fee for sending General Messages. Validators collect messages fees as compensation for validating and processing General Messages. The busier the Lino blockchain, the higher the message fee is.

Current MPS of GM (\inline p={MPS_{gm}}) is the current number of GM per second. It can be simply calculated based on the number of GM in the current block and the block time. For example, if the current block contains 30 GM, the Current MPS of GM should be 10(based on a 3-second block time).

EMA of GM (\inline p={EMA_{gm}}) is the exponential moving average number of GM per second.

EMA_{gm} = EMA_{gm}*(1-k)+MPS_{gm}*k,\ k=\frac{1}{n}

The message fee(\inline p={Fee_{gm}}) is calculated as below:

Fee_{gm} = exp(\frac{EMA_{gm}-Q_{gm}}{Q_{gm}}*6)*10

Example

\inline p={Q_{gm}=66}

\inline p={EMA_{gm}} \inline p={Fee_{gm}}
0 0.025 LINO
15 (23%) 0.1 LINO
33 (50%) 0.5 LINO
41 (62%) 1 LINO
66 (100%) 10 LINO
100 (150%) 200 LINO