trezor / python-trezor

:snake: Don't use this repo, use the new monorepo instead:
https://github.com/trezor/trezor-firmware
GNU Lesser General Public License v3.0
201 stars 194 forks source link

Dash: Support spending DIP2 special transaction inputs #351

Closed codablock closed 5 years ago

codablock commented 5 years ago

This implements support for spending of TX outputs which are part of a DIP2 special transaction, especially DIP4 coinbases.

This is for Dash only and thus required the addition of is_dash in tx_api.py.

Support on the firmware side is not required for this to work as it reuses the logic from Zcash's extra_data and extra_data_len fields.

This is currently not easily testable as it requires a version of insight-api that supports pass through of DIP2 payloads, which is not deployed on our testnet insight instance yet. I'll leave a comment here when this is done.

codablock commented 5 years ago

Don't know where to ask best, so I'm asking here. Can someone help me figuring out where to start with integrating the same changes to wallet.trezor.io? I already found the https://github.com/trezor/trezor-wallet repo, but this seems to not be the same wallet that is running on wallet.trezor.io and also seems to have no Dash support yet (selecting Dash just reloads the page and does nothing more). @prusnak maybe?

prusnak commented 5 years ago

@codablock the source of the wallet running on wallet.trezor.io is not public, only the upcoming version has public source

codablock commented 5 years ago

@prusnak Thanks for the info. So I assume I can't really help on source level. Anything else I can do to help, e.g. creating an issue somewhere?

prusnak commented 5 years ago

@codablock You can help by adding this functionality to https://github.com/BitGo/bitgo-utxo-lib/ library

codablock commented 5 years ago

Handled requested changes and force-pushed new version.

codablock commented 5 years ago

@matejcik I think I handled all the review comments now. Also added device tests and 2 more unit tests (for pre-DIP2 TXs). Also added a fix for a KeyError when accessing data["type"] which might happen for pre-DIP2 TXs.

matejcik commented 5 years ago

looking good, thanks