davestgermain / aionostr

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

use ctypes instead of python bindings #4

Open ecdsa opened 3 weeks ago

ecdsa commented 3 weeks 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 week ago

This is still a draft, but here is a fork that uses our pure-python ecc submodule: https://github.com/ecdsa/aionostr/tree/electrum_ecc_submodule