For example, how can a wallet determine what addresses correspond to a given seed (before and after a snapshot)?
An address is generated from a private key.
A private key is generated from any random 81 trytes (e.g. a seed)
If you want to know how this generating works in detail, you should look at the implementations in the GitHub. (e.g. here in PyOTA) It's basically just a lot of Kerl/Curl hashing.
Since we want to create more than 1 private key from a seed, we do this:
- private key 0 is generated from seed
- private key 1 is generated from seed + 1
- private key 2 is generated from seed + 2
- private key 3 is generated from seed + 3
Since the seed consists of trytes, it's basically just a number in ternary format, so we can add to it.
If you already used the first 10 addresses of your seed, you could theoretically use seed + 10 as your new seed and you would still see your total balance in a wallet.
I made a program that does exactly that. It trims your seed so that your used addresses aren't generated anymore when you log in to a wallet.
(Here is the part where I add a number to a seed.)