davestgermain / aionostr

asyncio nostr client for python
Other
19 stars 10 forks source link

use ctypes instead of python bindings #4

Open ecdsa opened 5 months ago

ecdsa commented 5 months ago

Hello, I am the creator of Electrum. We noticed that you recently decided to use coincurve instead of secp256k1, so this project seems to be alive :-)

We would like to use nostr in Electrum, in order to let users advertise services. aionostr looks like a good candidate. I currently use it in this branch: https://github.com/spesmilo/electrum/tree/swaps_over_nostr

One issue is that aionostr currently pulls too many dependencies (coincurve, cffi, asn1crypto, pycparser). We do not like to add dependencies because of potential security issues.

In order to avoid this, Electrum uses libsecp256k1 without python bindings. Instead, we use ctypes, which is part of the python standard library:

Would you be willing to replace coincurve with ctypes in aionostr? We could try to create a standalone package from our ecc.py and ecc_fast.py modules, to be used by your project. One caveat is that this package would need to build and install libsecp256k1, if you do not want users to install it themselves.

ecdsa commented 1 month ago

Here is a pure python packages that allows to use libsecp256k1: https://github.com/spesmilo/electrum-ecc

And here is a fork of aionostr that uses electrum-ecc in place of coincurve: https://github.com/spesmilo/aionostr/tree/electrum