I was wondering if there is a way for a user to pay transaction fees for another user, meaning user A sign the transaction and user B send it to the network and pays the gas fees.

I found a solution here : https://docs.openzeppelin.com/learn/sending-gasless-Transactions But it is very coplicated and Technical, I just need a simple way to pay fees for other user.


I just need a simple way to pay fees for other user.

I think you might be disappointed. The technique involves setting up considerable preconditions including changes to the contract the users will use. Such changes are not applicable to published contracts in a general way because most contracts are immutable. For the developer that wants to "install" this sort of feature in their dapp at the outset, it's a technical process and not trivial.

I could paint a tenuous analogy that might help. It would be like converting a regular car into a self-driving car. The steps involved won't be for everyone.

This is not to say that it won't be possible in the future. The idea of transaction fee "abstraction" is under discussion for future versions of the EVM. Stretching the analogy, maybe the upgrade would be simpler if the car itself was designed to help make it a consumer-level do-it-yourself process in which the parts fit easily into pre-made standardized receptacles - less customization and fabrication, more plug and play.

Update: You Pay Gas

Another possibility is that you would pay all the gas for all the users. Either that would be an acceptable cost (not usually the case) or you would find another way to be compensated. This is what the above-mentioned "changes to the contract" usually deal with. Carving off a transaction fee from whatever funds are available and sending to the "relayer" that is forwarding "raw transactions" that were signed by users and sent to the relayer instead of the chain.

User signs the transaction, sends it to the relayer (off-chain, e.g. https), and the relayer pays the gas to send it to Ethereum.

Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.