2

I'm not sure if this question is better suited in the context of Autotools, but since it's about Bitcoin Core, I'll try to ask it here.
I am trying to Compile/Link libsecp256k1 as a shared library with Bitcoin Core.

configure.ac is calling configure of libsecp256k1 but just removing "-disable-shared" isn't engough https://github.com/bitcoin/bitcoin/blob/7ff64311bee570874c4f0dfa18f518552188df08/configure.ac#L1637

And here it looks like it is static compiling. https://github.com/bitcoin/bitcoin/blob/7ff64311bee570874c4f0dfa18f518552188df08/src/Makefile.am#L61

Could someone point out to me if this is even possible in a simple way and if so how.

Thanks a lot

6
  • 1
    Why on earth would you want to be dynamic linking a security and safety critical library?
    – Claris
    Commented Dec 11, 2020 at 1:36
  • It is not a productive system! But even if it were a productive system. Isn't it obscurity rather than security. I suspect the reason was optimization of course a LD_PRELOAD or similar would be possible. But then we are talking about a deeper system level security problem and such a system is the wrong place for your coins in the first place. But I am open to other points of view.
    – Tom
    Commented Dec 11, 2020 at 2:12
  • 1
    No, the reason why Bitcoin Core is distributed as a static binary is due to security concerns, not "security by obscurity". What we've seen in the past is that many distributions of packages tend to be providing hilariously outdated versions of core libraries like OpenSSL, which for a time was consensus critical. Two versions of Bitcoin Core that are otherwise identical could become out of sync with one another just due to minor changes within its dependent libraries.
    – Claris
    Commented Dec 11, 2020 at 2:14
  • The only reason for dynamic dependencies in software at all is for space saving, which is not a consideration today with the size of modern storage, and the fact that the several megabyte bitcoind binary will probably be downloading 300GB of data shortly after installation.
    – Claris
    Commented Dec 11, 2020 at 2:15
  • 1
    There's inbuilt benchmarking for libsecp256k1, but be aware that it's not the purpose of the library to be fast for signing or key generation. There's many functions which are made intentionally, seemingly arbitrarily slow to avoid secret dependent memory accesses and other secret leaks through timing.
    – Claris
    Commented Dec 11, 2020 at 2:31

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.