Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: misterbigg on June 14, 2015, 01:32:12 PM



Title: secp256k1 not LGPLed unless GMP option is turned on
Post by: misterbigg on June 14, 2015, 01:32:12 PM
I'm trying to build that great secp25k1 library (https://github.com/bitcoin/secp256k1) but it needs USE_NUM_GMP defined, and it has to link to GNU Multiprecision Library which is GPLv2? What's going on here?


Title: Re: Bitcoin GPLed because of GMP?
Post by: Peter Todd on June 14, 2015, 02:03:59 PM
https://gmplib.org/

"Since version 6, GMP is distributed under the dual licenses, GNU LGPL v3 and GNU GPL v2. These licenses make the library free to use, share, and improve, and allow you to pass on the result."

What version of GMP does it need?


Title: Re: Bitcoin GPLed because of GMP?
Post by: misterbigg on June 14, 2015, 02:21:53 PM
Ah, I see. So Bitcoin links to GMP but doesn't include the sources? I'm not sure how I would make that work for my project. I was hoping that the secpk2561 library was self contained.

Realistically, would it be possible for me to provide the missing bignum routines using a boost::multiprecision implementation?


Title: Re: Bitcoin GPLed because of GMP?
Post by: gmaxwell on June 14, 2015, 05:43:52 PM
I'm trying to build that great secp25k1 library (https://github.com/bitcoin/secp256k1) but it needs USE_NUM_GMP defined, and it has to link to GNU Multiprecision Library which is GPLv2? What's going on here?
secp256k1 is self contained. GMP is optional. Releases of Bitcoin Core do not currently use GMP.

Libsecp256k1 is still unreleased experimental software. Our use of it in Bitcoin core is intentionally very narrow (only for signing, always checked against OpenSSL). I would not advise using it in a production consensus system currently. If you're interested in using it-- you could help support its maturation to full release by supporting review of the software.


Title: Re: Bitcoin GPLed because of GMP?
Post by: misterbigg on June 14, 2015, 06:31:03 PM
Oh! Well that's great news. I will study the sources more closely, I got a compile error from failing to define USE_NUM_GMP. I guess I should have tried defining USE_NUM_NONE. Will try again. Thanks for the heads up about the state of the code. We're already using OpenSSL so I think we can add a code path that does signature checking and signature generation using this secp256k1 library along side SSL for non-production builds, to compare the results. And we can likely review the code.