Multibit-Legacy / multibit

Deprecated Bitcoin Wallet
https://multibit.org
MIT License
456 stars 393 forks source link

Multibit claims valid address is invalid and refuses to send #763

Closed batter closed 7 years ago

batter commented 7 years ago

I have been using MultiBit the last few days trying to transfer some bitcoin to another wallet, and I have seen multiple instances where when I attempt to send it raises the error message:

The address "xxx..." is not a valid bitcoin address

And then refuses to send. I am seeing this in instances even when I know the bitcoin address I have entered is valid because I have successfully sent coins to the address from other sources.

This seems to happen with almost every address I try to send to from MultiBit Classic (0.5.19) other than a new wallet I created with MultiBit HD. Is this just a matter of the source on MultiBit classic not having an up to date method of checking whether an address is valid? I am pretty sure I also saw this a few times unexpectedly with MultiBit HD (albeit not for all of the ones it refused on the MultiBit Classic instance).

My question is, perhaps there is a better way of validating whether an address is valid or not other than what is currently implemented. You'll have to pardon me if I get some terminology wrong since I'm not super knowledgable about bitcoin and its been years since I regularly worked with Java, but looking at the source, it seems that it attempts to create an Address instance as imported from com.google.bitcoin.core.Address. I'm wondering if there is a glitch in the version of the google bitcoin core being used, or perhaps it's a little too strict in how it validates. Wouldn't it be more effective to reach out to blockchain.info or some other blockchain source and check from the actual blockchain rather than trying to validate the format locally?

This seems like it's similar to the great email regex validation issue where people for years have been trying to use regular expressions to validate email formats locally when the only true way to validate whether an email is actually valid is to attempt to send an email to that address and see if it bounces back or not since email formats are constantly bouncing back. I'm not suggesting that MultiBit just attempt to send coins to an address to see if it's valid or not, but there has to be a better way to validate whether an address is valid than attempting to do it locally, no? The client is already connected to the blockchain network so doesn't it make sense to use it for stuff like this?

I may be off base here, but I know I'm seeing some false positives on the address validation, and when I check on blockchain.info it verifies that indeed those are valid addresses I'm putting in.

bgok commented 7 years ago

Make sure that there are no extra spaces or punctuation at the beginning or end of the address.

The validation used for bitcoin addresses is not a regular expression. It includes a specific check of the rules of bitcoin. For example, it must start with '1' or '3'. Additionally, there is a checksum that is verified. It is very likely that funds sent to an address that doesn't pass this set of validations are unspendable.

If you would like to have me take a look at the address, for privacy purposes, please send it to me via the support system at https://support.keepkey.com/support/home. Please make a note in the support request that you spoke to me on github so that the request get routed to me.

Thanks.

batter commented 7 years ago

I know for a fact that it denied me multiple times when inputting addresses that didn't pass validation when they were valid addresses, which which resulted in me needing to create a temp wallet on a different client just so I could send funds to their ultimate destination. I double and triple checked these addresses, so this wasn't a matter of punctuation.