Lessons 1/4 · 15 min
A wallet holds keys, not funds
The phone that fell in water
Dayo drops his phone into a bucket of water. The wallet app is gone. Has he lost his money? The answer depends on one thing: does he still have his keys (or the seed that generates them)? If yes, he installs an app on another phone and his balance reappears. If not, his funds are still on the chain, but nobody can spend them any more. That difference is the heart of the workshop.
Who is who
- Funds: a line of the chain's state (a balance, or unspent outputs). They live on the chain, never in an app or on a phone.
- Key pair: a private (secret) key and the matching public key (workshop 105). Signing a transaction with the private key is the only way to spend what is locked to that key.
- Address: a public identifier computed from the public key, by a convention specific to each chain. Bitcoin passes the public key through two different hash functions (SHA-256 then RIPEMD-160, not to be confused with the double SHA-256 used for blocks and transactions) then adds an encoding; Ethereum takes the last 20 bytes of a Keccak-256 hash of the public key. In this workshop's exercises we use a toy convention: the first 20 bytes of the SHA-256 of the public key (bytes, not text). It is not the convention of any real chain.
- Wallet: software or a device that keeps keys, builds transactions, has them signed and displays balances it reads from the chain. It is not the vault of the funds.
Types of wallets
| Type | Where the private key is | What it changes |
|---|---|---|
| Non-custodial, software ("hot") | In your app | Convenient; exposed if the device is infected |
| Non-custodial, hardware ("cold") | In a dedicated device that signs without revealing the key | Reduces exposure; the device can also be lost |
| Custodial (exchange platform) | At a third party that holds the keys | The third party can lose, freeze or refuse; you hold a claim on it, not control |
Example: getting the funds back
Dayo had an address A. The funds tied to A remain on the chain after the phone is lost. With a new app and his seed, he recovers the same private key, hence the same address A, hence the same ability to sign. Without the seed, he can still see A's balance (chain data is public) but he can no longer sign.
What this does NOT guarantee
- Losing the app does not lose the funds; losing the keys does.
- An address is not an identity: it does not say who controls it.
- A "secure" wallet does not stop you signing a transaction that you approved by mistake.
- The chain has no help desk and no "forgot password": nobody can reset a key.
Recap
Funds: on the chain. Private key: the power to spend them. Address: a public name derived from the public key. Wallet: the tool that keeps keys and signs.
Interactive tool
ECDSA P-256 signature
Generate a key pair in your browser, sign a message, then verify the signature.
The private key is created with extractable: false: the browser keeps it in memory and never lets it be exported, and it is neither displayed nor stored. It lives only in this tab: reloading the page loses it.
Public key (SPKI, base64)
No key yet. Generate a pair to sign.Signature (base64, P1363 format: r ‖ s, 64 bytes)
…ECDSA with SHA-256 on the P-256 curve. WebCrypto returns r and s concatenated (32 + 32 bytes), not DER encoding.
Verify a signature
Interactive tool
SHA-256 of hex bytes
Paste bytes as hex: the hash covers the bytes, not the text of the digits. A second field is concatenated after the first.
Digest
…Spaces, newlines and 0x prefixes are ignored.
