trezor / trezor-common

:lock: Don't post issues/PRs to here, use the new monorepo:
https://github.com/trezor/trezor-firmware
GNU Lesser General Public License v3.0
91 stars 232 forks source link

ICX (ICON) Support #275

Closed Spl3en closed 5 years ago

Spl3en commented 5 years ago

Hello,

According to the Developer guide in the Contributing section, I'm posting this issue in order to discuss creating ICX support for Trezor. Many people holding ICX are requesting it regularly (for many months now).

Similar scale than the already supported ones.

ICON uses secp256k1 and SHA3, very similarly to Ethereum. So it should be supported easily by Trezor.

There is no frontend wallet that supports Trezor right now. However, we have an official wallet (ICONex) supporting Ledger already. So, once the Trezor support is done, I suppose it can be added too, potentially.

Let me know what you think about it, so we can start working on it, thank you.

matejcik commented 5 years ago

does ICON need a completely new impl, or is it a fork of some already implemented currency (so that we could, e.g., extend Ethereum code with some parameter tweak to also sign ICON transactions)?

do you have developer docs regarding signature formats etc.?

Spl3en commented 5 years ago

Thanks for the answer @matejcik. ICON is a completely new implementation. So it will require to code something new, however the cryptography is similar to Ethereum.

Here's a documentation about how to sign an ICON transaction : https://icondev.readme.io/docs/transaction-signature#section-create-transaction-signature

ICON priv/pub keys generation from libsecp256k1 (python binding) : https://github.com/icon-project/icon-sdk-python/blob/master/iconsdk/wallet/wallet.py#L63

ICON public address : "hx" + 20_last_bytes (SHA3_256 (pubkey)) https://github.com/icon-project/icon-sdk-python/blob/master/iconsdk/wallet/wallet.py#L164

matejcik commented 5 years ago

thanks for the links. we will look into it and let you know.

Spl3en commented 5 years ago

Thanks, much appreciated.

Spl3en commented 5 years ago

Hey, Is there any update about it ? @matejcik Thanks!

prusnak commented 5 years ago

Yes, you can start working on the integration. Start with adding messages to protob folder in this repo. Afterwards you can work on the code submitted to trezor-core.

Spl3en commented 5 years ago

@prusnak @matejcik Thanks! Last question before I start coding it, can you confirm there is no difference in the protocol if I buy a Trezor One or a Trezor T model ? I need to buy a Trezor for testing but I don't know which one.

prusnak commented 5 years ago

@Spl3en trezor-core run on Trezor Model T. This will be later ported to Trezor One as well, but for now you need Model T. trezor-core also has an emulator, check the repo for more instructions.

tomazcz commented 5 years ago

@prusnak Is this still valid - would merge code for support of ICX?

Asking because of this:

at this time we do not plan to add coins that are not in the Top 30 by market cap.

matejcik commented 5 years ago

yes, the Top 30 limit still applies