DIY Bitcoin Hardware Wallet (powered by uBitcoin)
Flash here https://lnbits.github.io/hardware-wallet
For use with LNbits Legend OnchainWallet extension, but can other wallet applications can easily be built
Join us t.me/lnbits, t.me/makerbits
This very cheap off the shelf hardware wallet is designed to work with Lilygos Tdisplay, but you can easily make work with any ESP32.
Data is sent to/from the Hardware Wallet over webdev Serial, not the most secure data transmission method, but fine for handling small-medium sized amounts of funds. You can use LNbits OnchainWallet extension, or any other serial monitor.
- Flash the hardware-wallet firmware directly from the browser using the installer
- Buy a Lilygo Tdisplay (although with a little tinkering any ESP32 will do)
- Install Arduino IDE 1.8.19
- Install ESP32 boards, using boards manager
- Download this repo
- Copy these libraries into your Arduino install "libraries" folder
- Open this wallet.ino file in the Arduino IDE
- Select "TTGO-LoRa32-OLED-V1" from tools>board
- Upload to device
The client (OnchainWallet extension or anyother one) communicates with the device using strings (called commands) of this form:
/command-name {param1} {param2} ... {paramn}
- the order of the parametes is relevant (the position gives its meaning)
- if no the value is specified then the minus (
-
) character should be used at the respective position - eg:
/password my-password-1
The device (HWW) can respond (not mandatory) with a string of the same form:
/command-name {resp1} {resp2} ... {respn}
The documentation for each command can be found in the linked .ino
file
/ping
720_ping.ino/pair
712_cmd_pair.ino/check_pairing
721_check_pairing.ino/password
713_cmd_password_check.ino/password-clear
714_cmd_password_clear.ino/restore
717_cmd_restore.ino/wipe
716_cmd_wipe_hww.ino/psbt
718_cmd_sign_psbt/seed
719_show_seed/xpub
715_cmd_xpub.ino/address
722_show_address/help
711_cmd_help
Note: the device is not fully airgapped when other communication mediums are enabled (wifi, bluetooth, serial-port, etc).
In order to run from an SD Card one must:
- mount the SD Card into a computer
- create a file named
commands.in.txt
on the top level directory (no parent directory) of the SD Card - add the commands to the file. See sample files in examples/sd-card
- mount the SD Card into the hardware device
- reboot the device. On reboot the device will detect the
commands.in.txt
on the SD Card and will start executing the commands - wait for the device to complete execution
- mount the SD Card into the computer. Two new files should be present:
commands.out.txt
- contains the outputs of the commands. Here you will find the relevant data (like the signed PSBT)commands.log.txt
- contains the logs
// Guide to go here
Note: If using MacOS, you will need the CP210x USB to UART Bridge VCP Drivers available here https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers If you are using MacOS Big Sur or an Mac with M1 chip, you might encounter the issue
A fatal error occurred: Failed to write to target RAM (result was 0107)
, this is related to the chipsest used by TTGO, you can find the correct driver and more info in this GitHub issue