# \[ZIP-18\] Simple TX Spamming Protection

**URL:** <https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364>\
**Category:** Protocol\
**Created:** [February 5, 2021, 5:06pm UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364 "2021-02-05T17:06:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![yusa](https://yyz1.discourse-cdn.com/flex027/user_avatar/gov.zilliqa.com/yusa/32/88_2.png) [@yusa](https://gov.zilliqa.com/u/yusa)\
**Post date:** [February 5, 2021, 5:06pm UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/1 "2021-02-05T17:06:41Z")

</div>

**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](https://viewblock.io/zilliqa/stat/txCountHistory)
> 
> [2] [https://drive.google.com/file/d/1Y8JhkV1NfasfXdmWS-km2CBlaNaUKLO2/view](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](https://viewblock.io/zilliqa/block/1004899)
> 
> [4] [Top Holders | Zilliqa Explorer | ViewBlock](https://viewblock.io/zilliqa/stat/topHolders)

**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** :

_Poll ([view on site](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/1))_

---

<div class="post-metadata">

**Author:** ![Angel\_F](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@Angel\_F](https://gov.zilliqa.com/u/Angel_F)\
**Post date:** [February 5, 2021, 6:01pm UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/2 "2021-02-05T18:01:15Z")

</div>

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

Thank you

Angel F  
Zilliqa\_Angel

---

<div class="post-metadata">

**Author:** ![yusa](https://yyz1.discourse-cdn.com/flex027/user_avatar/gov.zilliqa.com/yusa/32/88_2.png) [@yusa](https://gov.zilliqa.com/u/yusa)\
**Post date:** [February 5, 2021, 6:08pm UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/3 "2021-02-05T18:08:58Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![Angel\_F](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@Angel\_F](https://gov.zilliqa.com/u/Angel_F)\
**Post date:** [February 5, 2021, 6:11pm UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/4 "2021-02-05T18:11:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![yusa](https://yyz1.discourse-cdn.com/flex027/user_avatar/gov.zilliqa.com/yusa/32/88_2.png) [@yusa](https://gov.zilliqa.com/u/yusa)\
**Post date:** [February 5, 2021, 6:15pm UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/5 "2021-02-05T18:15:55Z")

</div>

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**

---

<div class="post-metadata">

**Author:** ![Angel\_F](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@Angel\_F](https://gov.zilliqa.com/u/Angel_F)\
**Post date:** [February 5, 2021, 6:17pm UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/6 "2021-02-05T18:17:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![yusa](https://yyz1.discourse-cdn.com/flex027/user_avatar/gov.zilliqa.com/yusa/32/88_2.png) [@yusa](https://gov.zilliqa.com/u/yusa)\
**Post date:** [February 5, 2021, 6:18pm UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/7 "2021-02-05T18:18:36Z")

</div>

It would have been 50 times more.

2000 ZIL x 50 = 100,000 ZIL

---

<div class="post-metadata">

**Author:** ![Angel\_F](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@Angel\_F](https://gov.zilliqa.com/u/Angel_F)\
**Post date:** [February 5, 2021, 6:21pm UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/8 "2021-02-05T18:21:06Z")

</div>

That doesn’t increase the Gas fees correct?

---

<div class="post-metadata">

**Author:** ![yusa](https://yyz1.discourse-cdn.com/flex027/user_avatar/gov.zilliqa.com/yusa/32/88_2.png) [@yusa](https://gov.zilliqa.com/u/yusa)\
**Post date:** [February 5, 2021, 6:29pm UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/9 "2021-02-05T18:29:33Z")

</div>

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. 🙂

---

<div class="post-metadata">

**Author:** ![Angel\_F](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@Angel\_F](https://gov.zilliqa.com/u/Angel_F)\
**Post date:** [February 5, 2021, 6:42pm UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/10 "2021-02-05T18:42:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![yusa](https://yyz1.discourse-cdn.com/flex027/user_avatar/gov.zilliqa.com/yusa/32/88_2.png) [@yusa](https://gov.zilliqa.com/u/yusa)\
**Post date:** [February 5, 2021, 7:12pm UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/11 "2021-02-05T19:12:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![brotato](https://avatars.discourse-cdn.com/v4/letter/b/e480ec/32.png) [@brotato](https://gov.zilliqa.com/u/brotato)\
**Post date:** [February 6, 2021, 4:52am UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/12 "2021-02-06T04:52:32Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![sengtha](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sengtha](https://gov.zilliqa.com/u/sengtha)\
**Post date:** [February 6, 2021, 8:12am UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/13 "2021-02-06T08:12:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![junhaotan](https://yyz1.discourse-cdn.com/flex027/user_avatar/gov.zilliqa.com/junhaotan/32/27_2.png) [@junhaotan](https://gov.zilliqa.com/u/junhaotan)\
**Post date:** [February 6, 2021, 10:57am UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/14 "2021-02-06T10:57:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![will\_speaks](https://avatars.discourse-cdn.com/v4/letter/w/7feea3/32.png) [@will\_speaks](https://gov.zilliqa.com/u/will_speaks)\
**Post date:** [February 6, 2021, 11:16am UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/15 "2021-02-06T11:16:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![yusa](https://yyz1.discourse-cdn.com/flex027/user_avatar/gov.zilliqa.com/yusa/32/88_2.png) [@yusa](https://gov.zilliqa.com/u/yusa)\
**Post date:** [February 6, 2021, 11:38am UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/16 "2021-02-06T11:38:43Z")

</div>

Hi @brotato

Let me try to answer some of your questions:

- A “simple” or “normal” transaction on Zilliqa blockchain is sending ZIL from address A to B, e.g. [Zilliqa Transaction 0xb9e4010e7052c389843e9338a59192698adcf559f403b364922d7ecee6b0ba70 | ViewBlock](https://viewblock.io/zilliqa/tx/0xb9e4010e7052c389843e9338a59192698adcf559f403b364922d7ecee6b0ba70)

- ZilSwap/Staking/ZilFlip is purely smart-contract transactions

- In my understanding HGX is dealing mainly with some kind of NFTs, thus, smart-contract.

I agree, lets face it:

- Zilliqa: With increased adoption fees can be lowered
- Ethereum: With increased adoption fees will explode

---

<div class="post-metadata">

**Author:** ![yusa](https://yyz1.discourse-cdn.com/flex027/user_avatar/gov.zilliqa.com/yusa/32/88_2.png) [@yusa](https://gov.zilliqa.com/u/yusa)\
**Post date:** [February 6, 2021, 11:40am UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/17 "2021-02-06T11:40:35Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![yusa](https://yyz1.discourse-cdn.com/flex027/user_avatar/gov.zilliqa.com/yusa/32/88_2.png) [@yusa](https://gov.zilliqa.com/u/yusa)\
**Post date:** [February 6, 2021, 11:54am UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/18 "2021-02-06T11:54:59Z")

</div>

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 😉

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.

---

<div class="post-metadata">

**Author:** ![junhaotan](https://yyz1.discourse-cdn.com/flex027/user_avatar/gov.zilliqa.com/junhaotan/32/27_2.png) [@junhaotan](https://gov.zilliqa.com/u/junhaotan)\
**Post date:** [February 6, 2021, 5:04pm UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/19 "2021-02-06T17:04:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![junhaotan](https://yyz1.discourse-cdn.com/flex027/user_avatar/gov.zilliqa.com/junhaotan/32/27_2.png) [@junhaotan](https://gov.zilliqa.com/u/junhaotan)\
**Post date:** [February 6, 2021, 5:06pm UTC](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364/20 "2021-02-06T17:06:38Z")

</div>

Also, the reference for [$ZIL\_ Our focus ahead.pdf - Google Drive](https://drive.google.com/file/d/1Y8JhkV1NfasfXdmWS-km2CBlaNaUKLO2/view) should be change to ZIP-9 [ZIP/zip-9.md at master · Zilliqa/ZIP · GitHub](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-9.md) since this is the offical ZIP-9 for the past tokenomics change

[Next page](https://gov.zilliqa.com/t/zip-18-simple-tx-spamming-protection/364.md?page=2)
