Verify Message provides the address #1356

issue luke-jr opened this issue on May 18, 2012
  1. luke-jr commented at 7:32 PM on May 18, 2012: member

    The JSON-RPC verifymessage intentionally required the user to provide the expected address, and returned success or failure, to avoid potential social engineering: if the user is simply told the signing address, someone could use vanitygen to create a similar-looking address and attempt to fool the verifier when they compare it. The recently merged Verify Message dialog introduces this attack vector.

    I propose making the Address field editable, and having the Verify button simply display "Signature valid" or invalid in a messagebox.

  2. gmaxwell commented at 7:56 PM on May 18, 2012: contributor

    In the RPC I think the requirement to specify the address is a nuisance — esp in cases where there simply wouldn't be an opportunity to social engineer— e.g. where the address is itself the relevant 'account'... and I wouldn't be sad to see that feature go. In the GUI OTOH I tend to agree.

    Perhaps make the verify box an input field, and if it's correct it instead tells you what the address should have been in the sorry you lose box? This way use case that don't need to know the address in advance can still get it, but users are still encouraged to let the machine do the comparison.

  3. Diapolo commented at 11:38 PM on May 19, 2012: none

    @gmaxwell To understand the feature as it's intended, I need to supply a signature and a message and won't get the address out of the two. I just can verify, that the person, who send me both seems to be the owner of the signing address (I don't know or don't need to know).

  4. Diapolo commented at 8:37 AM on May 21, 2012: none

    I did some further tests and it seems the verifymessagepage is badly broken!

    • create a signature from a testnet-address
    • start normal net client
    • paste signature and message -> no error, displays a bitcoin address (but not the one used to sign the message)
    • paste only signature -> no error, displays another bitcoin address (still not the one used to sign the message)

    If I repeat this via RPC Console on normal net, the verifymessage is not accepted without the signing address and even if I supply the testnet address, I get "code":-3,"message":"Invalid address". On the testnet client the verification works!

    I'm going to change the verifymessage page, to match the RPC command verifymessage

  5. sipa commented at 10:13 AM on May 21, 2012: member

    @Diapolo that's quite expected - the signature does not encode whether it's from testnet or not. The key recovery mechanism (which does require the message, by the way) can recover the public key, but the address that corresponds to it depends on which network you're on.

  6. Diapolo commented at 11:26 AM on May 21, 2012: none

    @sipa: Alright, even if the behaviour is expected, I think the verifymessage page should act like the RPC verifymessage. It does not make any sense to "recover" an address (or key) that was not used to sign the message. As I wrote, the current state allows to use a valid signature, enter any message and get a Bitcoin address displayed. I have code ready, that changes it to behave like verifymessage.

  7. luke-jr commented at 1:20 PM on May 21, 2012: member

    @Diapolo both the testnet address you signed with and the bitcoin address you got are the same key; you can export it from testnet and import it to mainnet to use it there. Pasting the signature without the message is obviously a bug for sure, though, and I do believe the behaviour should be corrected here.

  8. Diapolo commented at 11:07 AM on June 22, 2012: none

    This can be closed, as even without the tabbed UI, the current verify dialog matched the RPC-call behaviour.

  9. luke-jr commented at 4:36 PM on June 27, 2012: member

    Confirmed

  10. luke-jr closed this on Jun 27, 2012

  11. lateminer referenced this in commit 3715fbcca2 on Jan 22, 2019
  12. lateminer referenced this in commit d6298c5fa0 on May 6, 2020
  13. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 15:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me