I know that the easiest way is to generate new address for every user and then withdraw token/eth from it, but this requires additional tx fee payment. Is there any way how I can determine users by eth accepting and don't spend additional fee? Mb pass some message or 3rd party service?
What do you mean by users? Are these users on central exchanges? Is it a single Ethereum address used by multiple users? Then the best way is to add some data to the message when sending ETH, but this will just distinguish the transactions, all the Ethereum/tokens will be pooled together. It is not like the bitcoin model with UTXO where you can trace different satoshis. For ETH you have different standards like NFT (ERC721 or ERC1155) that help you. What are you trying to achieve?
this is quite challenging problem that is faced for small exchange to maintain the funds to master wallets,
the existing model of transaction:
- create a user account and allow user deposit tokens
- once the user deposit the funds , send some eth/bnb/matic based on network
- withdraw tokens to main wallet and then withdraw the remaining if any.
here the team need to bear a fee for 3 transactions and some times more if the transaction fee is high and changing GWEI per transaction,
the resolution is quite different and was implemented . here is the new flow that is used.
- generate a slave account with 0 fee and provide it to user to send funds,
- once the user sends funds the funds are withdrawn in a single transaction. the fee for the transaction is beared by other account which remains same for all accounts that is used for all the exchange users.
this is the next level of source for avoiding the transaction fee for small and mid level exchanges and wallet service providers.