Code Monkey home page Code Monkey logo

lnhw's Introduction

lnhw

Chainlab 2018 hackathon project for a LN hardware wallet.

See the slides we presented for an overview of the concept and our prototype.

lnhw team

Current status

Chainhack 2018 logo

This is a early prototype demonstrating how a LN hardware wallet might be constructed. We hope to continue developing the project into a toolkit to make it easier for anyone to build their own hardware wallet. We would not recommend anyone try to build a wallet or run the UI based on the current code, especially for real funds. Watch this space for updates.

Related projects

  • Bitcoin Core: the most widely used Bitcoin client that is compatible with the consensus rule of the network
  • c-lightning: the BOLT-compliant lightning network implementation by Blockstream. We have a fork at hkjn/lightning with some patches to make it possible to run a lightningd daemon on a laptop, but using a hardware wallet for any operation that could spend the user's funds
  • arduino-bitcoin: A project started by @stepansnigirev to provide an Arduino library for Bitcoin primitives
  • arduino-lightning: Another @stepansnigirev project which provides an Arduino library for working with the Lightning Network

Architecture

Since we had 13 team members for the hackathon, we split up into three groups based on background and interests to attempt to parallelize the work, to focus on three different conceptual layers of the prototype we built. This worked reasonably well, although in hindsight we should have taken more shortcuts and tried to integrate the work of the different groups much earlier!

The conceptual layers were:

  • ui layer: what's shown directly to the user on the laptop, as well as the logic talking to lightningd
  • client layer: patched c-lightning, running on linux desktop (possibly mobile later)
  • hardware layer: code running on Arduino devices to provide a reasonably secure wallet

The prototype we pitched and demoed used a Linux / MacOS laptop with bitcoind and our patched lightningd running, as well as a Python web backend to communicate with lightningd, and to serve requests from the React frontend code.

client notes

We have a fork of c-lightning at hkjn/lightning, where we added patches to allow the private key material to stay on the hardware wallet and not be exposed to the client device (Linux laptop). At least that was the ideal, which turned out not to be fully feasible within the roughly two days for the Hackathon..

There's some notes by @stepansnigirev at doc/hsmd/readme.md that outlines the structure of c-lightning.

hardware notes

We used Adafruit Feather M0 with SD card slot and an OLED FeatherWing. SD card can be used for encrypted data storage and OLED extension board has 3 buttons for user interaction.

Currently we are refactoring code of the hardware part, status and architecture description can be found in the arduino folder. There you can also find a list of compatible boards. In general it should work on any 32-bit MCU (for example, based on ARM Cortex M0 and further).

Yes, we know that Arduino is not secure at all, and one should never use these boards for real funds, but we also plan to develop a security-oriented Arduino-compatible board such that anyone could use them with any crazy extension boards to make their own lightning- and bitcoin-powered device. Stay tuned!

lnhw's People

Contributors

akhilesharora avatar gustavorssilva avatar hkjn avatar ifo0 avatar justinmoon avatar michaelfolkson avatar stepansnigirev avatar stephaniestroka avatar svanstaa avatar thecharlatan avatar

Watchers

 avatar  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.