[ZIP-18] Simple TX Spamming Protection

Summary:

The proposal solves TX spamming at the Zilliqa blockchain by increasing the fees of simple transactions. Additionally, this proposal effects the circular token-economic model of Zilliqa by potentially increasing the amount of ZILs burned.

Abstract:

The proposal has the following main effects:

  • Smart-contract execution costs in ZIL remain as is if this proposal gets implemented
  • Normal TX cost will be increased from 0.002 ZIL to 0.1 ZIL if this proposal gets implemented

Considering the number of TX/s executed on the Zilliqa blockchain remains at the same level, more ZILs will be burned which will be beneficial for the circular token-econmic model of Zilliqa by decreasing the inflation rate.

Hint: A ZRC-2 token transfer is a Smart-Contract execution.

Motivation:

On Feb 4, 2021 on the Zilliqa Blockchain 1,000,000 TX got executed for only 2000 ZILs of fees [1]. Preventing the blockchain being spammed without touching crucial blockchain attributes like permissionless or trustless, fees for normal ZIL transactions need to be adjusted.
A comparision of ZRC-2 token transfers and ZIL transfers shows the inequalitity of TXs:

  • A ZRC-2 token transfer is usually about 1 ZIL in fees.
  • A basic ZIL TX costs 0.002 ZILs.

In order to prevent spamming the blockchain with millions of useless transactions, the proposal suggests to increase the fees for normal TXs to 0.1 ZIL. The gap in fees between ZRC-2 token TXs and ZIL TXs is just not comprehensible.

Specification:

The increase of simple TX fees can be done without effecting the fees associated with smart contract execution by changing the gas unit consumption of normal transactions from 1 to 50:

  • Constant value of NORMAL_TRAN_GAS from 1 to 50

Furthermore, the currently extremely low TX fees make little sense with respect to the token-economic model of Zilliqa [2], as it requires burning fees in order to get ZIL inflation rate at meaningful levels (let’s say < 10%).

  • DS Block reward = 275,000 ZIL [3]
  • Circulating Supply = 14.2e9 ZIL [4]

Assuming 1 TX block is about 45 seconds and 100 TX Blocks per DS Block:

  • Reward per second = 275,000 ZIL / (45s*100) = ~61.1 ZIL/s
  • Base inflation rate = 61.1 ZIL/s x (365 x 24 x 3600) / 14.2e9 = ~13.57%

According to the circular economic model Zilliqans are obliged to spend those minted ZILs by paying fees to the network. Assuming the zero inflation state and the current network configuration this relates to one of:

A) ~61 ZRC-2 token transfers per second (assuming 1 ZIL per TX)
B) ~30,550 TX per second (assuming 0.002 ZIL per TX)
C) ~15 ZilSwap swaps per second (assuming 4 ZIL per swap)

If the proposal gets implemented only B) will change so that ~611 TX per second are required for reaching the zero inflation state of Zilliqa’s token-economic model:

A) ~61 ZRC-2 token transfers per second (assuming 1 ZIL per TX)
B) ~611 TX per second (assuming 0.1 ZIL per TX)
C) ~15 ZilSwap swaps per second (assuming 4 ZIL per swap)

Assuming a TX block time of 45 seconds, then, 611 TX per second relate to 27,495 TX per block. Maximum number of TX per block ever recorded on mainnet was slightly above 10,000 TX per block. Maximum block capacity when filled only with normal transactions would be 50,000 TX, which relates to ~1,111 TX per second.

With maturing of the network and increased adoption only gas price needs to be lowered allowing higher TPS in the network.

It has to be noted that the implemenation of the proposal requires a mandatory network upgrade for all nodes, rather than a optional one.

[1] https://viewblock.io/zilliqa/stat/txCountHistory

[2] https://drive.google.com/file/d/1Y8JhkV1NfasfXdmWS-km2CBlaNaUKLO2/view (DS Block has been mixed up with TX Block several times in this document)

[3] Block 1004899 | Zilliqa Explorer | ViewBlock

[4] Top Holders | Zilliqa Explorer | ViewBlock

For:

  1. Higher transaction fees will make spamming very costly, e.g. issuing 1,000,000 TX would cost 100,000 ZIL.
  2. Higher transaction fees could decrease inflation rate of ZIL.
  3. The network is still in its early days, it needs to be protected from useless overload.
  4. The ratio of ZRC-2 token TX to Normal TX gets more reasonable.
  5. The fee of 0.1 ZIL is still low and can be lowered with maturing of the network in the future.

Against:

  1. The transaction fee for a simple TX increases from 0.002 ZIL to 0.1 ZIL
  2. Due to higher fees the number of transactions per day executed on the Zilliqa blockchain could decrease.
  3. Centralized exchanges’ withdrawal fees increase from 0.002 ZIL to 0.1 ZIL as well as for exchanges’ internal transactions, e.g. to and from their cold wallet.
  4. Risk of failed (rejected) transactions during roll-out of the change.
  5. Requires a mandatory network upgrade for all nodes.

Poll:

For or Against
  • For
  • Against
0 voters
9 Likes

So what you are saying is that we would be burning more Zils to prevent the spamming?

Thank you

Angel F
Zilliqa_Angel

I could have saved a lot of time by describing the problem as you did! :wink:

But: This proposal effects ONLY simple ZIL TXs. Smart contract fees remain as is.

What will it be increased to? I saw we burned 2000 Zils based on that large TX. Also if it doesn’t affect smart contract will it affect anything else? In terms of sending Zils on the network of swapping Zils?

I like to go straight to the point

Angel F

Simple TX: Sending an amount X of ZIL tokens from address A to address B.

Smart-Contract: Everything else happing is basically a smart-contract execution. Every ZRC-2 token is a smart-contract. If you transfer ZRC-2 token that is a smart contract interaction.

  • Smart-contract costs remain as is with this proposal.

  • Simple TX cost will be increased from 0.002 ZIL to 0.1 ZIL

If we had of burned 2000zils based on that last transaction you are highlighting at the rate of 0.1

How many Zils would that same TX would have burned calculating the new current rate

It would have been 50 times more.

2000 ZIL x 50 = 100,000 ZIL

That doesn’t increase the Gas fees correct?

For calculating the fees in smart-contracts there is a unit of account, namely gas.

The amount of gas used will be multiplied with the gas price.

I’ve proposed to reduce the gas consumed by a factor of 50 while at the same time increasing the gas price by a factor of 50. Thus, gas fees stay the same.

The only problem might be, that the calculation of gas is currently not a floating point implementation and therefore it can get difficult to just divide everything by 50. But this question needs to be answered by a proper Scilla engineer. :slight_smile:

Okay I would like to hear how it would affect the overral project and projects. As burning more Zils would mean that the supply would decrease short term gain how would it affect the gas price? Long term

LONG TERM VS SHORT TERM

I would like to hear what others have to say

Definitely!

But, even with the new model, we would be far from decreasing supply!

You’d need 611 TX / s to reach zero inflation.

Currently, on a normal day: 35,000 TX/day = 0.4 TX/s

Hi,

I’m curious to know what constitutes a transaction on the ZIL blockchain? Any examples I can refer to? Also is it correct to say that ZilSwap/Staking/ZilFlip dapps uses purely smart contract executions and no TXs? (Please correct me if I’m wrong)

I’m so curious to know how you stress tested the network @yusa, and with that regard how could one potentially abuse the TXs on the network. Pls enlighten!

Would increasing the TX cost affect and increase the cost for the enterprise bois like HG exchange, or are they mainly using smart contracts as well? (Main concern which comes from the lack of knowledge on this matter)

But I do agree that increase the TX fee burning would be in line with the design of ZIL’s tokenomics to create a circular economy.

From what I read, this proposal would ideally achieve-
Less Abuse, More Zil Burnt → Reduced circulation-> Zil Price Numba Go Up

With a mitigating factor of potential congestion due to increasing adoption-
Voting again to reduce the TX fees to prevent ridiculously high ETH-gas like scenario

Thank you! Appreciate anyone who can clarify this!

Low gas fee is the strong point of Zilliqa blockchain. Just wonder without using smart contract, what is benefit of spamming?

Hi @yusa

  1. Reduce Scilla operations gas consumption by a factor of 50
  2. Increase minimum gas price by a factor of 50 to 0.1 ZIL
  3. Reduce gas limit of TX blocks by a factor of 50

The above 3 changes can be simplified into

  • changing the gas unit consumption of a payment transaction from 1 to 50.

To be more precise, to change the constant value of NORMAL_TRAN_GAS from 1 to 50.

As such,

  • Gas price can remain the same at 0.002 ZIL
  • No smart contract gas factor reduction

With this change, there is no need to tweak around the smart contracts and block limits.

Exchanges do not need to change their existing infrastructure if they hard code 0.002 as the gas price. The same applies to wallets. This will reduce the impact on wallets, mining pools, and exchanges

Further, I have a few points that I wish to contribute to this proposal.

  1. I think as part of the proposal, we should also add a point that this change may impact exchanges and exchanges will need to be aware of the increased cost of the transactions, and they may have failed transactions when crawling back all user deposits into their cold storage wallet.

  2. This change should be released as part of a mandatory upgrade to the network instead of an optional one

4 Likes

Under ‘Motivation’, can you elaborate on what the consequences of the blockchain tx spamming were on 4th Feb?

Hi @brotato

Let me try to answer some of your questions:

I agree, lets face it:

  • Zilliqa: With increased adoption fees can be lowered
  • Ethereum: With increased adoption fees will explode
2 Likes

@sengtha

Spamming is some kind of a adversarial attack on the Zilliqa blockchain, comparable to DDoS attacks, which needs to be prevented on protocol level, imho.

1 Like

Hi @junhaotan !

Thank you very much for the clarification on the implementation side! I will update the proposal accordingly for the sake of simplicity.

That is correct. Exchanges most likely deal most with normal transactions. Hopefully, they got some gZIL :wink:

  1. I will add increased cost at centralized exchanges to the “Against” section. I don’t get the part with the failed transactions. Could you elaborate more on this?

  2. Okay, the change could be integrated whenever the next mandatory upgrade happens anyway. I will add this to the specification.

hi @yusa,

I think it should be not the next mandatory but rather let the core team decide on a suitable and timely time to push it into the mainnet.

The reason is as follows:

  • There are a lot of behind the scene logistics eg. Informing and coordinating exchanges and wallets
  • Updating various SDKs to ensure support
  • The next mandatory may or may not be able to accommodate it, as it depends on scheduling
  • Testing and more testing on testnet and a large scale testnet

Also, I also realize transaction gas limit for payment transactions will need to be increased to 50. in order for payment transactions to be accepted by the network. This change does not affect protocol level but SDKs, wallet, and exchange infrastructure will need to handle this. I think this point should also be added it too.

2 Likes

Also, the reference for $ZIL_ Our focus ahead.pdf - Google Drive should be change to ZIP-9 ZIP/zip-9.md at master ¡ Zilliqa/ZIP ¡ GitHub since this is the offical ZIP-9 for the past tokenomics change