rusk icon indicating copy to clipboard operation
rusk copied to clipboard

Implement a contract-driven fee market

Open ureeves opened this issue 1 year ago • 1 comments

Summary

Contracts should be able to choose how fees are paid for the execution of their code.

Detailed Description

Currently, while a transaction is being executed, the computational resources it consumes are metered and then charged to the user, who agrees on a gas limit and a gas price when producing the transaction.

The amount charged, together with the coinbase, is then awarded to both the block generator (90%) and Dusk (10%).

This proposal seeks to augment this functionality by allowing contract owners to:

  • [ ] Be rewarded for execution of their code by allowing them to levy an additional fee on a transaction [#881]
  • [ ] Comp the user's gas fee for execution of their code [#882]

In this context we will also require:

  • [x] Upgrade piecrust version to allow for contract ownership [#883]

Additional Context

Allowing contracts to both levy and comp fees opens up a market for contract writers. The properties of this market, and its game-theoretical implications require investigation.

ureeves avatar May 02 '23 20:05 ureeves

I would like to explore an additional point for investigation, which relates to the end-user flow. I am interested in understanding how transactors can obtain information about the fee system before initiating a transaction. Is there a system in place that allows wallets to access or derive this information and present it visually to users?

ghost avatar May 12 '23 09:05 ghost