Author

Topic: Can a Checksum be used to recover a forgotten data? (Read 209 times)

legendary
Activity: 2870
Merit: 7490
Crypto Swap Exchange
If you need error correction feature, you could always use Reed-Solomon algorithm. QR code use that algorithm with 4 different capability level, so you just need to generate QR code based on your private key, seed/mnemonic phrase or master private key.

But RS can only detect the error but can't correct it, or is there a way to go about it?

RS can do both error detection and correction. There are many general articles about it such as,
https://www.qrcode-tiger.com/qr-code-error-correction
https://www.tutorialspoint.com/error-correcting-codes-reed-solomon-codes
https://www.geeksforgeeks.org/what-is-reed-solomon-code/
full member
Activity: 303
Merit: 136
Defend Bitcoin and its PoW: bitcoincleanup.com
If you need error correction feature, you could always use Reed-Solomon algorithm. QR code use that algorithm with 4 different capability level, so you just need to generate QR code based on your private key, seed/mnemonic phrase or master private key.

But RS can only detect the error but can't correct it, or is there a way to go about it?
legendary
Activity: 2268
Merit: 18711
If you need error correction feature, you could always use Reed-Solomon algorithm. QR code use that algorithm with 4 different capability level, so you just need to generate QR code based on your private key, seed/mnemonic phrase or master private key.
BCH codes are a specific implementation of Reed-Solomon codes. Original Reed-Solomon codes are not suitable for bitcoin due to them only working on strings which are the length of the alphabet minus one. Since our alphabet in Bech32 is 32 characters, they would only work for strings of 31 characters, which is therefore not usable for segwit addresses of 42 or 62 characters long.
legendary
Activity: 2268
Merit: 18711
Note that the answers above refer to the checksums which are present in seed phrases, WIF keys, and legacy addresses. Bech32 addresses have a different method for calculating checksums, known as BCH codes (https://en.wikipedia.org/wiki/BCH_code). These checksums can indeed be used for error correction rather than just error detection, although wallets and services in general don't implement this since there is a very small risk that by fixing the errors in this manner you could change the address in to another valid but incorrect address and then lose your coins by sending them to the wrong address.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
2. Can Checksums be used to recover a forgotten data?     How?
For address' checksum, there's nothing to recover since the data that's hashed twice is already there.
e.g: Decode the address from BASE58 into HEX, the last 4 bytes is the checksum and the rest is the data that was hashed twice.
(cannot be applied to bech32)

For WIF private key's checksum, it's basically the same (WIF to Private key).
But which data to recover? It's basically the same private key, but in different format.
hero member
Activity: 1106
Merit: 912
Not Your Keys, Not Your Bitcoin
My questions are;
1. Other than using the first 4 bytes of a hashed can the last 4 bytes also work?

Checksum use SHA256 as a fingerprint of any data you input. Let's say you have data you want to hash.
You have this data : 4a78e8d3d738ad1f9026009cf394bf7a8c86901b
The SHA56 result gave you: 92036ae0ca79f5b8c10bc9f951b244833be9a5771b00fa7fc63db711f0b6d9fd

The checksum becomes : 4a78e8d3d738ad1f9026009cf394bf7a8c86901b92036ae

It is convenient and standard that way for any software to detect any missing data than taking the last 4 bytes (f0b6d9fd)

Quote

2. Can Checksums be used to recover a forgotten data?     How?

The answer is NO and security-wise it is not safe, if checksum could be used to recover missing data, bitcoin will not be safe as anyone with a few data of private keys can easily exploit that to detect other full private keys details.

NOTE: SHA256 is an irreversible process, you cannot go back to the original data.

legendary
Activity: 1512
Merit: 7340
Farewell, Leo
1. Other than using the first 4 bytes of a hashed can the last 4 bytes also work?
The last 4 bytes could also be used as a fingerprint, but using the first 4 has been chosen as the standard way. One could choose to use more bytes and not the first nor the last, but the middle ones.

2. Can Checksums be used to recover a forgotten data?     How?
To recover it? No. To help you speed up recovering it? Yes.
copper member
Activity: 1652
Merit: 1901
Amazon Prime Member #7
2. Can Checksums be used to recover a forgotten data?     How?
No. A checksum is used to help you quickly determine if a value is valid or not. It is not possible to go from the checksum to the original data (just as it is not possible to go from the hash of data to the original data).

The only way a checksum could potentially help you recover data is if you stored many versions of data, but a particular checksum would only validate one of these versions. This would allow you to quickly determine which version of your data is valid. However, for every checksum, there are an infinite number of potential data that has a given checksum. So using a checksum to recover your data is useless unless you have a limited number of data candidates.
full member
Activity: 303
Merit: 136
Defend Bitcoin and its PoW: bitcoincleanup.com
Checksums is a 4 bytes of data generated through hashing data twice with SHA256. Checksum is used to check the validity of the original data whenever it is typed. The checksums are included in addresses and WIF private keys. The checksum is created by hashing with SHA 256 twice before then the data for hashing is converted from its string to bytes and after hashing the first 4 bytes is saved as the Checksum.

My questions are;
1. Other than using the first 4 bytes of a hashed can the last 4 bytes also work?

2. Can Checksums be used to recover a forgotten data?     How?
Jump to: