W4_Security and Privacy in Web3
W4_Security and Privacy in Web3
1. Wallet Types
Session: Security and Privacy in Web3
Wallet addresses
“Like email addresses, Bitcoin addresses can be
shared with other Bitcoin users who can use
them to send bitcoins directly to your wallet.
Unlike email addresses, you can create new
addresses as often as you like, all of which will
direct funds to your wallet. A wallet is simply a
collection of addresses and the keys that unlock
the funds within. There is practically no limit to
the number of addresses a user can create.”
✗ You are trusting a company to secure your private key and protect your funds from theft or hacking
✗ Third-party access increases vulnerability to attacks
✗ High risk of phishing attacks, as users can be redirected to fake websites that capture login details
Note: Although you hold the seed phrase, the security of your funds depends on the web wallet provider’s
software security.
✗ Cannot verify transactions as it does not store a full copy of the blockchain. You must trust third-party servers
to access and receive information about the Bitcoin network. A malicious third party might spy your
transactions
✗ General-purpose computers are vulnerable to malware malfunctions and are attractive targets for thieves
Exodus Electrum
✗ General-purpose computers are vulnerable to malware, malfunctions, and are attractive for thieves.
✗ It may take days to download and synchronize, with noticeable bandwidth and disk space requirements.
✗ Often have advanced features and functionality that are confusing for beginners.
✗ Harder to run with / as a full client (though many wallets have been adding support for this recently).
✗ When in the presence of others or cameras, take care that your PINs and other sensitive wallet info is
not visible.
✗ Take care to secure your mobile device and accounts against popular attacks such as SIM-swaps.
✗ Expensive
✗ Less convenient than mobile wallets for day-to-day transactions
✗ Do not lose both the device and the backup mnemonic phrase
✗ Beware buying from third-party resellers rather than the manufacturer
COLDCARD BitBox
• This can happen in a number of ways, depending on whether the medium of key storage can be connected
to the internet or other devices.
• Cold storage refers to using an offline medium for storing bitcoin private keys, i.e. a device that is not
connected to the internet, at least most of the time. This method is more common for the long-term storage
of large sums that do not need to be accessed or used regularly. Today the most popular medium for this is
hardware wallets.
• “Deep” cold storage refers to a method of cold storage where private keys are generated entirely offline,
sign transactions offline, and are stored on a device that is not / has never been connected to the internet. A
device which has been modified to remove networking features and used under various isolation
techniques is known as “airgapped.”
On a paper wallet
Source: https://coinsutra.com/hd-wallets-deterministic-wallet/
Source: https://crypto.com/university/custodial-vs-non-custodial-wallets
• Avoiding (if possible) the use of online services or devices to generate private keys.
• Use different types of wallets for different purposes and amounts. For example, you may use a mobile
wallet for small everyday purchases, whereas your long-term savings are kept on a hardware wallet.
• Create backups of all your wallets and occasionally test recovering them to your device(s). Make sure that
they are stored in a safe and secure place.
• Encrypt your wallet with a passphrase -- even if someone steals your mnemonic seed, they won't be able
to access your coins without the passphrase!
• Do NOT split your mnemonic seed words and store them in different places, as such practices generally
increase the chances of accidental loss. Instead, you can use multisig or the more experimental Shamir's
secret sharing scheme (SSSS).
Finally, in general, make sure to use the most up-to-date versions of software on your
devices. Otherwise you may miss important security patches!
Source: https://appinventiv.com/blog/defi-vs-cefi/
• Market Risk
• Token prices can be highly volatile
• Technology Risk
• Transactions cannot be processed due to capacity limits of underlying blockchain
• Smart contract failures
• Inaccurate oracle information or delayed oracle updates
• Liquidity Risk
• Inability to obtain sufficient tokens in time or at a reasonable cost.
• A major source of DeFi’s liquidity risk is that collateralized tokens lock up liquidity.
• Other software risks include Distributed Denial of Service or DDoS attacks, injection,
uncontrolled format strings, and buffer overflow attacks against DeFi platforms.
• Poorly designed smart contracts can expose significant risks due to their widespread use in
lending, trading, and staking protocols.
• Even a small error in the code can lead to massive financial losses or contract failures, exposing
users to fund theft or permanent fund locks.
• That is why smart contracts must be thoroughly tested and audited for security flaws before
deployment.
Source: https://appinventiv.com/blog/defi-vs-cefi/
Scenario:
• A smart contract intends to transfer 1,000 tokens, but due to a rounding error, it rounds up to
1,001 tokens.
• The contract has insufficient funds (1 token short) and the transfer fails. This can lock up the
entire pool of 999 tokens permanently in the contract.
• Flash loans are Instant, no-collateral loans that must be repaid within one transaction.
• They allow attackers to manipulate token prices through oracles by quickly selling tokens, lowering
the price, and then buying them at a lower price on other platforms.
• A good example would be rounding errors that lead to incorrect token balances or failed
transactions.
• Even small errors, such as incorrect decimal places, can cause failed transactions and lock
funds.
• In extreme cases, these errors can cause contracts to be "bricked," making funds
inaccessible.
• ZKPs enable privacy-preserving transactions (e.g., Zcash), secure voting systems (proving
voters' participation without revealing choices), and authentication protocols for identity
verification without disclosing personal information.
Source: https://chain.link/education/zero-knowledge-proof-zkp
Source: https://chain.link/education/zero-knowledge-proof-zkp
● ZK proofs are
becoming cheaper
while gaining
popularity on
Ethereum.
● ETH-denominated
value on ZK rollups
has increased,
despite declining
verification costs.
Source: https://a16zcrypto.com/posts/article/state-of-crypto-report-2024
Source: https://chain.link/education/zero-knowledge-proof-zkp
• Features:
• Proof of Work consensus mechanism
• Fixed Total Supply: 21 million ZEC, identical to Bitcoin.
• Low Fees: Default .0001 ZEC per transaction, configurable by users.
• Encrypted Memos: Users can include private messages or data to transactions.
• Transaction Expiration: Default expiration of 40 blocks (50 minutes) to prevent mempool bloat.
• Zcash's zk-SNARKs allows encrypted transactions without requiring parties to share private
keys or data. It ensures that all inputs and outputs of shielded transactions remain encrypted,
while still being validated by the network.
• Transaction Types:
• Transparent (t-to-t): Public transactions, similar to Bitcoin.
• Shielded (z-to-z): Most secure, encrypting sender, receiver, and amount.
• Shielding (t-to-z) and Deshielding (z-to-t): Transition transactions between privacy and transparency.
• While the transaction details are encrypted in z-to-z, all transactions are
visible on the public blockchain, ensuring transparency in occurrence and fees.
• Key Features:
• Anonymity: The identity of the real
signer is hidden among the group of
possible signers.
• Unlinkability: No one can determine
which member of the group actually
signed the message.
• No Setup Required: Unlike other
anonymity protocols, no trusted setup is
necessary for ring signatures.
Source: https://www.sciencedirect.com/topics/computer-science/ring-signature
Source: https://www.getmonero.org
• Features:
• Utilizes zk-SNARKs for privacy.
• Allows users to send and receive Ethereum and ERC-20 tokens anonymously.
• Non-custodial: Users retain control over their funds without intermediaries.
• Tornado Cash has faced legal challenges and was banned by U.S. authorities in 2022,
accused of facilitating money laundering, raising concerns about the balance between privacy
and regulatory oversight in DeFi.
4. Conclusions
Session: Security and Privacy in Web3
Conclusions
• Choosing the right wallet type and securing private keys are essential for protecting digital
assets in Web3
• Awareness of smart contract risks and common exploits empowers users to safeguard against
vulnerabilities
• Zero-Knowledge Proofs and other privacy tools are fundamental for preserving anonymity on
public blockchains
• Privacy must be carefully balanced with transparency to maintain trust and integrity in
decentralized platforms
5. Further Reading
Session: Security and Privacy in Web3
Further Reading
Everything you need to know about crypto addresses
https://www.exodus.com/support/en/articles/8599045-everything-you-need-to-know-about-crypto-addresses
Understanding User-Perceived Security Risks and Mitigation Strategies in the Web3 Ecosystem
https://dl.acm.org/doi/pdf/10.1145/3613904.3642291
Twitter: @mscdigital
Course Support:
[email protected]
discord.gg/bq2P9XUfnD
IT & Live Session Support: [email protected]