The expected outcome is very simple:
Users will send their ERC20s to a smart contract. Depending on the amount, each user will get a file specifically created for them. I want to distribute that files in a decentralized way without requiring users to send their email address in the smart contract interaction.
Therefore I expect to have the files (a .tar.gz for each user). That file will be encrypted with the Ethereum public key of the user and can only be decrypted with their private key, therefore allowing ONLY them to access the content inside the .tar.gz
I already investigated the potential solutions and I found this which honestly I feel is unrelated to solving my problem or it's not clear. They are using Ethereum Smart contract to verify (I guess that should happen client side).
Someone suggested on encrypting a message using ethereum public key here Does that mean I could simply create the .tar.gz secret password using the user public key which can only be decrypted by their private key? How safe are .tar in this case?
Any suggestions are welcomed
EDIT: I would also love a solution using web3.eth.personal.sign if such solution is viable