trezor / trezor-utxo-lib

UTXO coins functions implemented in pure JavaScript
MIT License
8 stars 11 forks source link

Support Decred #8

Open vctt94 opened 4 years ago

vctt94 commented 4 years ago

decred is supported by trezor-firmware, but it is not supported for trezor-connect right now.

We used trezor.js for our connection, but with that being deprecated, now we need to support decred at trezor-connect, so we can still supporting trezor.

szymonlesisz commented 4 years ago

Decred cannot be fully supported since its not compatible with bitcoinjs, or to be precise trezor fork of bitcoinjs lib. signTransaction method is affected since it does validate output addresses and signed transaction using mentioned @trezor-utxo-lib

vctt94 commented 4 years ago

Thanks for letting me know. So should I move this issue there?

szymonlesisz commented 4 years ago

yes, trezor-utxo-lib is the place to start, but since i'm also the maintainer of it i can tell you that right now i don't have a time to implement this. sorry :/

However any contribution is welcome i can put you thru the process, what needs to be done or changed

szymonlesisz commented 4 years ago

briefly: Address validation fromBase58Check needs to be be hashed (twice?) using blake

There is already blake2b dependency in this project and could be used to do that here

Also probably Transaction.fromBuffer and Transaction.toBuffer will also require some some modifications (i didn't test it)

vctt94 commented 4 years ago

Thanks for the start.

Yeah, our checksum is hashed twice: https://github.com/decred/base58/blob/master/base58check.go#L23

I'll look into the code and any questions I have I ask here. Thanks for your time.

vctt94 commented 4 years ago

Hey @szymonlesisz , when possible, plz review #9

JoeGruffins commented 3 years ago

@szymonlesisz @prusnak Should I continue working on this? We are rolling our own for the time being, but would sure like to get decred into master. I will wait for comment before pushing any more changes here.