Gas Fee Delegation

Kaia Fee Delegation Program for Kaia Wave Builders

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 >arrow-up-right

Concept

Kaia fee delegation consist of three main components:

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

  2. Unifi Apps: 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

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 Unifi Apps.

  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.

Code Samples

1. Pre-requisite

  1. SDK

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

  2. Wallet

    1. fee-delegation is only supported by

    2. Unifi Apps front-end 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.ioarrow-up-right (mainnet)

      1. Contract or sender should be registered

  1. balance check

Last updated