uwu

hardware bitcoin wallet software and build system
git clone https://git.parazyd.org/uwu
Log | Files | Refs | README | LICENSE

README.md (4449B)


      1 uwu
      2 ===
      3 
      4 uwu is a build system and the software for the uwu Bitcoin hardware
      5 wallet.
      6 
      7 ![uwu](res/uwu.png)
      8 
      9 You can donate BTC to support uwu development:
     10 [1Ai71EmjbVBu1QjwKeVEWSG2S1np6VtGEb](bitcoin:1Ai71EmjbVBu1QjwKeVEWSG2S1np6VtGEb)
     11 
     12 Talk about uwu on **irc.oftc.net/#uwu**
     13 
     14 
     15 Table of Contents
     16 =================
     17 
     18    * [uwu](#uwu)
     19       * [Concept](#concept)
     20       * [Building uwu](#building-uwu)
     21          * [Environment setup](#environment-setup)
     22          * [Compiling](#compiling)
     23       * [Hardware](#hardware)
     24          * [Preparation](#preparation)
     25       * [Using uwu](#using-uwu)
     26       * [License and copyright](#license-and-copyright)
     27 
     28 
     29 Concept
     30 -------
     31 
     32 uwu is designed as a Bitcoin hardware wallet for people who are
     33 comfortable with the command line. There are no methods to handhold
     34 you with lousy apps and interfaces, instead, everything is available
     35 to the user and you can utilize the full power of the command line
     36 to work with your wallet.
     37 
     38 Conceptually, uwu is supposed to run securely on a Raspberry Pi
     39 Zero and provide a serial console by utilizing Linux's USB gadget
     40 subsystem. Upon connecting your uwu device to your computer (or maybe
     41 another device like a mobile phone), uwu will appear as a serial
     42 console you can connect to and issue commands.
     43 
     44 uwu's kernel is a minimal build of mainline Linux, with no loadable
     45 module support. Everything that is necessary is compiled in, so
     46 there's no filesystem latency to load modules.
     47 
     48 In the userspace, uwu's backend is
     49 [Electrum](https://github.com/spesmilo/electrum). It runs as a daemon
     50 in offline mode and the user can interface with it by using the serial
     51 console. This means a single uwu device can have as many wallets and
     52 as many users(!) as you want.
     53 
     54 As further development happens, this concept will evolve, and this
     55 document will contain practical usage examples of uwu. Stay tuned!
     56 
     57 
     58 Building uwu
     59 ------------
     60 
     61 This build system's goal is to create a cpio archive that can be
     62 extracted on a microSD card to be used on the Raspberry Pi Zero.
     63 The following sections will explain how to set up the build environment
     64 and will show the necessary configurations.
     65 
     66 ### Environment setup
     67 
     68 First, clone this repository
     69 
     70 ```
     71 $ git clone https://github.com/parazyd/uwu
     72 ```
     73 
     74 After we have it, we can start configuring things. The entire
     75 configuration is done in `config.mk`. We simply need to insert a valid
     76 path to a static `qemu-arm` binary that can be used in the ARM chroot,
     77 and a valid (cross)compiler prefix. The Raspberry Pi Zero needs an
     78 `armv6` architecture compiler. The rest of the variables will be
     79 updated as new software versions are released.
     80 
     81 Further on, we need to setup `binfmt_misc`. Your system's kernel
     82 config should contain `CONFIG_BINFMT_MISC=m` or `CONFIG_BINFMT_MISC=y`.
     83 
     84 On Gentoo/OpenRC:
     85 
     86 ```
     87 # /etc/init.d/qemu-binfmt start
     88 ```
     89 
     90 On Devuan/Debian it should be automagic.
     91 
     92 If all went well, we're done with our build environment and we can
     93 start compiling uwu!
     94 
     95 
     96 ### Compiling
     97 
     98 To compile uwu and get the resulting cpio archive, we can issue
     99 
    100 ```
    101 $ make -j$(nproc)
    102 $ sudo make -j$(nproc) image
    103 ```
    104 
    105 This process can take 20 minutes of crunching, depending on your
    106 hardware. When this is issued, the build system will start downloading
    107 the necessary source code and binaries. It will be compiling the Linux
    108 kernel, and setting up and configuring an Alpine Linux chroot. Once
    109 done, the chroot will be packed and compressed into a cpio archive
    110 which can then be extracted on a microSD card we can use with our
    111 Raspberry Pi Zero.
    112 
    113 
    114 Hardware
    115 --------
    116 
    117 * [Raspberry Pi Zero](https://www.raspberrypi.org/products/raspberry-pi-zero/)
    118 * Class 10 microSD card (128M or more)
    119 * Micro USB cable
    120 
    121 
    122 ### Preparation
    123 
    124 After you've built the image, you should copy it to your microSD card.
    125 Create a VFAT partition on your microSD card and format it:
    126 
    127 ```
    128 # parted /dev/mmcblk0 --script -- mklabel msdos 
    129 # parted /dev/mmcblk0 --script -- mkpart primary fat32 2048s 100%
    130 # mkfs.vfat /dev/mmcblk0p1
    131 ```
    132 
    133 Mount it and extract the cpio archive:
    134 
    135 ```
    136 # mkdir mnt
    137 # mount /dev/mmcblk0p1 mnt
    138 # cd mnt && cpio -i < ../uwu-*.cpio && cd ..
    139 # umount mnt
    140 ```
    141 
    142 With this, you've successfully installed uwu and you're ready to boot.
    143 
    144 
    145 Using uwu
    146 ---------
    147 
    148 TODO
    149 
    150 
    151 License and copyright
    152 ---------------------
    153 
    154 * uwu and its components are licensed with
    155   [GPL-3](https://www.gnu.org/licenses/gpl-3.0.txt).
    156 * Raspberry Pi firmware is licensed from Broadcom Corporation and
    157   Raspberry Pi Ltd.