Safex: The Dynamic Block Size
This article explains the Dynamic Block Sizing, Transaction Fees, and Ring Size (Mixin).
In some of the previous articles we described what blockchain and blocks are: Blocks are packages of information linked to other blocks using cryptographic connections. The original blockchain was Bitcoin blockchain. Its block can not increase in size to accommodate an increase in transaction volume on the chain. That kind of cryptocurrency is called ''static block size cryptocurrency''.
For high use static blockchains, this leads to a situation where the number of transactions awaiting processing in the transaction pool grows at a pace faster than the blockchain can process them. The transaction fee costs often spiral out of control, as people start intentionally paying more in fees to expedite the processing of their transactions (as miners select the transactions with the highest fees for best profitability). At times of intense blockchain activity, this causes a roll-on effect.
In early 2021, this phenomenon led to gas fees for Ethereum exceeding $100 per transaction and BTC transaction fees regularly being $20 to $30. For High Net Worth individuals moving large amounts per transaction, this fee can be tolerated as an insignificant percentage of the overall transaction. However, for those people looking to move smaller amounts, the transaction fee becomes an obscene percentage of the overall transaction.
Dynamic block sizing and dynamic fees, as used by Safex Blockchain, resolves this issue. As the number of transactions increases, the blockchain is algorithmically programmed to adjust the block size and transaction fee. All coins based on the CryptoNote algorithm (e.g., Monero) have this dynamic capacity.
In static block size cryptocurrencies, like Bitcoin, the block cannot increase in size to accommodate an increase in transaction volume on the chain.
Transaction fees are also dynamic and adjust automatically, based on the following formula:
fee = (R/R0) * (M0/M) * F0
Where...
- R: current base block reward
- R0: reference base reward
- M: current median block size limit
- M0: minimum block size limit
- F0: 0.01 Cash (Nominal fee is presently 0.01 SFX)
For those who want a profound explanation of these dynamic adjustments, much has been written about this mechanism for Monero.
The base fee is then used to calculate the actual transaction fee, depending on the amount of data being sent in the transaction.
Another factor that affects Transaction Fees is the nominated ring size, also referred to as mixins, which adds additional signatures to the transaction for obfuscation purposes. This is the purpose of the Ring Signature system.
Safex Wallets have a default ring size of 7, which means 7 additional transaction signatures are mixed into the transaction. Any third party looking at the transaction has no way of telling which of the 8 signatures relates to the actual transaction being made.
These additional signatures add additional data to the transaction size, which results in a more expensive transaction fee. When preparing to send a transaction in the wallet, users can select different mixin values according to their personal preference. The cli wallet allows the user to enter any value; however, GUI wallets provide a dropdown selection from 1 to 7.
The last factor affecting transaction fees is the Priority setting. Not currently implemented in the GUI wallet but available via the cli wallet, the Priority option allows the user to pay a higher transaction fee to get their transaction processed more quickly. This would only be a factor when there are more transactions in the pool than those that can be processed in a single block. A deeper explanation of Transaction Priorities can be found here.
Dynamic Blocksize Penalty
There are additional changes that take place when the median block size increases.
Increases to the median block size results in a Dynamic Block Size Penalty, which does several things:
- It reduces the block reward paid to the miner
- It has the practical effect of delaying the tail emission (and consequently delays the annual block reward adjustment), per the emission curve, by a small amount.
These penalties are applied automatically by the blockchain code, based on a preset algorithm.
Calculating the Penalty.
(As Safex was originally forked from Monero, this calculation explanation has been adapted from the article mechanism for Monero.)
The formula can be written as:
P = R * (W - 1) ^ 2,
where:
- P is the dynamic blocksize penalty (Safex),
- R the block emission (Safex), and
- W the blocksize expansion factor.
The expansion factor calculation is:
W = B / M
where:
- B is the blocksize (kB) of the examined block, and
- M the blocksize median of the previous 100 blocks (kB).
For example, an expansion factor of 1.20 means a 20% increase, so with the safex median blocksize of 58.59kB (also m0 [minimum value] for Safex), the expanded block would be 70.3kB.
At its most basic form, it could be written as:
p = (W - 1) ^ 2
where p = P / R, and can be called relative blocksize penalty.
For example, a blocksize increase of 10% above the median would mean a 1% (= 10 ^ 2 / 100%) penalty, whereas an increase of 30% would mean a 9% (= 30 ^ 2 / 100%) penalty. This makes no difference what the actual values of the current median blocksize and block emissions are.
At the current (October 2022) block reward of 340 SFX, a 1% penalty would equal 3.4 SFX. Bear in mind, that for the median blocksize to increase, there are increased numbers of transactions being sent to the blockchain to trigger the increase. Therefore, miners get the penalized block reward of 336.6 SFX, plus all the transaction fees processed on the block, and would likely still earn more the pre-penalized 340 SFX standard block reward.
As mentioned above, over the course of the blockchain’s existence, every block processed with a reward penalty causes the emission curve tail emission to be delayed, and on a shorter time frame, it means the next annual block reward change is correspondingly delayed.
If 100 blocks were processed with a 3.4 SFX penalty in the current year, it would equate to an entire block (340 SFX) of delay to next year's emission curve change, and the eventual tail emission.
For those who want a deeper explanation of these dynamic adjustments, much has been written about why the penalty exists.
Read similar blog posts.