icon-project/IIPs

ICON BTP Fee Gathering

Opened this issue · 2 comments

iip: <to be assigned>
title: ICON BTP - FeeGathering
author: heonseung lee (@leeheonseung)
discussions-to: https://github.com/icon-project/IIPs/issues/tbd
status: Draft
type: Standards Track
category IRC
created: 2020-05-10
requires IIP-25

Simple Summary

It standardizes the structure in which fees can be charge from BTP network users to cover maintaining costs and activation incentives the IIP-25 (BTP) network.

Abstract

IIP-25(BTP) Network fee is charged to users and standardize about operation policy.
Defines the operating entity that gather a fee.
Defines Fee Aggregator (FA).
Defines interfaces related to FeeGathering BMC Message.

Motivation

In order to cover maintaining costs and activation incentives the IIP-25 (BTP) network,
a structure is needed to charge fees from users who send BTP Message.

The chain to which the entity operating the BTP Network belongs is defined as HUB.
The Smart Contract, which operates with fees from the BTP service, is defined as Fee Aggregator (FA).

The BTP network user pays a fee to the BSH that provides the BTP service of the chain to which he belongs.
The operating entity uses HUB's Fee Aggregator (FA) to collect the fees stored in each chain BSH and operates the BTP Network.
Through HUB's BMC.sendFeeGatheringMessage, you can request a BTP message that sends a fee to each chain's BMC to FA.

Specification

Terminology

  • HUB
    The chain to which the entity operating the BTP Network belongs.
  • Fee Aggregator(FA)
    Smart contract to to raise the necessary financial resources for BTP network operation by gathering fees collected from other chains connected.
  • FeeGathering BMC Message & HandleFeeGatheringMessage
    Interface that processes the logic that transfers the fees stored in the BSH to the Fee Aggregator (FA).

BTP Message Center - Extension

Ref. BTP Message Center

HUB's BTP Message Center sends FeeGathering BMC Message to each link when certain conditions are satisfied, and calls handleFeeGathing from the service managed each BMC of that chains.

Message Struct

GatherFee Message

send to all of connected BMC on BMC.sendFeeGatheringMessage on HUB

Name Type Description
_fa String BTP Address of Fee Aggregator
_svcs List of String list of name of service

When BMC receive this message, find the BSH using 'svcs' and then calls BSH.handleFeeGathering with '_fa'

BTP Service Handler - Extension

Ref. BTP Service Handler

Interface that processes the logic that transfers the fees stored in the BSH to the Fee Aggregator (FA).

Interface

Writable methods
handleFeeGathering
@external
def handleFeeGathering(self, _fa: str):
  • Description
    • Handle the FeeGathering Message.
    • Accept the error only from the BMC.
  • Params
    • _fa: String ( BTP Address of Fee Aggregator )

Rationale

Implementation

Copyright

Copyright and related rights waived via CC0.

Do we have a fee aggregator API?

Will such contract (Fee Aggregator) be the only one (on the icon side?), for different chains?