A minimalistic hardware wallet working with electrum transactions.
This sketch is a simple demo that shows how to use arduino-bitcoin library to build your own hardware wallet.
It should be used only for educational or testing purposes as default Arduino boards are not secure, their firmware can be updated from the computer and this process doesn't require any user interaction.
A manual on how to make it more secure will follow.
If you don't have an OLED screen you can try it out with serial only wallet.
Follow the manuals from Adafruit to set up the board and OLED screen:
Put a xprv.txt
file on the SD card with your xprv key (for testnet it will start with tprv). You can generate one here.
Communication with the wallet happens over USB. Open Serial Monitor in the Arduino IDE and type commands.
Keys are stored UNENCRYPTED AS A PLAIN TEXT on SD card.
Available commands:
xpub
- returns a master public key that you can import to electrum or any other watch-only walletaddr <n>
, for example addr 5
- returns a receiving address derived from xpub /0/n/
, also shows it on the OLED screenchangeaddr <n>
- returns a change address derived from xpub /1/n/
and shows it on the OLED screensign_tx <unsigned_tx_from_electrum>
- parses unsigned transaction, asks user for confirmation showing outputs one at a time. User can scroll to another output with button B, confirm with button A and cancel with button C. If user confirmed, wallet will sign a transaction and send it back via serial in hex format. This transaction can be broadcasted to the network from electrum console using broadcast("<signed_tx>")
command or just go to blockcypher and broadcast it there.This sketch will evolve, we would love to add: