Manage Risk by Using Different Wallet Addresses.

FΞLD | ( 🍌,🍌) | mrbayc.eth
5 min readDec 12, 2021

--

Smart Contract Risk, Accidents, and Carelessness prevention.

Ethereum Wallet Security Primer

By now I’m sure you’ve heard the horror stories, the hacks, and enough scams that if you have been around the Ethereum ecosystem long enough to know what ‘gwei’ means, you probably should be using a hardware wallet by now. If not, check out PPMan’s guide to setting up a hardware wallet. There have been all kinds of twitter threads on why you should get a hardware wallet, and the inspiration to finish this post came from a most recent one by Richerd on twitter. However, this post is going to cover what happens after that, and what smart contract risk is, and how you can avoid it! BUT A hardware wallet is not a security magic bullet. It is only the first step!

But First, How Do Approvals Work?

In order to understand why we would even want to do this, we need to understand how Smart Contract approvals work. In order for any smart contract to interact with anything other than ETH (including WETH or ‘Wrapped Ethereum’) you MUST give it an approval to do so.

Figure 1 — Example of an approval transaction on etherscan.

Whatever you approve, generally stays on your account forever. If you give ‘INFINITE APPROVAL’ (A Security no-no, but still common) to a contract, it will make interacting with that contract cheaper, since you won’t have to do gas approvals every time you want to transact. However, you are sacrificing a bit of security when you do this. A common example of this is making WETH offers on Opensea. If you have already done it once, it is gasless, and if your offer gets accepted, the WETH is pulled straight from your account. No transaction required. Cool… and scary, right?

So Then, Why Use Separate Wallets?

There are many reasons but the first of which is risk management. The biggest risk we are trying to avoid here is smart contract risk! I have several different wallets, and they are configured in a sort of “air-gapped” fashion from each other. See the illustration below for an example of what I mean:

Figure 2 — Diagram taken from @Drakedanner on twitter illustrates the concept quite well.

Notice how the ‘Large Holdings’ is never interacting with smart contracts directly. This wallet does not mint, it does not stake, claim, Add/Remove Liquidity. It should not be initialized on Opensea, and if it is, you sure as hell shouldn’t be signing any messages with random strings in it (more on this later)! A good mental model for this is to think of your Active Wallet as what you’d be willing to carry around in your pocket at any given time, and your ‘Large Holdings’ cold storage as your Bank Account.

Sometimes it makes sense to have multiple “large holdings” wallets as a DeFi power user, especially if you want to protect yourself from interacting with new smart contracts that might do unexpected things. I actually suggest at least 3 wallets for the crypto native who has a large amount of DeFi and NFT value on the blockchain. Keep in mind you can have all of these wallets on one hardware wallet. You don’t have to buy multiple hardware wallets to protect yourself from these types of risk! The three different wallets are as follows:

  1. 1+ Wallets for minting new things and interacting with high risk DeFi protocols. If any of these become worth anything, you can transfer them out to different wallets later.
  2. 1 Wallet where you put high value NFTs you don’t plan to sell, or large balances to park and not interact with smart contracts with (not all of your crypto has to be earning yield and farming, y’all, sheesh!). Do not initiate an Opensea, rarible, or any other kind of profile here. Do not list high value NFTs from here. Transfer them back out to another wallet when you plan on selling them.
  3. 1+ Wallets where you interact with only the most trusted protocols and websites, with higher value balances/NFTs that you plan to sell. Some folks even have multiple of these wallets just in case.

Seems a Bit Overkill, No?

Everyone has their own risk tolerance, so do your own research, and manage your own risk accordingly. I’m just here to point out some of the risks. However, it is not just purely theoretical. This is one of the largest attack vectors around, especially for users with a hardware wallet already. I was recently a victim of a hacked front-end that caused me to approve 2.5WBTC to a malicious address. Read more about that here.

If you are more of an NFT user, a recent scam/hack that has was able to scam a few people out of their high value NFTs was taking advantage of Opensea’s transaction API. Essentially, when you went to this website to “sign a message to prove you own this wallet”, what you were ACTUALLY signing was an Offer acceptance transaction, basically selling your high value NFT’s for 0.00001ETH. The OpenSea API twitter posted about it here:

Figure 3 — Hackers leveraging Opensea’s transaction API to get users to sign bad signatures.

Warning: I know, I’m telling you to never sign anything. But I know some of you will sign something anyway. However, you should be very careful with what you sign. Have you ever seen a signature request that looks like the one below? Well if so, you should NEVER SIGN IT! If it is simply a hash, you have no idea what it is you are signing. It could be instructions to OpenSea to sell your most valuable NFT for 0.00001, or it could be leveraging some smart contract you’ve given approval to already to steal your funds through it! Stay vigilant!

Figure 4 — A signature request with just the hash, without the original message! DANGER!

Conclusion:

The NFT/DeFi landscape is a scary place. We’ve seen an absolute maddening amount of increase scams using phishing links, etc. Make sure you don’t sign malicious approvals, learn to check the smart contract inputs on your approvals just in case! Also, if your approvals look anything like my old minting wallet (below), probably best to just abandon it if possible. Revoking permissions does cost gas, so depending on how bad it is, maybe its best to just move your funds to a new wallet all together!

Figure 5 — Too many approvals on an old minting wallet. This is what you don’t want to see!

If you feel you may have some approvals you shouldn’t have, you CAN in fact revoke them! A few resources in doing so are here:

https://etherscan.io/tokenapprovalchecker

Anyway, feel free to reach out to me on twitter or discord if you ever feel paranoia about your own security status. I live to keep this space safe, but I need everyone’s help to do it! Cheers y’all!

--

--

FΞLD | ( 🍌,🍌) | mrbayc.eth

#bitcoin #ethereum #DeFi #NFTs - not a maxi. Think Bigger. Enjoy the Journey. Community is Value. #BAYC #4014 - http://verify.collab.land/CfPn_VTfgswD