Sub topic 1
Keys and wallets: what actually controls your funds
A blockchain does not store coins inside a wallet app. It records balances or spendable outputs associated with an account. Control comes from proving that you possess the account's private key.
This chapter assumes you understand the basic idea of a blockchain and cryptocurrency. You should also be comfortable using a web or mobile application. Later code examples assume basic JavaScript, but no programming is needed here.
Prerequisites
You need:
- A basic understanding of blocks and blockchain networks.
- A way to distinguish a password from a cryptographic key.
- An understanding that different networks can use similar-looking addresses.
From private key to address
A private key is a secret number generated with enough randomness to make guessing it impractical. It authorizes transactions. Anyone who obtains the key can usually create a valid transaction that spends the associated funds.
A public key is mathematically derived from the private key. It can be shared. An address is usually a shorter, encoded value derived from the public key. People normally send funds to an address rather than to a public key.
The relationship is one-way for practical purposes:
The address does not contain the private key. It is safe to publish an address for receiving funds, but it is not safe to publish the private key or a recovery phrase.
What a wallet does
A wallet is software or hardware that stores, derives, or uses keys. It also formats transactions and asks the network to broadcast them. The wallet does not move funds by itself. It signs a transaction, and network participants verify that signature.
| Wallet type | Where key control resides | Main trade-off |
|---|---|---|
| Self-custody wallet | You or your device | More control, more responsibility |
| Hardware wallet | Dedicated signing device | Strong protection, less convenient |
| Custodial account | An exchange or service | Convenient, but the service controls withdrawals |
A recovery phrase, also called a seed phrase, can derive many private keys. It is therefore often more powerful than one exported key. Write it down offline and protect it from cameras, cloud backups, and unauthorized people. Never enter it into a website that claims to “verify” or “synchronize” your wallet.
Accounts are network-specific
An address may look valid on several networks, but that does not mean the networks share the same ledger. A transaction sent on one chain may not appear on another chain, even when the address text is identical.
Before sending, verify:
- The receiving address.
- The selected network or chain.
- The asset and its contract, if it is a token.
- That the recipient supports that network.
A wallet can display one address for several networks while still tracking separate balances. The network determines which record the transaction changes.
Signing is the critical action
A wallet may show a transaction before signing it. Review the destination, amount, network fee, and any contract action. A normal transfer and a contract approval can look very different. Signing an approval may allow a contract to move tokens later.
After signing, the private key remains the authority. A transaction hash only identifies a submitted transaction; it does not prove that the recipient received spendable funds.
Exercise
Which item must remain secret: an address, a public key, or a private key?
Show answer
The private key must remain secret. An address and public key can normally be shared, although an address may reveal transaction history.