How much code would I have to write to make MetaMask use Tornado so I can get easy-to-use, private ETH transactions?
- command-line tool: connect to MetaMask-in-browser and print account balances, addresses to console
- Add --deposit option: figure out how many of what denonimation tornado deposits to make to zero-out account.
- ... use account's private key as HD MPK, use paths 86'/0'/... and 86'/1'/... to derive tornado notes (??how to get private key? Ask for 12-word backup??)
- ... deposit into those notes (use Thresher for any leftover balance after paying deposit transaction gas)
- Add option to display total balance stored in Tornado (via some magic). Q: Privacy problem if contract state queried from a single service/node?
- Add --send amount to_address option: derive temporary withdraw keypair
- ... withdraw amount sufficient for send to temporary address (smallest withdraw via relay, others can pay gas from temp address)
- ... send from temporary address to destination
- ... deposit change back into tornado (same process as --deposit)
TEST: re-import metamask wallet on another machine via 12-word backup; tool should be able to re-derive the notes and display balance stored in tornado.
All that code could be re-used in a Dapp with a nice deposit/send GUI.