I really like that there are two options for shielding ETH/ERC20 tokens: 1) simply an ethereum address where a user can send funds from an exchange or whatever and 2) an ability to interact with the smart contract directly.
Regarding the 1st option, I observe the flow to be:
- A permanent wallet address is generated and users send funds.
- Somehow that deposit is detected and an incognito admin wallet sends a small amount of ether to that wallet.
- A smart contract interaction is created to deposit the tokens to the smart contract.
- A very small amount of ether is leftover in the wallet.
I’ve noticed there are at least two gasless decentralized exchange options for interacting with sushiswap & uniswap. The problem they solve primarily is that the transactions do not stay pending in the mempool so frontrunning is not possible. Instead a fee/bribe is paid exactly to the miner to do these transactions.
I’ve seen TX confirmations on etherscan and indeed zero gas is used. I don’t know how they are exactly bribing the miners but I assume you can bribe them to process any kind of transaction.
In our case perhaps it can be used to improve shielding flow.
- We bribe the miner to include the deposit transaction from the temporary ethereum address to the smart contract.
- This means that there doesn’t need to be gas in the wallet. No gas is needed to provide the temporary address the gas and there is no gas leftover from fee estimation inefficiencies as well.
- I’m not sure if miners accept bribes in any ERC20 but if they require eth perhaps the ETH could come from a different wallet than the temporary shielding address.
I’m not technical enough on how zero gas transactions are possible but if one can execute uniswap & sushiswap trades without gas our application should work as well. Thoughts?? (By the way, I like that you have both options for shielding coins as it would serve users in different ways.)