Invalid Checksum Exception
Exception thrown when mnemonic checksum validation fails.
BIP-39 mnemonics include a checksum derived from the SHA-256 hash of the entropy. The checksum is appended to the entropy before encoding to words. When decoding, the checksum is recalculated and compared. A mismatch indicates the mnemonic was corrupted or contains a typo.
Checksum sizes by mnemonic length:
12 words: 4-bit checksum
15 words: 5-bit checksum
18 words: 6-bit checksum
21 words: 7-bit checksum
24 words: 8-bit checksum
Recovery actions:
Double-check spelling of each word
Verify word order is correct
Ensure using the correct word list language
Example:
try {
// Mnemonic with incorrect last word (checksum word)
val m = Mnemonic.from(
"abandon abandon abandon abandon abandon abandon " +
"abandon abandon abandon abandon abandon wrong"
)
} catch (e: InvalidChecksumException) {
println("Checksum failed: ${e.message}")
println("Please verify your mnemonic phrase for typos")
}See also:
InvalidWordException for words not in the word list
InvalidMnemonicException for general mnemonic errors
Sep05Exception base class
Parameters
Description of the checksum failure (defaults to standard message)