5

I'm interested in systems where transaction fees can be paid for from a fund so that the end users don't have to deal with the chain's native token.

This is what I've found so far: https://github.com/shawntabrizi/substrate-feeless-token-factory Looks super helpful, but I still want to double check if there's anything more.

Is there more writing on the topic? In particular, does any chain use something like that successfully?

1 Answer 1

6

There are a ton of approaches to this, but you usually need to apply some kind of logic ensure the transactions can't get spammed or used as a DDOS attack vector - this applies whether the fees are being paid from a fund or are totally non existent.

  • Iota and Nano are feeless chains that make use of PoW or PoS attached to transactions to reduce spamming.
  • on Ethereum and other smart contract capable chains, it's possible to delegate transaction fees. Here is one example approach: https://medium.com/bitclave/do-not-pay-transaction-fees-in-ethereum-21a9dccaaf63
  • Kadena has the concept of gas stations that use a fund to cover fees for transactions that match a specific set of criteria.

This article describles several approaches various blockchains have used: https://www.bitrates.com/news/p/feeless-cryptocurrency-how-do-blockchains-achieve-free-transactions

There are a lot of other examples too.


As far as implementing something like this in substrate, you might be interested in this seminar: https://www.youtube.com/watch?v=7GOd2g4JZqg

Alternatively, another approach could be to supply your own CurrencyAdapter to OnChargeTransaction of the pallet_transaction_payment.

impl pallet_transaction_payment::Config for Runtime {
    type OnChargeTransaction = CurrencyAdapter<Balances, ()>;
...

CurrencyAdapter implements the OnChargeTransaction trait which has a correct_and_deposit_fee() function which is called at the end of every transaction to refund any excess fee the user may have paid. You could modify that to run some arbitrary logic to fully refund the transaction fees when your desired conditions are satisfied.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.