BECH32 detects up to 4 errors (in the sense that creating up to 4 replacement errors guarantees that the resulting string has an incorrect checksum). However, error detection is not the same as error Positioning: Just knowing that BECH32 is wrong does not mean you can’t know where the error was made.
Bech32 is also allowed Correction Up to 2 replacement errors. This means that if you know that no more than two replacement errors have been created, you can calculate what the original valid string was for a given string. The JavaScript code on the website you link to has the code to do this, but for safety reasons it will not be revealed intentionally what Errors discovered, where.
The reason is that corrections are dangerous. If the user creates two or more replacement errors, the error correction algorithm may still find two errors to “fix” in the sense that it constructs a valid address, but It is not the user’s address. Inadvertent users may make corrections suggested by the algorithm and send funds to void. Instead, the correction algorithm is still used under the hood, but only the location of the error is revealed, forcing the user to check if it is the primary resource that received the address, but perhaps forces the algorithm to focus specifically on the specific location where the location error is likely to have occurred.
Discover more from Earlybirds Invest
Subscribe to get the latest posts sent to your email.