Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
build: Add --disable-bip70 configure option #11622
Conversation
laanwj
added
Build system
GUI
Wallet
labels
Nov 6, 2017
|
Concept ACK generally, though I'm curious where you see this going longer-term - do we want to deprecate BIP 70 support (I think I'd be generally in favor of this, it seems to provide almost 0 utility which results in it being mostly unused, and even if it were used broadly, its unclear that it provides any real security benefit) or start shipping binaries without BIP 70 support or will this just be yet another build-time option we support (which I'd definitely use)? |
|
Concept ACK after reading the discussion on IRC |
|
Should add to travis matrix? |
|
For information, I plan to make BIP70 deprecated into NBitcoin. (By removing it from main lib, and moving it to separate package) This led me to too much dependency issues, as well as cross implementation issues as you can't check correctly the signature of the payment request without serializing the payment request exactly as all other implementations does. (Typically, my implementation works against all wallets, except copay for reasons...) As a library/service developer, I would love to see another simple standard, filling the same need, Json simple binary based, just using HTTPS for securing the communication between wallet and server. I remember there was discussions about making a new payment protocol long time ago, I think it was initiated by @sipa. Concept ACK |
My opinion on it is really divided. I like BIP70 in concept (automatic refund addresses, key expiration, allowing the wallet to directly authenticate vendors, direct transaction submission), but not the technical implementation, and also not the dependency burden it puts on bitcoin core. Additionally it also seems the code is not maintained. No one is working on BIP70 support in bitcoin core. So I'm ok with signalling that in the future we might be going to deprecate it, without any commitments - this would be the first step, to allow builders to disable it. (my personal motivation is that I want to have the option to build the GUI without protobuf and without OpenSSL after the last remnants of OpenSSL use are removed from the rest of the code)
Seems to be better design anyhow. Here it's been peppered all over the GUI code :( Also for lib-ifying, isolating the parts affected like this is the first step.
Agree that that's a good idea to warrant that this keeps working. |
luke-jr
reviewed
Nov 7, 2017
Concept ACK.
I suggest also indenting nested #ifs with a single space.
| @@ -1292,6 +1313,7 @@ echo " with wallet = $enable_wallet" | ||
| echo " with gui / qt = $bitcoin_enable_qt" | ||
| if test x$bitcoin_enable_qt != xno; then | ||
| echo " qt version = $bitcoin_qt_got_major_vers" | ||
| + echo " with bip70 = $enable_bip70" |
| @@ -161,6 +160,9 @@ QT_MOC_CPP = \ | ||
| qt/moc_walletmodel.cpp \ | ||
| qt/moc_walletview.cpp | ||
| +QT_MOC_CPP_BIP70 = \ |
luke-jr
Nov 7, 2017
Member
IMO would be cleaner to just QT_MOC_CPP += (and BITCOIN_QT_CPP +=) the actual files below, keeping all the stuff together.
laanwj
Nov 7, 2017
•
Owner
I agree, but I just followed the flow already used in the makefile for the wallet, to not have to move large blocks around (which complicates review). A refactor like that could be done separately.
| @@ -250,8 +252,10 @@ public Q_SLOTS: | ||
| ClientModel *clientModel; | ||
| BitcoinGUI *window; | ||
| QTimer *pollShutdownTimer; | ||
| -#ifdef ENABLE_WALLET | ||
| +#if defined(ENABLE_WALLET) && defined(ENABLE_BIP70) |
laanwj
Nov 7, 2017
Owner
I don't think I agree. Accidentally using it would not generate a compile error in that case anymore.
promag
Nov 7, 2017
•
Contributor
Can't we just allow ENABLE_BIP70 if ENABLE_WALLET is true? In that case #if defined(ENABLE_BIP70) would be enough all over the place.
| @@ -659,7 +667,7 @@ int main(int argc, char *argv[]) | ||
| // Re-initialize translations after changing application name (language in network-specific settings can be different) | ||
| initTranslations(qtTranslatorBase, qtTranslator, translatorBase, translator); | ||
| -#ifdef ENABLE_WALLET | ||
| +#if defined(ENABLE_WALLET) && defined(ENABLE_BIP70) |
laanwj
Nov 7, 2017
Owner
Yes, as a by-effect this currently removes bitcoin: URL support too.
(it probably shouldn't)
| #include "coincontroldialog.h" | ||
| #include "ui_coincontroldialog.h" | ||
| #include "addresstablemodel.h" | ||
| +#include "base58.h" |
laanwj
Nov 7, 2017
•
Owner
These extra includes are necessary now that paymentserver.h doesn't indirectly include them anymore.
| @@ -9,6 +9,8 @@ | ||
| #include "qvalidatedlineedit.h" | ||
| #include "walletmodel.h" | ||
| +#include "base58.h" | ||
| +#include "chainparams.h" |
| #include "paymentrequestplus.h" // this includes protobuf's port.h which defines its own bswap macos | ||
| +#endif |
laanwj
Nov 7, 2017
Owner
No, we have our own bswap macros. The only reason this is tested is that there was a collision between our bswap macros and protobuf's. So commenting this out is harmless.
| @@ -1,5 +1,6 @@ | ||
| #include "wallettests.h" | ||
| +#include "base58.h" |
|
"this breaks the dependency" -> "this removes the dependency"? I know the goal is to get rid of OpenSLL, but what's with Protobuf? Just fewer dependencies, or is there a specific problem with it? Breaking |
Advantage of less dependencies is mainly: less stuff to build while cross-compiling, less attack surface (yet another parsing library), etc.
I agree. It's |
|
I've restored BIP21 functionality, sifting through paymentserver.cpp/h to disable the parts relating to payment requests, instead of removing the whole file from the build. |
|
But |
Whoops, missed that. Fixed. |
|
Concept ACK |
|
Nice!
AFAIK OpenSSL (crypto) is still in use for the PRNG seeding (see currently closed #10299, waiting for new approach). |
Agree. The rand_ stuff should be removed in one go in a separate PR, it's orthogonal to the changes here. |
| @@ -647,7 +651,7 @@ int main(int argc, char *argv[]) | ||
| QMessageBox::critical(0, QObject::tr(PACKAGE_NAME), QObject::tr("Error: %1").arg(e.what())); | ||
| return EXIT_FAILURE; | ||
| } | ||
| -#ifdef ENABLE_WALLET |
|
I did a I then tested BIP-21 using:
I think you need another |
laanwj
added some commits
Nov 6, 2017
Thanks, added, also rebased and squashed. |
|
Warning is gone (also without the |
|
Concept ACK. Needs another rebase. |
laanwj commentedNov 6, 2017
This patch adds a --disable-bip70 configure option that disables BIP70 payment request support in the wallet GUI. BIP70 support remains enabled by default.
When disabled, this breaks the dependency of the GUI on OpenSSL and Protobuf.
(triggered by discussion on IRC today)