Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sponsored Fees #1068

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Sponsored Fees #1068

wants to merge 4 commits into from

Conversation

Nana-EC
Copy link
Contributor

@Nana-EC Nana-EC commented Oct 25, 2024

Description:
This HIP proposes an expansion to the approval and allowance network logic (i.e. CryptoApproveAllowance, NftAllowance
and TokenAllowance) by allowing any account on the network to provide allowances that will sponsor the payment of the
fees for another account’s submitted transactions.
In this way account Alice may assign an HBAR / token transaction fee allowance for EOA account Bob or Contract account
Carol and pay the fees due to nodes, the network and accounts for any transactions they submit, thus allowing Bob or
Carol to have zero balance and still transact on chain.

This proposal extends the existing Approval and Allowance API by adding the concept of a scope that designates the type
of value transafer an allowance applies to.
The scopes will include CryptoTranafer, HAPI transsaction fee and token custom fees.
This enables value transfer and fee payments to another account without requiring one-off
approval for each transaction. This feature enhances flexibility and efficiency in managing transaction costs,
particularly for high volume applications.

Related issue(s):

Fixes #912

Notes for reviewer:
Expect more changes soon.
There's an outstanding item to condense the Allowances types to instead be scopes on the existing allowances as a cleaner API form

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: Nana Essilfie-Conduah <[email protected]>
Copy link

netlify bot commented Oct 25, 2024

Deploy Preview for hedera-hips ready!

Name Link
🔨 Latest commit cb20b1a
🔍 Latest deploy log https://app.netlify.com/sites/hedera-hips/deploys/673ac44327c1760008ebded5
😎 Deploy Preview https://deploy-preview-1068--hedera-hips.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Nana-EC Nana-EC self-assigned this Oct 25, 2024
@Nana-EC
Copy link
Contributor Author

Nana-EC commented Oct 31, 2024

Updated HIP with scope concept and fixed PR description with updated Abstract

@tud0r6
Copy link

tud0r6 commented Nov 1, 2024

Would it be possible for sponsored fees to be optionally set towards spending by a smart contract, thus limiting the scope of the approval to executing only 1 particular smart contract.

@gregscullard
Copy link
Collaborator

gregscullard commented Nov 2, 2024

Would it be possible for sponsored fees to be optionally set towards spending by a smart contract, thus limiting the scope of the approval to executing only 1 particular smart contract.

@tud0r6 I like this idea, to be clear, you mean that if I grant some hbar to Alice, I would be able to specify that Alice can only spend the hBar on executing transactions related to a specific contract, nothing else. She would not be able to execute another contract, or create an NFT, etc...

Note, hbar in this case is gas for contracts, does the allowance extend to paying for gas (through the SDK and/or relay), or just native fees ? If only native fees, we may need to consider supporting gas payments.

@Nana-EC
Copy link
Contributor Author

Nana-EC commented Nov 4, 2024

Would it be possible for sponsored fees to be optionally set towards spending by a smart contract, thus limiting the scope of the approval to executing only 1 particular smart contract.

@tud0r6 I like this idea, to be clear, you mean that if I grant some hbar to Alice, I would be able to specify that Alice can only spend the hBar on executing transactions related to a specific contract, nothing else. She would not be able to execute another contract, or create an NFT, etc...

Note, hbar in this case is gas for contracts, does the allowance extend to paying for gas (through the SDK and/or relay), or just native fees ? If only native fees, we may need to consider supporting gas payments.

Great considerations @gregscullard and @tud0r6 .
So the intention of this HIP was to cover value transfers that cover fees.
Initially it was not intended for gas, however, gas is eventually settled used to define the work but it's paid in the form of hbar.
So there's a possibility to extend it to cover gas payments with a specific scope or as GAS_PAYMENT 🤔.
I like it, though we need to think on any unintended emergent features here 😅.
For example the Ethereum JSON RPC API doesn't support the ability for an EOA to specify the transaction is sponsored. Which would mean it might only be available via ContractCall/ContractCreate HAPI and not via EthereumTransaction

@tud0r6
Copy link

tud0r6 commented Nov 5, 2024

tention of this HIP was to cover value transfers that cover fees.
Initially it was not intended for gas, however, gas is eventually settled used to define the work but it's paid in the form of hbar.

Indeed, I won't want to sponsor general-use gas(HBAR), rather application(SC)-specific gas(HBAR).

Signed-off-by: Nana Essilfie-Conduah <[email protected]>
Signed-off-by: Nana Essilfie-Conduah <[email protected]>
@Nana-EC
Copy link
Contributor Author

Nana-EC commented Nov 18, 2024

@gregscullard and @tud0r6 I've added the gas scope but also added thoughts in the open questions section around some challenges here.
Any ideas on how to address this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants