rusk
rusk copied to clipboard
Implement a contract-driven fee market
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.
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?