QR codes are nice but there are some cases when we want to connect hardware wallet to the computer:
preform CoinJoin
act as an HSM for lightning network
do anti-nonce sidechannel protocol - it requires multiple communication rounds and is unconvenient in airgapped mode (see my writeup on Medium)
firmware upgrade
For all this we need USB connectivity.
At the moment USB is used for MicroPython's REPL (that should be disabled in production). For development we can bind REPL to UART3 and use USB for communication.
Small snippet that implements this:
# UART3 connected to stlink
repl = pyb.UART('YB',115200)
# redirect REPL to UART
os.dupterm(repl,0)
# unconnect REPL from USB
os.dupterm(None, 1)
# use usb as a virtual serial port
usb = pyb.USB_VCP()
From the main logic side we should implement a class for communication that can be unidirectional and user-driven (qrscanner, user activates it from the GUI) or bidirectional and interactive (usb, host can ask for data / verification)
QR codes are nice but there are some cases when we want to connect hardware wallet to the computer:
For all this we need USB connectivity.
At the moment USB is used for MicroPython's REPL (that should be disabled in production). For development we can bind REPL to UART3 and use USB for communication.
Small snippet that implements this:
From the main logic side we should implement a class for communication that can be unidirectional and user-driven (
qrscanner
, user activates it from the GUI) or bidirectional and interactive (usb
, host can ask for data / verification)