Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libsecp256k1 library found but it was built without required module (--enable-module-recovery) #6465

Open
kenneth opened this issue Aug 3, 2020 · 5 comments

Comments

@kenneth
Copy link

kenneth commented Aug 3, 2020

 ./run_electrum
E | ecc_fast | failed to load libsecp256k1: LibModuleMissing('libsecp256k1 library found but it was built without required module (--enable-module-recovery)')
Error: Failed to load libsecp256k1.
@kenneth kenneth closed this as completed Aug 3, 2020
@MsFloofie
Copy link

Why did you close this without saying the fix?

@SomberNight
Copy link
Member

Ok, so apparently this happens on debian 10, but not on e.g. ubuntu 20.04.
I will have to look into this more, but I suppose the idea is that the libsecp256k1-0 package in debian 10 apt does not have the recovery module.

Workarounds for users, in order of increasing complexity:

  1. use AppImage instead, or
  2. if you run from git clone OR from tar.gz but WITHOUT installing with pip, then:
    $ contrib/make_libsecp256k1.sh
    
  3. if you pip install electrum; example for version 4.0.3:
    $ tar -xzvf Electrum-4.0.3.tar.gz
    $ ./Electrum-4.0.3/contrib/make_libsecp256k1.sh
    $ python3 -m pip show electrum
    [...]
    Location: /home/user/.local/lib/python3.8/site-packages
    [...]
    
    ^ look at "Location" line, and copy libsecp256k1.so.0 into electrum folder at Location, e.g.:
    $ cp Electrum-4.0.3/electrum/libsecp256k1.so.0 /home/user/.local/lib/python3.8/site-packages/electrum
    

@SomberNight SomberNight added this to the backlog milestone Sep 12, 2020
@nickfarrow
Copy link

For anyone else having this issue, when compiling with
./Electrum-4.0.3/contrib/make_libsecp256k1.sh
It spits out a library path like
/home/nick/install/electrum-4.0.5/contrib/secp256k1/dist/lib
Running as LD_LIBRARY_PATH=/home/nick/install/electrum-4.0.5/contrib/secp256k1/dist/lib electrum works for me.

@ZenulAbidin
Copy link
Contributor

ZenulAbidin commented May 16, 2023

For anyone else having this issue, when compiling with ./Electrum-4.0.3/contrib/make_libsecp256k1.sh It spits out a library path like /home/nick/install/electrum-4.0.5/contrib/secp256k1/dist/lib Running as LD_LIBRARY_PATH=/home/nick/install/electrum-4.0.5/contrib/secp256k1/dist/lib electrum works for me.

@nickfarrow You can just add the path to /etc/ld.so.conf:

/home/nick/install/electrum-4.0.5/contrib/secp256k1/dist/lib

Run sudo ldconfig to update the system library paths, and make sure you don't remove the Electrum folder by accident.


@SomberNight What do you think about phasing out the module-recovery code in the long run?

@SomberNight
Copy link
Member

What do you think about phasing out the module-recovery code in the long run?

Why? libsecp256k1 is a good library. The "recovery" module is optional in it, unfortunately, yes; but is that the sole reason you would want not to require it? Then we would need an alternative or at least a fallback implementation. In the past we used python-ecdsa for this. I would like to minimise crypto code we need to maintain. And libsecp256k1 is probably much more tested and more widely used.

Also, for taproot support we will need another optional module from libsecp256k1 ("schnorrsig"), and there is no alternative for that.

I think people running from source will just have to make sure to get libsecp with the needed extra modules included.
In particular the distro packagers for libsecp256k1 should make the optional modules available either as part of the main package or as additional packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants