I imagine it as an incompatible fork of TOR. When you go to build the circuit, nested tunnels are created to each successive relay node. At that time you're already communicating with those nodes, so adding getwork/submit results into the protocol wouldn't be hard.
I can imagine that my proposal can be compatible with current Tor and it's even less complex than "every relay is mining pool". Actually the only chance in your idea is "premine" traffic in every circuit, so you'll need to wait long time (hours?) before you'll be able to actually use the circuit. Don't forget that circuits are usually short-time constructs...
This would require centralized accounting. If the codes are completely independent it would be a LOT of bookkeeping.
No... why? getwork() -> mining -> submit() -> redeemable code received. Miner can even choose target difficulty of getwork, so one redeemable code can be the equivalent of 100 shares, for example (with target in getwork set to 100). No bookkeeping, no accounts, no identity revealed. Every getwork can be as anonymous as in your proposal, except that you can freely premine codes independently on the circuits you'll want use in the future.
If the codes are pooled on an account that's used for a few minutes at a time, each account could only be used with one relay node, AND only when connecting to that relay node through a specific path. That's a lot of complexity to add.
...because you didn't catch the idea of redeemable codes. No account is needed on the pool. Every getwork can be isolated, so you can get completely unlinked pieces of value (=redeemable codes, which are equivalent of some well-defined work on the pool). However you're right that once you'll use redeemable code on one relay, you should not use it on another. But it's ok, because one code can be 100kB of transferred data.
It would increase setup time since you would have to mine for several minutes to connect to the first node, then several minutes for the next node and so on.
No; that's the basic improvement against "mine on the relay". You can mine overnight for codes and then use them all during your one-hour session when you actually need it.
If you allow premining or saving unused credits, it would also eliminate one of TOR's protections: forward secrecy. If you save the account number on your computer, someone who logged your connection from an exit node would then be able to prove it was yours after seizing your computer.
No, once you redeem the code, you drop it, because it is useless; relay will redeem it's whole value.
For all those reasons I think it's better to mine in realtime for each node, only accumulating credits for as long as your tunnel is up.
I hope that I explained it better now :-)