hmm, now I'm wondering if some bug/flaw could be found in the offline web browser, triggered by something injected into the transaction data... I wonder if there exists a truly 100% perfectly secure approach? If only the block chain data wasn't required. (You see how paranoid I am
)
I'm using JSON as the format of the paste generated by the online page. As such, the JSON.parse() function provides significant protection against what you are describing. JSON.parse() was created specifically as a way to prevent execution of arbitrary code embedded in JSON and is available on all modern browsers. Plus, as you specified, I have a confirmation modal popup on the offline app displaying the values as they will be inserted into the raw tx.
Nonetheless, after creating an initial working prototype, I'm feeling more and more that the appropriate place to enter the destination address and transaction amount may be in the offline component. Is convenience the main reason you want to enter the address and amount in the online component?
I've gone ahead and pushed my initial version as a way to kind of pre-claim the bounty, but I'm not finished yet. In fact, please don't use the app yet for any transactions, even though I've already used it to send btc on the blockchain [1]. It's not been fully tested.
I plan on doing a lot of work on the UI tomorrow, doing some testing, and also producing a GPG-signed release of the MD5 hashes. In fact, I may throw significant energy into this project, including hosting the online portion with SSL, hosting my own full Bitcoin node for querying the blockchain and broadcasting tx's, instead of farming it out to blockchain.info (which as done now requires a third-party intermediary since it's a cross-domain request), and perhaps some other fun stuff, all while keeping it extremely simple to use. I'll probably put up some tasteful ads on the hosted online app to try to recoup the development and hosting costs, but the all the code needed to conduct these transactions will be open source so no one will have to use my hosted version if they don't want to.
I'm open sourcing the code under MIT, and will continue to open source the offline secure signing app and online component as described in xDan's spec above. If I do code up some of the stuff I mention above, I may keep some of the server-side code closed. We'll see. But all the security-critical code will be open-source.
I've used significant code from both Brainwallet and BitcoinJS, which are Public Domain and MIT-licensed respectively. So a big thanks to those guys, it's incredibly cool that all this stuff is being done with JS. I've also used AngularJS and a few other standard liberally-licensed JS libraries.
Anyway, once xDan and crazy_rabbit are satisfied, the bounty can go to: 1KpN5iePG1czLnBvJLzSQWXz9cerBWuBo2 As a said, it's not ready yet, I still need to pretty-up the UI and build these apps into single-page HTML files, and issue GPG-signed hashes of the code.
GitHub repo:
https://github.com/esbullington/bitcoin-securedTransaction on blockchain created using this app:
https://blockchain.info/tx/6549d360e1493865bebe5b90649de8f0d068e109655a2b618fa6d1f7648d8892 As you can see, the change goes back to the sending address, as requested. Do note that you give up some anonymity in exchange for this convenience, since all your transactions will be tied to a single address.
One final note: if you're interested in offline transactions and don't mind maintaining a full node with bitcoind or bitcoin-qt, I'd strongly recommend taking a look at Bitcoin Armory. Etotheipi has done a really great job. That said, I think there's room for a real lightweight implementation of this that doesn't require the blockchain, thus my interest in xDan's proposal.