Users can type the address in manually, either from a piece of paper, or a telephone call, or just to avoid the clipboard. Bech32 helps a lot, because it is all lower case, and it has a very very good error location and correction. Wasabi already shows when the address is wrong, and only allows sending when all the checks pass. But we can do more!
Bech32 is magical, it even allows to locate the exact location of a typo! @bitcoinops has a great explanation and Pieter Wuille has written working javascript code.
This can be used to show the exact location of the error, for example red color of the letter, so that it's substantially easier to transcribe the address. Maybe this is already implemented in NBitcoin?
Maybe this is already implemented in NBitcoin?
No, it is not.
Good idea. Maybe a waste of time, but definitely something that's uncontroversial improvement.
Agreed, this is extra work, and only a UX improvement for a slight edge case, so I don't think this is priority.
Keep in mind that this is for Bech32, and includes both v0 and v1 SegWit. I guess that maintenance will be small.
Keep in mind that this is for Bech32, and includes both v0 and v1 SegWit. I guess that maintenance will be small.
I think if properly implemented, changing version numbers shouldn't break it. Currently, all bech32 addresses start with bc1q and then followed by the encoded hash because bc1 is the human readable part, and then q represents 0 for the version number. If a new version is being used the only part that would change would be to the beginning reading as bc1p because p represents the version value 1.
https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki
This feature would have been very useful in the case of #2336!
Seems like the error detection is now part of NBitcoin after all since https://github.com/MetacoSA/NBitcoin/commit/ef9728b2ad991ad84c928926f1f1c62cc5bf9841.
Now, it should be quite easy to integrate it into AddressStringParser.TryParseBitcoinAddress. I wanted to do this initially, but did not find the time to do so, yet.
Here a recent bitcoin-dev mail with corresponding blog post by @sipa with nuances on error detection and fixing in bech32 addresses.
Again, this is a very much needed feature for me, so it would be great to have it implemented :heart:
Just wanted to comment that I'm strongly planning to create a PR for this if nobody (@yahiheb?) chimes in before that. I don't have a clear date for this planned, though, and am not familiar with how to build and run the binary, yet, so I might need a little hand with implementing this.
@nioncode it would be great if you could figure this out! Let me know if you need anything.
FYI, here is a guide on how to build Wasabi from source.
Most helpful comment
Just wanted to comment that I'm strongly planning to create a PR for this if nobody (@yahiheb?) chimes in before that. I don't have a clear date for this planned, though, and am not familiar with how to build and run the binary, yet, so I might need a little hand with implementing this.