And here fluffypony explains how they query the blockchain to find inputs. Please, although he's stalking about Monero, the point here is to understand solutions to anonymity. or even techniques of inserting doubt of origin, in whatever function that might be useful in.
Heya,
Not sure if it's been pointed out to you yet, but you may enjoy my talk on Monero from Bitconference:
The brief technical primer starts at the 14 minutes in, and I tried to keep it as accessible as possible. One thing it touches on that may be of interest to you is how the mixing works. Basically transaction outputs are split into powers of 10, so a 123.4 XMR transaction will have outputs of 100, 20, 3, and 0.4 XMR (plus change outputs). Later on if I'm trying to send 100 XMR I will use that previous output as an input in a transaction, but I'll mix just that with other 100 XMR outputs on the blockchain.
Which comes to a point about scalability: obviously scanning the blockchain for outputs to mix with would be slow, so how does Monero do it so quickly? Well, in older clients we kept the entire blockchain in memory, so it was fast, but with the current blockchain database implementation we instead keep a whitelist of mixable outputs grouped by their denomination. So a single call to the blockchain database will take a set of all the mixable 100 XMR outputs, and then randomly choose however many the wallet software needs. It only actually needs to read the output data off disk for the ones it has chosen, not the entire set, so even if there are millions of those 100 XMR outputs it only processes a lookup on the 5 or 10 or whatever that it has randomly chosen (and LMDB, the database engine we use, can grab those from database pages on disk in fractions of a second).
Let me know if you have any questions, and if necessary I'll gladly have a Skype chat with you and answer any questions.
Riccardo