spesmilo/electrum — pull request #227 by tigereye (2013-05-24 02:10:58+00:00)
Title: Sending/Receiving unsigned/signed transactions via QRCode

Hi.

So I've written a patch to the QRCode plugin that allows an unseeded+online electrum client to communicate with a seeded+offline electrum client via QRCodes.

The motivation of these modifications was to further reduce the risk profile of dealing with offline machines by preventing any "infectable" media from contaminating an offline machine. With QRCodes there's no need to copy files and no opportunity for 'autorun' shenanigans.

The idea is identical to the existing "offline transaction" feature, but with QRCodes:
1. The unseeded+online machine shows a QRCode to the seeded+offline machine. The QRCode represents an unsigned transaction in the standard JSON format that's put into files.
2. The seeded+offline machine reads the QRCode, signs the transaction and displays it as a QRCode to the online machine.
3. The unseeded+online machine can then read this QRCode and broadcast the transaction.

The vast majority of my changes were made to the qrscanner.py plugin, although I had to edit 1 line in gui/qrcodewidget.py to get larger QRCodes to display properly.

In order to pull it off successfully, I ended up copying/modifying a few smaller functions from various places around electrum into the qrscanner.py file itself. I did this because the original functions couldn't be called natively due to subtle changes that were required for the QRCode stuff. I realize that this may not earn style points, but my lack of code-reuse may be able to be solved by someone more skilled with python than myself :)

I'd welcome any feedback to the changes, and if people like them (and testing goes well), I would love to see this functionality end up in some future electrum release... even if all of my code is rewritten by someone who takes all the credit.

Speaking of credit, motivation for this plugin can be credited to Tuxavant who refused to release his own scripts that did similar! In response: take my point-and-click solution and shove it in your hookah!