Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardware wallet support #385

Closed
cmihai opened this issue Dec 17, 2018 · 4 comments
Closed

Hardware wallet support #385

cmihai opened this issue Dec 17, 2018 · 4 comments
Assignees
Labels
feature New functionality wallet
Milestone

Comments

@cmihai
Copy link
Member

cmihai commented Dec 17, 2018

Is your feature request related to a problem? Please describe
Hardware wallets are portable, hardened computing devices which allow storing a wallet's private keys in a secure way, as well as performing cryptographic operations on those keys. Examples of hardware wallets are Ledger Nano S, Ledger Blue and Trezor. For added security, Unit-e should allow storing private keys in a hardware wallet. As a first step, we want to add support for Ledger Nano S.

Describe the solution you'd like
A Ledger-enabled application consists of two communicating processes. One of them is an embedded application, deployed on the hardware wallet. The other is deployed on the user's computer, communicates with the Bitcoin network, and delegates the cryptography to the first process. In our case, we'll need to implement the embedded application, and extend the united daemon to communicate with it.

It makes sense to build the embedded application based on the existing Ledger Bitcoin application. The operations that we need to implement in the daemon are:

  • Generating new Unit-e addresses and associated private keys

New private keys can be derived from the device's master private key by BIP0032 derivation. We can record the fact that the key is stored in the hardware wallet, together with its chain path, in our wallet database.

The changes in the desktop GUI should be minimal: allow the user to indicate that a new public key should be generated in hardware, e.g. by ticking a checkbox. This will require adding a new boolean parameter to the getnewaddress RPC call "is_hardware" (default: false).

  • Signing Unit-e transaction using a given private key (or rather, the private key chain path)

If we reuse the implementation from the Ledger BTC app, which follows the API in the Ledger Technical Specification, we can use the "transaction hash start"/"hash sign" commands to parse and sign a transaction, as implemented for example in the Particl Bitcoin wallet.

We might have to adapt the transaction parsing logic from the Ledger BTC app to the new types of Unit-e transactions, though.

Additional context

The Ledger embedded programming documentation is stored at https://ledger.readthedocs.io/ . The sample embedded applications can be found at https://github.com/LedgerHQ/blue-sample-apps .

@cmihai cmihai added the feature New functionality label Dec 17, 2018
@cmihai
Copy link
Member Author

cmihai commented Dec 17, 2018

@Nizametdinov Could you please take a look and see if I missed anything?

@cmihai cmihai changed the title Add hardware wallet support Hardware wallet support Dec 17, 2018
@Nizametdinov
Copy link
Member

You can also check out this commit which adds particl support to blue-app-btc.

@mergeable
Copy link

mergeable bot commented Jan 16, 2019

There has not been any activity in the past month. Is there anything to follow-up?

@cmihai
Copy link
Member Author

cmihai commented Jan 16, 2019

Work is in progress, starting with PR #443.

@thothd thothd added this to the 0.1 milestone Jan 18, 2019
@thothd thothd added the wallet label Jan 22, 2019
@cmihai cmihai closed this as completed Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality wallet
Projects
None yet
Development

No branches or pull requests

3 participants