Skip to content

Commit 4e56df8

Browse files
committed
Merge #819: Fix misleading signmessage error with segwit
fb9f150 gui: fix misleading signmessage error with segwit (willcl-ark) Pull request description: As described in bitcoin/bitcoin#10542 (and numerous other places), message signing in Bitcoin Core does not support "signing with a segwit address" and likely will not in the foreseeable future, or at least until a new message-signing standard is agreed upon. Therefore update the possibly misleading error message presented to the user in the GUI to detail more specifically the reason their message cannot be signed, in the case that a non P2PKH address is entered. This change takes the [suggested wording](bitcoin/bitcoin#10542 (comment)) from @adiabat. Perhaps with this we can close bitcoin/bitcoin#10542 ? ACKs for top commit: hebasto: ACK fb9f150. Tree-SHA512: 5ba8d722ad3632dad2e0a2aa94b0f466b904e7885a247a5d26ebdfce54e3611090b103029d8dfce92adc49e50fe5f4830f687d867b4c56c3ea997e519b4e188d
2 parents 8efd03a + fb9f150 commit 4e56df8

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/qt/forms/signverifymessagedialog.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<item>
3131
<widget class="QLabel" name="infoLabel_SM">
3232
<property name="text">
33-
<string>You can sign messages/agreements with your addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</string>
33+
<string>You can sign messages/agreements with your legacy (P2PKH) addresses to prove you can receive bitcoins sent to them. Be careful not to sign anything vague or random, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</string>
3434
</property>
3535
<property name="textFormat">
3636
<enum>Qt::PlainText</enum>

src/qt/signverifymessagedialog.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <qt/platformstyle.h>
1111
#include <qt/walletmodel.h>
1212

13+
#include <config/bitcoin-config.h> // IWYU pragma: keep
1314
#include <key_io.h>
1415
#include <util/message.h> // For MessageSign(), MessageVerify()
1516
#include <wallet/wallet.h>
@@ -123,7 +124,7 @@ void SignVerifyMessageDialog::on_signMessageButton_SM_clicked()
123124
if (!pkhash) {
124125
ui->addressIn_SM->setValid(false);
125126
ui->statusLabel_SM->setStyleSheet("QLabel { color: red; }");
126-
ui->statusLabel_SM->setText(tr("The entered address does not refer to a key.") + QString(" ") + tr("Please check the address and try again."));
127+
ui->statusLabel_SM->setText(tr("The entered address does not refer to a legacy (P2PKH) key. Message signing for SegWit and other non-P2PKH address types is not supported in this version of %1. Please check the address and try again.").arg(PACKAGE_NAME));
127128
return;
128129
}
129130

@@ -221,10 +222,7 @@ void SignVerifyMessageDialog::on_verifyMessageButton_VM_clicked()
221222
return;
222223
case MessageVerificationResult::ERR_ADDRESS_NO_KEY:
223224
ui->addressIn_VM->setValid(false);
224-
ui->statusLabel_VM->setText(
225-
tr("The entered address does not refer to a key.") + QString(" ") +
226-
tr("Please check the address and try again.")
227-
);
225+
ui->statusLabel_VM->setText(tr("The entered address does not refer to a legacy (P2PKH) key. Message signing for SegWit and other non-P2PKH address types is not supported in this version of %1. Please check the address and try again.").arg(PACKAGE_NAME));
228226
return;
229227
case MessageVerificationResult::ERR_MALFORMED_SIGNATURE:
230228
ui->signatureIn_VM->setValid(false);

0 commit comments

Comments
 (0)