Gas Fee Delegation

Kaia Fee Delegation Program for Kaia Wave Builders

1. Introduction

The fee delegation of kaia network is a feature that allows another account to pay for the transaction gas fee. This allows users to perform transactions without spending their own $KAIA for the gas fee of a transaction.

Apply Form >

2. Concept

1. kaia fee delegation consist of three mian compenents:

  1. Sender: The account submitting the transaction (from)

  2. Dapp: The relayer that relay the user signed transaction to the fee payer server

  3. Fee payer server: Sign as fee payer and send the signed transaction to the network and return the receipt to the caller

2. The operations of kaia fee delegation is as follows:

  1. The sender creates the transaction.

  2. The sender specifies the fee payer's address in the transaction.

  3. The sender signs the transaction.

  4. The sender sends the signed transaction to backend of dapp.

  5. The backend requests a transaction sign to the fee payer server.

  6. The fee payer server signs the transaction as a fee payer, sends it to the network, gets a receipt of the transaction and returns the transaction receipt.

3. Code Samples

1. Prequisite

  1. SDK

    1. ethers-ext that is one of kaia-sdk should be installed.

    2. ethers-ext getting-started

  2. Wallet

    1. fee-delegation is only supported by

      1. kaia-wallet mobile/extension, dapp-portal-wallet liff/web

    2. dapp frontend should get a user signed transaction via the wallets

2. code snippet in web application

frontend (React) - getting a user signed transaction

fee-delegated value transfer example

fee-delegated smart contract execution example

backend - request 'sign' to feePayer server

  1. input : userSignedTx - RLP encoded transaction

  2. return : transaction receipt

  3. feePayer server URL

    1. https://fee-delegation.kaia.io (mainnet)

      1. Contract or sender should be registered

  1. balance check

Last updated