velas / velas-chain

Other
70 stars 35 forks source link

Implement dApp for fee payer functionality. #386

Open vldm opened 1 year ago

vldm commented 1 year ago

In order to make gass-less tx easier, we should implement decentralized logic of "bridge startup". For most cases we don't need to force dApp creators to setup it's own bridge, instead we can implement "register-like" functionality on program level.

For shorts, let's call this program "gas-station"

Program should contain two kind of instructions: 1) Register "fee" payer. In this instruction, caller provide an account that "gas-station" program will use later for commission withdrawal.

In this account we should store next data:

2) Execute tx In execute tx, caller provide a "gas-station" account in order to withdraw commission.

It also provide raw transaction in "big" or "short" form. After whitelist validation "gas-station" program send this transaction to evm_loader program, and execute it with fee_payer=native. At the end of transaction, "gas-station" should also send small amount of VLXs to the "caller" in order to refund their native fee.