Git Product home page Git Product logo

blind-signer's Introduction

Blind signer

The USB armory can function as a secure blind signer for deep cold, high value bitcoin transactions.

Single sig signing scenario

  • A password-protected seed (BIP39) is stored on a microSD card labelled S, in a secure location. The encrypting password is not present at the location.
  • The password is stored on a separate microSD card labelled P.
  • The owner uses electrum or some other wallet to generate a transaction with a watch-only wallet and saves it to a microSD card labelled T.
  • The owner goes to the secure location, bringing:
    • the USB armory, powered by a powerbank
    • The microSDs P and T
  • At the secure location, the owner plugs the USB armory into the powerbank; it starts booting (blinking white LED); and owner waits for it to become ready (solid white LED)
  • The owner inserts the S card; when the seed is copied to RAM the blue LED turns on
  • The owner takes out the S card (blue LED turns off), and inserts the P card; when the password is copied into RAM the blue LED turns on
  • The owner takes out the P card (blue LED turns off), and inserts the T card;
  • The device decrypts the seed with the password, derives the necessary private keys for the transaction and signs the transaction
  • The device saves the signed transaction to T
  • The device clears all sensitive info from memory
  • The blue LED turns solid and the white LED starts blinking, indicating final success
  • Owner removes T and disconnects the USB armory from the powerbank
  • Back home, Owner loads the signed transaction from T and broadcasts
  • If any run-time error occurs, the armory stops executing the protocol, and the blue LED starts blinking

Building

Build the TamaGo compiler (or use the latest binary release):

wget https://github.com/usbarmory/tamago-go/archive/refs/tags/latest.zip
unzip latest.zip
cd tamago-go-latest/src && ./all.bash
cd ../bin && export TAMAGO=`pwd`/go

Build the application executables as follows:

cd burner
make imx TARGET=usbarmory
cd signer
make imx TARGET=usbarmory

Flashing

We can run the apps trough serial download protocol on an armory connected to the host, and also flash them on either an external microSD card, connected to the host with a built-in or externally connected card reader, or the internal eMMC. You can find instrunctions for both these options here

Running

Burner

To run the burner app, you first need to configure the network:

On Linux:

ip link set usb0 up
ip addr add 10.0.0.2/24 dev usb0
iptables -t nat -A POSTROUTING -s 10.0.0.1/32 -o wlan0 -j MASQUERADE

The interface names usb0 and wlan0 should be adjusted to reflect your configuration.

For more info, or other OS support, check the wiki.

After succesfully configure the network, you can ssh into it:

The SSH server exposes a console with the following commands:

exit, quit                                            # close session
help                                                  # this help
info                                                  # device information
led             (white|blue) (on|off)                 # LED control
read            (mnemonic|password|psbt|tx)           # read from SD Card
reboot                                                # reset device
write           (mnemonic|password|psbt) (.+)         # write to SD Card

Signer

To run the signer, you just need to plug the armory to a power source.

TO-DO

Multi-sig

The software should support multi-sig operations as well, in case the owner requires multiple secure locations.

See Bitcoin Secure Multisig Setup (BSMS).

Overwriting sensitive data

In order to try and guard against cold boot attacks and data remanence, we can attempt to overwrite sensitive RAM areas, like private key storage. The private key type in btcd seems to be based on this library, which allows zeroing of the key:

https://github.com/decred/dcrd/blob/master/dcrec/secp256k1/privkey.go#L76

We could attempt to do even more, setting it to a series of zebra stripes (1010, 0101). We check what other libraries like Sodium do. From a quick check, Sodium just overwrites with zeros, so let's start with that.

Additional security

  • The USB armory could be fused to only accept transactions signed by a public key

blind-signer's People

Contributors

rafaeltaranto avatar

Watchers

Josh Harvey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.