Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICON BTP Fee Gathering #35

Open
cow-hs opened this issue May 11, 2021 · 2 comments
Open

ICON BTP Fee Gathering #35

cow-hs opened this issue May 11, 2021 · 2 comments
Labels

Comments

@cow-hs
Copy link
Contributor

cow-hs commented May 11, 2021

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.

@cow-hs cow-hs added the IRC label May 11, 2021
@cow-hs cow-hs self-assigned this May 11, 2021
@cow-hs cow-hs changed the title IIP Draft - ICON BTP FeeGathering ICON BTP - FeeGathering May 11, 2021
@cow-hs cow-hs removed their assignment May 11, 2021
@sink772 sink772 changed the title ICON BTP - FeeGathering ICON BTP Fee Gathering May 13, 2021
@andrii-kl
Copy link

Do we have a fee aggregator API?

@andrii-kl
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@andrii-kl @cow-hs and others