Token Approvals – Understanding the Risks in Transactions and Security

hardware-walletsmetamaskprivate-keytokenstransactions

How exactly do token approvals work? As they cost gas fees, I assume they must be stored on the blockchain.

Let's say, I approve uniswap to spend all my eth. Does that mean that a central entity has access to all ethereum on my address without needing (essentially bypassing) my private key to sign any transactions? Will the blockchain just check for approval in this case, rather than checking whether or not the transaction has been signed with the correct private key? Or is it merely an authorization for any web3 application to prepare a transaction, but it would still need my confirmation?

If no additional confirmation is needed to spend my eth at any time, would that mean that anyone who hacks uniswap for example, would have access to all approved tokens on any wallet that approved them to uniswap?

If I were to approve spending all my eth to a scam website, would only the address that I used to confirm the approval be compromised, or would all addresses associated with my private key be compromised?

If this scamming website would try to steal my coins, would they need me to confirm a transaction for every steal attempt they perform? Or would I at least have to be logged into my wallet (Metamask in my case) for any stealing attempt to be successful?

And what if I use a hardware wallet like trezor. If I approved spending of all my coins to a scamming website and they would attempt to steal it, would they need me to manually confirm something on my wallet? Would they be able to steal even at times when my hardware wallet is not connected?

And lastly, can I manually change the maximum amount of tokens that I approve to be spent (in Metamask for example)? Because often, it is unlimited.

Best Answer

Yes, setting approval for your tokens lets whoever you approved spend them as if they were there own. So if you allow 1ETH to uniswap then uniswap could spend that 1ETH on your behalf without requiring you to sign any tx or anything of the sort. As for your question about uniswap getting hacked in theory yes, if the hacker obtained access to the address that you approved your tokens to then they could do what uniswap could, which as stated previously is spend your approved amount without any intervention needed from you.

Yes, only the address you approve from would be compromised and only the address you approved could spend the tokens on your behalf.

As soon as you approve your tokens the person you approved no longer needs any form of validation from you, they can spend whatever amount they are approved for. Regardless of the wallet you are using.

Yes you can change the amount you are approving, when you click approve, in metamask you will see "view full transaction details", when you click this it will say how much the user is proposing you allow and allow you to set a custom amount for allowance

p.s you can check who and what you have allowed here https://etherscan.io/tokenapprovalchecker

Related Topic