Skip to content

Commit

Permalink
Reject Electrum mnemonics that are also valid BIP-39
Browse files Browse the repository at this point in the history
  • Loading branch information
Coding-Enthusiast committed Oct 15, 2023
1 parent e1a8e56 commit 1d3882f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Src/Autarkysoft.Bitcoin/ImprovementProposals/ElectrumMnemonic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,17 @@ private void SetWordsFromEntropy(byte[] entropy)
{
continue;
}

// TODO: add a new method in BIP0039 to check if the mneomonic is valid
try
{
using BIP0039 temp = new BIP0039(normalized);
continue;
}
catch (Exception)
{
}

if (GetMnemonicType(normalized) == MnType)
{
break;
Expand Down

0 comments on commit 1d3882f

Please sign in to comment.