decred/decrediton

Trezor Support

matheusd opened this issue · 34 comments

Meta issue for keeping track of work needed to integrate trezor. I'll try to do some of the required work on separate PRs without directly referencing trezor so that we can start integrating in stages, instead of doing only a single very large PR at the end. Even so, it's likely that some of the PRs will be pretty big.

Still subject to a lot of change at the moment. Order of execution is not fixed.

Proof of concept stage (code)

  • Generate address
  • Sign Tx
  • Obtain trezor masterpubkey
  • Pin operations (enable/disable/enter) 5b4887b
  • Support use passphrase to encrypt trezor wallet 8c09c07
  • Sign and Verify messages 7f95884
  • Mnemonic operations (clear/recover) 42fd1ca
  • Full demo support 0eb6c4c
  • Mainnet tests

Basic decrediton integration

  • Upstream mainnet coin info to trezor firmwares
  • Detect and react to trezor events (trezor connected/disconnected)
  • Import wallet from trezor screen (wallet creation)
  • Change instances of passphrase modal to use trezor confirmation
  • Change or disable unsupported features (message signing/verification, tickets, etc)
  • Correctly support stealing the device connection for stuck devices

Advanced decrediton integration (not everything will be feasible at this moment)

  • Support signing tickets (requires ability to import scripts on watch only wallets)
  • Support multiple accounts (requires ability to import root xpub instead of account xpub)
  • Support trezor passphrase input
  • Support reset and reseed trezor directly
  • Support importing trezor native seed as decred seed (might require separate tooling done here)
  • Implement trezor-core changes to support decred in the model T firmware

Here's the updated DCR symbol generated for Trezors home screen.
Also included the complete latest updated logo and symbol package, which can be used in Trezor's various web instances where needed.

dcr - trezor - homescreens.zip

Decred - Logo Package.zip

So, Do you do that anybody can buy tickets via Trezor?

Not yet.

Ticket purchasing Proof of Concept:

Firmware changes: trezor/trezor-mcu@master...matheusd:ticket-poc
Wallet changes: decred/dcrwallet@master...matheusd:trezor-tickets-poc
Client changes: https://github.com/matheusd/trezor-decred-poc/compare/ticket-poc

Rough outline:

  • Trezor firmware needs to be updated to recognize and process decred ticket outputs
  • Trezor.js needs to accept decred_tree input metadata
  • Dcrwallet grpc needs to allow import of scripts
  • Dcrwallet grpc needs new endpoint that generates unsigned split/ticket txs (dcrwallet issue and tentative PR)
  • Decrediton needs to be updated to tie both ends

@matheusd Can you summarize what is the current state of things? This issue hasn't been updated for 4 months.

Waiting for the release of the official firmware so that we can test & merge the PRs for supporting trezor in decrediton:

decred/dcrwallet#1189
#1547

By "official firmware", I mean the model one firmware with trezor/trezor-crypto#167 applied.

You don't need to wait for the official firmware. Emulator works just fine for both T1 and T2; plus is ready instantly. Anyway, the current plan is to release the firmware update (both for T1 and T2) on 29th of October.

Thanks for the update!

Yes, I have performed all tests in the emulator (and on the physical model one I have). It's just that other developers aren't so keen on setting up the whole trezor stack to build a custom emulator/firmware to verify everything.

Since I have your attention here...

  1. The latest 1.7.0 tag in trezor-mcu does not seem to include the latest trezor-crypto (with the fix in trezor/trezor-crypto#167)
  2. Any chance we can setup a verification program in trezor for coin developers (not just decred but any and all coins)? Something like, a forum/email list/whatever with early access to the proposed firmware a week before the actual release so we can verify everything is in order and sync up any marketing efforts?
  1. the next firmware will be 1.7.1, yet to be tagged
  2. we'll think about it

Is there any ETA on ability to use tickets/staking with trezor? Seems there has been no progress for the last 8 or so months.

@starsoccer We can think about it when there is a Decred wallet working with Trezor.

Did you know Decred is now implemented in upstream Blockbook? So native Decred use with Trezor software and libraries is now possible:
https://github.com/trezor/blockbook/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aclosed+decred

@matheusd trezor folks have contacted me to get this feature enabled. Can you speak to what is needed?

Any updates on this one?

README says you can use Trezor with Decredition since version 1.4.0. There is also Exodus wallet that supports Decred on Trezor.

yeah but not to stake, it's a view only wallet so who cares

I was under impression that both are full featured wallets (with no staking support), not view only wallets.

I've been inaccurate indeed: when you try to stake it tells you it's a view only one

@gianlucalslz It's "view only" (actually watching only) from the PoV of Decrediton: you can't sign transactions without the trezor device.

You can use it for regular transactions but not for staking at the moment. If you are actually using Decrediton+trezor for regular transactions, please test out all your use cases (receiving from/sending to merchants/exchanges/other wallets/whatever else) and let us know whether everything is working as intended or if you're hitting any bumps.

Besides coding we need some feedback from actual trezor users on how Decrediton is behaving for them before enabling staking.

@matheusd I'll give this a try during the next few days, probably after the holidays though.

Any updates (estimates) on full integration of Decrediton and Trezor hardware wallets?

Would be amazing to finally have hardware wallet staking! @matheusd I've been using Trezor with Decredition for over a year now. No issues.

I don't trust any wallet other than the hardware LEDGER and TREZOR. I want staking DECRED. Why should I put my assets at risk? Make hardware support for STAKING!

I do not follow the project closely to comment on the impact of priority development from the team, but I will follow others here and reiterate how crucial it is to enable staking with hardware devices, and in my opinion this integration should be top priority of the team.

In order to drive adoption, you have to facilitate every aspect of currency usage for the adopters. For a crypto which sells itself on the topic of proof-of-stake, that means the ability to actually stake must be integrated with devices that the majority of people will use for simplicity: no one who has a hardware device will be interested to deal with Decred if that involves not using the hardware to obtain the currency's greatest benefits.

Ledger has staking support on 15 currencies, and for 4 of them you don't even need a third-party wallet to stake, you can do that directly within Ledger Live. Immediately all of these coins will be perceived by Ledger users as more interesting to deal with than Decred despite it also being supported on this device.

Staking support with hardware devices, whether Ledger of Trezor, should have been implemented ages ago (this discussion is already two years old and the developers still have not addressed it). And so long the team remains frozen in place with this issue, other more agile, nimble and consumer-oriented teams will drive adopters to their coins with actual features that make people invest in their projects.

Trezor is introducing a desktop client, might be easier to integrate with this.

Introducing Trezor Suite Public Beta

https://blog.trezor.io/introducing-trezor-suite-public-beta-7c5949aeef45?source=collection_home---4------0-----------------------

xaur commented

@manoelpqueiroz I assume you are mr9714 on Reddit since what you say closely matches this and this.

I kindly ask you to not rant on GitHub. "X must be top prio because I say so" and "X should have been done ages ago" is not helping anyone to do anything sooner.

Speaking on the subject,

Ledger has staking support on 15 currencies, and for 4 of them you don't even need a third-party wallet to stake, you can do that directly within Ledger Live

Ledger is the third party, and iirc Ledger Live is not offline and involves some requests to some servers.

Imo Ledger should be lower priority compared to Trezor because they are proprietary and closed source, have been caught on hardware/firmware vulns, lack competence to secure sensitive customer data and not leak an entire user database.

@xaur actually, I have never signed up for a Reddit account.

I do appreciate the feedback though, I did not feel like ranting, but rather laying out reasons as to why prioritising this issue would be more beneficial to the project. However, you are correct, GitHub is not supposed to be about mere discussion.

Will this ever be implemented?

xaur commented

I think this PR is waiting for decred/dcrwallet#1946

Any update on enabling DCR staking from the Trezor wallet? Hardware wallet security is the industry standard. People aren't going to put too much money in crypto that don't support hardware wallet and what's the point of holding DCR if you can't participate in staking?

xaur commented

@0JustinMiles0 tl;dr this is again blocked on firmware changes. You can subscribe to #2681 to follow Trezor+staking specifically. This issue is broader covering all Trezor stuff in Decrediton. Regular transactions should work and Trezor UX has been redesigned in v1.7.7.

Perhaps we should even close this issue since #2681 seems to be the only remaining part of "Trezor Support".

Какие-нибудь новости о включении стейкинга DCR из кошелька Trezor?

xaur commented

@AlexBur8042322 please see the previous message. No changes since May.