The phrase often quoted by investors in the market, “If it’s not your private key, it’s not your cryptocurrency,” conveys the philosophy of crypto key management purists. In this security model of wallets, only individuals (or groups through “multisig”) have direct and sole control over their private keys, and thus, true ownership of their crypto assets. Crypto wallets that adhere to this strict approach are known as “non-custodial,” meaning no outsiders have access to the keys.
However, it’s not that simple. The situation is not as straightforward as it seems. Several high-profile “non-custodial” wallet hacks, including the Slope wallet hack that leaked over 8,000 accounts in August, the Trinity wallet hack in 2020 that lost over $2 million worth of IOTA tokens, the Parity wallet hack in 2017 that allowed attackers to steal 150,000 ETH, along with various hardware wallet vulnerabilities discovered, and other incidents, have disrupted the traditional distinction between custodial and non-custodial wallets. In many such cases, victims who thought they were using non-custodial wallets found that attackers were able to hijack their coveted keys. Isn’t that contradictory?
In fact, the story is more complex than a slogan can capture. Non-custodial wallets do not truly give users complete control over their private keys. This is because wallets are usually created and operated by someone else’s software or hardware. Users constantly place their trust in other people, products, and computer programs. They accept the use of blockchain command-line interfaces, wallet software and devices, centralized platforms, smart contract code, decentralized applications, and various wallet connection integrations in between. Each touchpoint adds risk; the sum of all these interlocking parts breaks the illusion of non-custodial wallets.
Custody in reality is non-binary. What may seem non-custodial at first glance may actually involve many custodial elements, which people often take for granted as reliable. The traditional dichotomy (regulated vs. unregulated) is a false dichotomy.
Instead, it is better to view wallets with more nuance. The key question to ask is: How much attack surface can I accept, and how much responsibility am I willing to take on in seeking to eliminate trust in third parties? Generally, key management, the foundation of wallet security, can be divided into three areas, each with unique exposure opportunities. These subcategories are as follows:
- Key Generation (creating cryptographic keys)
- Key Storage (ensuring the security of static keys)
- Key Usage (putting keys to work)
This overview is intended to help Web3 users better understand the complex issues involved in protecting their assets through the aforementioned red lines. In addition, our goal is to help engineers identify and fix common points of failure in wallet development. We hope that applying this guide, which comes from our comprehensive experience in building cryptocurrency and security systems in Docker, Anchorage, Facebook, and a16z crypto systems over the years, can help investors avoid security incidents, whether they are interacting with, participating in, or building Web3 technology.
Below, we will introduce the common characteristics and pitfalls of existing cryptocurrency wallet security and regulatory platforms. We also cover the areas that we believe need the most attention and development in the coming months and years to enhance the security of users’ Web3 experiences.
Key Generation Wallet Security
Any discussion of wallet security must start with key generation, the process of creating cryptographic keys. Regardless of whether a wallet is considered custodial or non-custodial, the security attributes of the key generation step are most important for subsequent key security. During the key generation process, there are three primary issues to keep in mind: using reliable code, correctly implementing the code, and securely handling the output.
If you are not a cryptography expert, it may be difficult to verify that all of these factors are carried out in an orderly manner. Check whether you can obtain a credible audit report, which some wallet vendors will publish on their official websites or Github repositories. Instead, do your own research and try to determine whether there is a reputable company behind the wallet. If information is scarce, significant user and developer activity may be the next indicator of reputation.
Follow these guidelines to reduce your risk exposure. If a wallet does not pass the checks below, then run for the hills!
- Do not launch your own cryptocurrency wallet.
- Use a wallet that uses a reputable key generation library and program that has been audited.
- Use a wallet that has been measured twice and cut once.
- Use a wallet that can keep secrets.
Key Storage Wallet Security
After keys are generated, they need to be hidden somewhere, never in plaintext, and should always be encrypted. However, simply having a device that stores keys does not necessarily equate to ownership and control over the keys. Many factors must be considered, such as the supply chain security of the device, the connectivity of the device, and which other components the device interacts with.