cryptoadvance / specter-diy

DIY airgapped hardware wallet that uses QR codes for communication with the host
MIT License
441 stars 73 forks source link

Allow to add user entropy when generating new seed #46

Closed stepansnigirev closed 3 years ago

stepansnigirev commented 4 years ago

Maybe add a button "Add more entropy", when you click on it wallet asks to draw something on the screen. When you draw on the screen, the wallet takes coordinates of your finger and hashes them together with initial entropy. At the end your entropy is always better.

Here is a small snippet that can be in the callback of the screen where we draw:

def cb(obj, event):
    if event == lv.EVENT.PRESSING:
        point = lv.point_t()
        indev = lv.indev_get_act()
        lv.indev_get_point(indev, point)
        # now we can take bytes([point.x % 256, point.y % 256])
        # and feed it into hash digest
stepansnigirev commented 4 years ago

I think there is no need for explicit action from the user. https://github.com/cryptoadvance/specter-diy/commit/834ac0e6733e260e3c11184697a2d14596433020 implements rng updates from touch events.

The only possible use-case would be adding user-provided randomness verifiably i.e.:

  1. The wallet generates mnemonic and shows it as words and word indexes
  2. The user throws dices or somehow differently getting random 11-bit numbers (0..2048)
  3. The user enters a number - a new word index is old word index + user number mod 2048
  4. It is a fully verifiable scheme so you don't need to audit or trust firmware - you know for sure that your entropy was included after the wallet suggested its entropy.
stepansnigirev commented 3 years ago

Closed with https://github.com/cryptoadvance/specter-diy/pull/90