icon-project / icon-sdk-python

ICON SDK for Python
45 stars 45 forks source link

Use coincurve instead of secp256k1 ? #29

Closed Spl3en closed 5 years ago

Spl3en commented 5 years ago

secp256k1 library is sadly difficult to compile on Windows, including the secp256k1 Python package. However, coincurve (https://github.com/ofek/coincurve) offers a crossplatform support and works similarly to secp256k1.

Wouldn't it be interesting to migrate the secp256k1 package to coincurve in order to support the ICON SDK Python on Windows natively ?

ofek commented 5 years ago

Great idea!

boyeon555 commented 5 years ago

Hi, Spl3en. We have closely examined your proposal.
But unfortunately, it is difficult to support it right now because we have to change a lot of sources.

Coincurve works similarly to secp256k1 but it is not supporting for some method from secp256k1 we are using. For example, loading key store file and converting to Private key object with user password is not supported. In addition, we are worried to source compatibility with other icon-projects using secp256k1. Thank you, Spl3en :)

Spl3en commented 5 years ago

Thanks for the answer !

Ah, I see. coincurve sounded like an easy way to replace secp256k1-py, but that's not so easy as I imagined. Oh well, I hope secp256k1 will eventually becomes easier to compile on Windows one day or another.

Cheers

ofek commented 5 years ago

@boyeon555 Hello there! Could you please tell me what exactly https://github.com/ludbb/secp256k1-py supports that https://github.com/ofek/coincurve doesn't? Every project on https://github.com/ofek/coincurve/blob/master/DOWNSTREAM.rst has switched and I've never heard a complaint about feature parity before.

When you say

For example, loading key store file and converting to Private key object with user password is not supported

what do you mean? The library you use now also doesn't support that, so I'm quite confused.

@Spl3en Would you mind re-opening this for a bit?

boyeon555 commented 5 years ago

@ofek Hello! In terms of the example I mentioned, I am sorry that I was confused the other library eth_keyfile. We are examining it more. I appreciate you checking it correctly.

And thank @Spl3en for good suggestion.

sink772 commented 5 years ago

@Spl3en I'm curious about your development environment on Windows. Are you using WSL? If so, AFAIK, you may install iconsdk without any trouble. Otherwise, are you using Cygwin? Anyway, the information about the target environment on Windows is crucial for us to review the feasibility of the migration.

ofek commented 5 years ago

I assume they mean Windows itself, no wsl/cygwin/mingw/etc.

Spl3en commented 5 years ago

@sink772 Yes indeed, I am using WSL as a workaround for using iconsdk on Windows in the meantime. Unfortunately, WSL is slow regarding network calls : https://github.com/Microsoft/WSL/issues/2477

For a library such as iconsdk that makes a lot of network calls, it makes the development quite painful on Windows, even if it is usable. I believe a native support is much more desirable than an emulated one.

Kradenx commented 5 years ago

So is this module the reason why I cannot build iconsdk on Windows? This seems to be copied from ethereum/bitcoin code too...

Spl3en commented 5 years ago

@Kradenx Yes, this module is hard to compile on Windows. It's definitely possible, but it's quite hard to configure pip in order to get the right build environment.

ofek commented 5 years ago

Any progress?

Spl3en commented 5 years ago

Any progress?

Unfortunately, no progress so far.

eunsoo-icon commented 5 years ago

Applied in #48