Grin transaction fees

This infographic seems to say that transaction fees are 4 milligrin per output with a discount of 1 milligrin per input, but at a minimum 1 milligrin of fee.

Is possible to pay less fee?
Is it possible to pay more fee?

If it is not possible to pay more fee, what happens when blocks become full, and what about miners mining empty blocks if they deem fees to be negligble?

2 Likes

It’s not configurable now but I guess it’s going to be once the block size starts being an issue.

Which could be years from now, or even perhaps never.

Are you saying that there will need to be a hardfork, or are you just saying that the current wallet doesn’t support it?

It’s just the wallet that does not support it.

So, the question stands regarding minimum fee. Does it exist, or is tx_weight/1000 just how it’s implemented in the wallet?

1 Like

这个币到底有没有交易费,如果有,请问是多少?

I have a noob question: I see BTC fee now nearly cost $40, I just imagine, what a maximum fee for standard transaction if the network is busy? or people can bid the priority to any value they want?

Yeah… thx to Ordinals :clown_face:

Miners have to be successful as Saylor said:
https://twitter.com/to/status/1660268453188739072

For Grin there is a formula:

(num_inputs + num_outputs * 21 + num_kernels * 3) * fee_base

where is fee_base is 0.0005

accept_fee_base and max_pool_size are also options on node to handle “mempool”:

Will be interesting to test how it will work on Grin network load with high payments amount for sure, I guess pools can tweak these values for better bandwidth.

Also it’s good we have no such thing as ordinals and other bloatware to spam the chain :slight_smile:

3 Likes

This future became closer than we thought.

2 Likes

Hello, on Grin++ the tx fee is automatically set at 0.0125 Grin. Is it posible to set a lower tx fee ? :thinking:

1 Like

You cannot. The minimum fees are there to protect the chain and mempool from spam attacks. They are calculated giving weights to inputs, outputs and kernels based on how much memory these parts of the transaction will use on-chain. So basically you pay linearly for the blockchain space you use.

See this link for how fees are calculated:

Not sure how Grin++came to 0.00125, especially the 0.00005 part has me puzzled. Probably @tromp can explain it

1 Like

The current fee rules are described in grin-rfcs/text/0017-fix-fees.md at master · mimblewimble/grin-rfcs · GitHub

Standard fees are multiples of accept_fee_base which equals half a milligrin, so a fee of 0.00125 is not standard. I have no idea how grin++ computes fees, but apparently it’s not following the standard formula.

6 Likes

Hey Tromp
Is milligrin the equivalent to a btc satoshi?

I was wondering what its called

No; nanogrin is the smallest unit.

1 Like

We’re already in that situation. As of today, it’s far too cheap to spam Grin network by creating lots of unspent outputs. A standard Grin transaction (1 input, 2 outputs, 1 kernel) only costs about 0.023 GRIN or $0.0006. By comparison, a typical Bitcoin transaction runs around 140 sats, which is about $0.08 right now. In other words, spamming Grin is roughly 130-160 times cheaper than on Bitcoin.

its up to pools to modify accept_fee_base value, we can not do anything about it, increasing this value for node API will lead to reject txs from connected wallets as I tested.

@bruges I understand the logic, but based on you observations, is there any spamming going on?
Last time I checked it was mostly empty blocks. It does not mean we should not consider how to deal with spam when it happens, but for now it us a theoretical problem.

1 Like

If we ever decide to raise the fee, it will only happen as part of a full network upgrade covering pools, nodes and wallets. I’m not sure what you’ve tested, but that’s not how this kind of change should be rolled out.

1 Like

If someone decides to spam the network, it will already be too late. A single block can contain up to 40,000 / 21 outputs, which amounts to about 1.3 MB of data. Spamming a block like that would cost roughly (40,000 / 21) × 21 × 0.0005 = 20 GRIN, or around $0.50. That works out to $0.50 per 1.3 MB of spam. If someone spammed continuously for a full day (1,440 blocks), it would cost them $720 to add 1.8 GB of data to the chain. And those outputs can never be removed, they’ll stay in the blockchain forever, permanently slowing down node and wallet synchronization. You can try this yourself: set up a wallet on the testnet and experience how long it takes to sync. There are millions of unspent outputs on the testnet.

1 Like