Sub topic 1
What a Wallet Actually Holds: Keys, Addresses and Signatures
Prerequisites
This chapter assumes you know what a blockchain transaction is, have a high-level idea of public and private keys, and have sent or received crypto from a wallet app or exchange.
What a wallet holds
A wallet does not store coins. Coins are recorded on the blockchain, a shared public ledger. A wallet holds keys. A private key is a secret number that authorizes spending. A public key is derived from the private key, and an address is a short identifier derived from the public key. Others send coins to your address.
Each spend is signed with the private key. Network nodes check the signature against the address that holds the coins. A valid signature shows that the key holder approved the spend.
# Illustrative model: the ledger holds coins, and the wallet holds keys.
ledger = {"addr_A": 0.50, "addr_B": 1.25}
wallet_keys = {"addr_A": "privkey_A"}
def can_spend(address: str) -> bool:
return address in wallet_keys and address in ledger
print(can_spend("addr_A")) # True
print(can_spend("addr_B")) # FalseWho controls the keys
Self-custody means you hold the private keys. Third-party custody means an exchange or service holds them for you. Whoever controls the keys controls the coins. With third-party custody, your access depends on that service's security, solvency and policies.
What you are protecting against
| Threat | Typical cause | Effect on coins |
|---|---|---|
| Malware | Software on a device copies keys or alters transactions | Funds sent without your approval |
| Phishing | A fake site or message asks for your seed phrase | Keys handed to an attacker |
| Theft | A stolen device, backup or key | Funds moved by someone else |
| Loss | Forgotten passwords, lost devices, damaged backups | Funds become unreachable |
Hot wallets: fast and exposed
A hot wallet keeps its private keys on a device connected to the internet. Spending is quick and simple. The same connection lets malware or a remote attacker reach the keys. Hot wallets suit small balances that you spend often.
Exercise
A hot wallet's private key is copied by malware. Can the attacker spend the coins without your approval?
Show answer
Yes. Anyone holding the private key can sign a valid transaction, so the network accepts it. The attacker does not need your password or your device.