neo-project / proposals

NEO Enhancement Proposals

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GAS Gateways

igormcoelho opened this issue · comments

Gas is the power that runs Neo network, which Neo itself is the governance token behind it.

In some situations, community members have expressed their desires of simplifying user operations, e.g., having to buy gas, just to transfer a bunch of Neo... this can happen with any NEP-5, or any asset transfer in fact.

This would require buying these Gas on an exchange, or DEX, but even if it's few cents, this would require several compliance measures, KYC, and in countries like mine (Brazil), user would need to present detailed reports for even few cents operations.

Therefore I believe that creating such an integrated feature would be very helpful to users.

Proposal can be something like this:

  • a method for getratio, which will give ratio of that token/asset (NFT, NEP-5, ...), into GAS.
  • a method for getgas, which will attach the precise amount of GAS to backup user tx fees.

Note that getgas shouldn't give profit for users, nor any excess, to avoid DEX discussions. This is good for any NEP-5 that implements this NEP-Z, and the only complicated one now is Neo: because it's not fractionary.

Since excess shouldn't come back to users, it would be complicated to spend a single Neo per tx... since Neo already generates Gas, this is more-or-less solved, but if it gets fractional, then it would be able to benefit more from this.

Implementation:

To implement getratio: contract could use embeded Neo oracles, to periodically update gas ratio (ratio could be higher than market, which is good for gas offers, and also for users that get an integrated service)

To implement getgas: execution could read from Sender field, or any other requirement of fees, and authorize transaction upfront (as long as ratio is matched).

To keep flow of gas, listed third-party addresses with funds could be provided on contract, and used to extract funds. A command like registergas could be provided, with some locking mechanism to keep it there for a while.

One interesting point is that this is not a compete approach to DEX, but complementary... it's very likely that DEX would also support some GAS gateways, to back-up their own user operations. As long as this NEP is very simple, we can easily integrate it to native mechanisms of Neo blockchain.

Thanks to @MorganDream @EdgeDLT @vncoelho and many others that kept discussing this important topic in the past months... let's add other issue references here too. Please let's discuss this carefully.

Something like that would surely help, I've faced an exchange that deals with ERC20 tokens and not with ether and they only need it to pay for the transactions, and even some users that don't trade with ether needs to have it to move their funds.

In NEO we may have the NEP-5 token, and also some NEO but if we don't have GAS we can't make the transaction.

But how to calculate the proper ratio and where the GAS will come from? Would the wallet holders be allowed to lend some GAS to the network?

I think the proposal is great and would cover my current needs where I'd want to pay with my NEP-5 token.

There are usecases I can can think of, where a project could simply say it will cover all transaction costs just to have free token transfers, they earn enough from other things to keep transactions free for the users.

For that the project could fill/refill the gas gateway at all times with GAS. In that case we would not need to require oracles getting a conversion ratio, but simply pay for the transaction.

I guess it's an interesting direction @rodoufu ... users may lend it for a short period of time (few blocks), and re-claim it if not used. Problem is: these operations would also cost to the network, the lending and re-claiming. So, perhaps best option would be to operate with bigger values and let a third-party manage the margins via oracle operations (that would also cost...)
Since everything changes quickly, it's a challenge to keep info updated, without incurring on too many costs (that could harm the intention of paying by NEP-5 itself).