Introduce mechanism for service fees #1956
Replies: 2 comments 7 replies
-
Is this not solveable by proving service specifying a price per unit, and then executing the transaction twice? Once without the note to estimate cycles, and second to add the note back in. We could then optimise this with a partial execution - or blank space for the note asset transfer amount since that's the only missing info.. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the well-written issue. I would go with your Approach 2. We can add a piece on fee discovery that I think is missing from the original framing. Potential High-level design Three components, no protocol changes required:
For discoverability of the set of services, a separate lightweight on-chain directory account (we can maintain this) lists active service account IDs. Pricing and capabilities never live in the directory, only in each service's own account. Some Pros:
Addressing the cons Another new con is that we overload the client a bit. It now has to handle network fees and service fees which are being paid in different ways, maybe different assets. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We want the delegated prover and guardian and similar services to be paid for their work and this discussion explores ideas for doing that.
Approach 1
One idea that was discussed is to let these services sign a receipt when they are called. That receipt is attached to the transaction and submitted to the node by the client. The node then allows the service to claim a part of the fee that the user paid as part of the transaction.
These may both be acceptable for now, as we're okay with subsidizing. But it's not an ideal mid/long-term solution, and we'd be creating some technical debt for the future to switch to something else. Ideally, we have a solution that works in the long run.
Approach 2
Another approach is to make the services check that the transaction they are about to prove or sign creates a private P2ID note with a flat fee as payment for the service. If not, the service rejects the request. The "service fee notes" are added automatically by the client in a tx script to a note that uses delegated proving or the guardian.
Thanks to @partylikeits1983 and @Keinberger for the session to think through the second approach!
Note: This issue was discussed in the context of protocol fees, but seems most applicable to the client, since it would need to integrate most of this, afaict. If this is incorrect, we can move it to the protocol repo.
cc @Dominik1999
Beta Was this translation helpful? Give feedback.
All reactions