Klaytn Usability Improvement Series #3: Fee Delegation

Tech at Klaytn
Klaytn
Published in
3 min readApr 12, 2021

See the list of articles here.
🇰🇷: Klaytn 사용성 개선 #3: 대납 기능

Improving the usability of our blockchain platform has been one of Klaytn’s top priorities. In this series of posts, we will take a look at some of the improvements that have been implemented to this end.

  1. Separating Keyes and Addresses
  2. Introducing Multisig on the Platform-Level
  3. Fee Delegation
  4. Supporting Role-Based Keys on the Platform-Level
  5. Implementing Explicit Types for Accounts and Transactions

In the last post we talked about implementing multisig on a platform level. In this post, we will be introducing fee delegation.

As you may well know, most blockchain platforms have transaction fees. For every transaction, the sender pays for the cost incurred for its execution. Transactions create computational and storage costs on the part of the blockchain network, so having users assume some of the burden doesn’t seem to be too unreasonable. But from the users’ perspective, having to pay for every single action is far from an ideal user experience.

If we think about it, it’s mostly the service providers that willingly foot the bill in order to attract more users. For example, if we had to pay everytime we sent a Tweet or shared a story on Facebook, nobody would be as enthusiastic as they are now to use these services. So, if this is something that evidently goes against common user experience, why should it be the norm for blockchain?

Klaytn found this to be a severe inconvenience from the users’ perspective. And as a solution, we offer the so-called “fee delegation”, which basically means that the service providers will be paying for the transaction fees on behalf of the users.

Implementing Fee Delegation is very simple. After a transaction is created, the sender signs it, after which the service provider (FeePayer) signs it. Let’s say that the transaction is a KLAY transfer, a certain amount of KLAY would be sent from the sender to the receiver, and the transaction fee of this transaction will be covered by the service provider. Let’s look at the data structure of this transaction in more detail:

Fee payer address and fee payer signature fields have been added to the existing transaction data structure. It is on the basis of these fields that the fee payer will be charged. And of course, if the fee payer signature doesn’t correspond with the signature of the fee payer address, the transaction will be considered invalid.

Fee Delegation exists for all types of Klaytn transactions. For more details on all transactions with fee delegation, please refer to KlaytnDocs/Transactions.

In addition, it is also possible to delegate just a certain portion of the fees. For example, the service provider could choose to pay 70% of the transaction fee while letting the sender pay the rest.

Fee Delegation allows the service providers to devise various strategies to attract and retain users. You can think of different billing plans, such as assuming the entire transaction fee, or paying partially, during a certain period or up to a certain number of transactions. This can be very helpful in acquiring new users.

We expect that Fee Delegation will promote the development of various blockchain services without compromising user experience.

In this post we introduced Fee Delegation. In the next post, we will take a look at role-based keys, which allows you to use separate keys for the different functions of an account. Thank you for reading, and stay tuned!

--

--