cake_wallet/cw_bitcoin/lib/bitcoin_mnemonic.dart

2189 lines
27 KiB
Dart
Raw Permalink Normal View History

import 'dart:convert';
import 'dart:math';
import 'dart:typed_data';
import 'package:crypto/crypto.dart';
import 'package:cryptography/cryptography.dart' as cryptography;
import 'package:cw_core/sec_random_native.dart';
import 'package:cw_core/utils/text_normalizer.dart';
const segwit = '100';
litecoin mweb support (#1455) * Fix stub creation * Generate MWEB addresses * Fix mweb address derivation * Use camel-case * Show utxos in tx list * A few fixes * Add spent processing * Update balance * Balance fixes * Update address records * Get rid of debounce hack * Get sending up to the confirmation box * Fee estimation * Stop the daemon if plugin is unloaded * Normal fee for non-mweb txns * Fix fee estimation for send all * Don't hash mweb addresses * More fee fixes * Broadcast mweb * Remove test files * One more * Confirm sent txns * Couple of fixes * Resign inputs after mweb create * Some more fixes * Update balance after sending * Correctly update address records * Update confs * [skip ci] updates * [skip ci] add dep overrides * working * small fix * merge fixes [skip ci] * merge fixes [skip ci] * [skip ci] minor fixes * silent payment fixes [skip ci] * updates [skip ci] * save [skip ci] * use mwebutxos box * [skip ci] lots of fixes, still testing * add rescan from height feature and test workflow build * install go * use sudo * correct package name * move building mweb higher for faster testing * install fixes * install later version of go * go fixes * testing * testing * testing * testing * testing * should workgit add .github/workflows/pr_test_build.yml * ??? * ??? pt.2 * should work, for real this time * fix tx history not persisting + update build_mwebd script * updates * fix some rescan and address gen issues * save [skip ci] * fix unconfirmed balance not updating when receiving * unspent coins / coin control fixes * coin control fixes * address balance and txCount fixes, try/catch electrum call * fix txCount for addresses * save [skip ci] * potential fixes * minor fix * minor fix - 2 * sync status fixes, potential fix for background state issue * workflow and script updates * updates * expirimental optimization * [skip ci] minor enhancements * workflow and script fixes * workflow minor cleanup [skip ci] * minor code cleanup & friendlier error message on failed tx's * balance when sending fix * experimental * more experiments * save * updates * coin control edge cases * remove neutrino.db if no litecoin wallets left after deleting * update translations * updates * minor fix * [skip ci] update translations + minor fixes * state fixes * configure fix * ui updates * translation fixes * [skip ci] addressbook updates * fix popup * fix popup2 * fix litecoin address book * fix ios mwebd build script * fix for building monero.com * minor fix * uncomment fix for state issues * potential mweb sync fix (ios) * remove print [skip ci] * electrum stream potential fix * fix ios build issues [skip ci] * connection reliability updates, update kotlin code to match swift code, minor electrum error handling * dep fixes * minor fix * more merge fixes * bitcoin_flutter removal fixes * [skip ci] fix always scan setting, swift updates * updates * fixes * small fix * small fix * fix * dart:convert != package:convert * change address fixes * update bitcoin_base to fix mweb address program checking * fix ios xcode project [skip ci] * updates * more fixes * more fixes * ensure we don't initialize mweb until we really have to * fix regression * improve mweb reliability * [skip ci] wip adress generation * wip * wip * [skip ci] wip * updates [skip ci] * ios fixes * fix workflows + ios fix * test old mweb version * update go version and mwebd hash * review updates pt.1 * Update cw_bitcoin/lib/litecoin_wallet.dart Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> * remove non-litecoin address types regex [skip ci] * more minor fixes * remove duplicate [skip ci] * Update lib/store/settings_store.dart Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> * script updates, swap params on createLitecoinWalletService * topup fix * [skip ci] wip * [skip ci] testing * [skip ci] file didn't get saved * more address generation reliability fixes * [skip ci] minor * minor code cleanup * hopefully prevents send issue * [skip ci] wip address changes * [skip ci] save * save mweb addresses, auto-restart sync process if it gets stuck [skip ci] * address generation issues mostly resolved * more performance fixes * [skip ci] * this should maybe be refactored, pt.1 * separate mweb balances, pt.2 * [skip ci] save * add translations [skip ci] * fix sending with mweb amounts * works for simple mweb-mweb case, further testing needed * found an edge case * [skip ci] make failed broadcast error message less serious * minor * capture all grpc errors and much better error handling overall * [skip ci] minor * prevent transactions with < 6 confirmations from being used + hide mweb balances if mweb is off * fix * merge fixes pt.1 [skip ci] * fix mweb tags * fix * [skip ci] fix tag spacing * fix transaction history not showing up * fix mweb crash on non-fully deleted mweb cache, sync status ETA, other connection fixes * [skip ci] minor code cleanup * [skip ci] minor code cleanup * additional cleanup * silent payments eta fixes and updates * revert sync eta changes into separate pr * [skip ci] minor * [skip ci] minor * revert sync status title * review fixes, additional cleanup * [skip ci] minor * [skip ci] minor * [skip ci] minor * trigger build * review fixes, pt.2 * check if still processing utxos before updating sync status [skip ci] * [skip ci] minor * balance fix * minor * minor * [skip ci] minor * [skip ci] fix test net btc * don't use mwebd for non-mweb tx's * [skip ci] minor cleanup * don't show all 1000+ mweb addresses on receive page * minor cleanup + additional logging --------- Co-authored-by: Hector Chu <hectorchu@gmail.com> Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
2024-09-28 02:22:25 +00:00
const mweb = 'eb';
final wordlist = englishWordlist;
double logBase(num x, num base) => log(x) / log(base);
String mnemonicEncode(int i) {
var _i = i;
final n = wordlist.length;
final words = <String>[];
while (_i > 0) {
final x = i % n;
_i = (i / n).floor();
words.add(wordlist[x]);
}
return words.join(' ');
}
int mnemonicDecode(String seed) {
var i = 0;
final n = wordlist.length;
final words = seed.split(' ');
while (words.length > 0) {
final word = words.removeLast();
final k = wordlist.indexOf(word);
i = i * n + k;
}
return i;
}
bool isNewSeed(String seed, {String prefix = segwit}) {
final hmacSha512 = Hmac(sha512, utf8.encode('Seed version'));
final digest = hmacSha512.convert(utf8.encode(normalizeText(seed)));
final hx = digest.toString();
return hx.startsWith(prefix.toLowerCase());
}
void maskBytes(Uint8List bytes, int bits) {
final skipCount = (bits / 8).floor();
var lastByte = (1 << bits % 8) - 1;
for (var i = bytes.length - 1 - skipCount; i >= 0; i--) {
bytes[i] &= lastByte;
if (lastByte > 0) {
lastByte = 0;
}
}
}
String bufferToBin(Uint8List data) => data.map((e) => e.toRadixString(2).padLeft(8, '0')).join('');
String encode(Uint8List data) {
final dataBitLen = data.length * 8;
final wordBitLen = logBase(wordlist.length, 2).ceil();
final wordCount = (dataBitLen / wordBitLen).floor();
maskBytes(data, wordCount * wordBitLen);
final bin = bufferToBin(data);
final binStr = bin.substring(bin.length - (wordCount * wordBitLen));
final result = <Object>[];
for (var i = 0; i < wordCount; i++) {
final wordBin = binStr.substring(i * wordBitLen, (i + 1) * wordBitLen);
result.add(wordlist[int.parse(wordBin, radix: 2)]);
}
return result.join(' ');
}
List<bool> prefixMatches(String source, List<String> prefixes) {
final hmacSha512 = Hmac(sha512, utf8.encode('Seed version'));
final digest = hmacSha512.convert(utf8.encode(normalizeText(source)));
final hx = digest.toString();
return prefixes.map((prefix) => hx.startsWith(prefix.toLowerCase())).toList();
}
Bitcoin derivations (#1089) * - Update and Fix Conflicts with main * Add Balances for ERC20 tokens * Fix conflicts with main * Add erc20 abi json * Add send erc20 tokens initial function * add missing getHeightByDate in Haven [skip ci] * Allow contacts and wallets from the same tag * Add Shiba Inu icon * Add send ERC-20 tokens initial flow * Add missing import in generated file * Add initial approach for transaction sending for ERC-20 tokens * Refactor signing/sending transactions * Add initial flow for transactions subscription * Refactor signing/sending transactions * Add home settings icon * Fix conflicts with main * Initial flow for home settings * Add logic flow for adding erc20 tokens * Fix initial UI * Finalize UI for Tokens * Integrate UI with Ethereum flow * Add "Enable/Disable" feature for ERC20 tokens * Add initial Erc20 tokens * Add Sorting and Pin Native Token features * Fix price sorting * Sort tokens list as well when Sort criteria changes * - Improve sorting balances flow - Add initial add token from search bar flow * Fix Accounts Popup UI * Fix Pin native token * Fix Enabling/Disabling tokens Fix sorting by fiat once app is opened Improve token availability mechanism * Fix deleting token Fix renaming tokens * Fix issue with search * Add more tokens * - Fix scroll issue - Add ERC20 tokens placeholder image in picker * - Separate and organize default erc20 tokens - Fix scrolling - Add token placeholder images in picker - Sort disabled tokens alphabetically * Change BNB token initial availability [skip ci] * Fix Conflicts with main * Fix Conflicts with main * Add Verse ERC20 token to the initial tokens list * Add rename wallet to Ethereum * Integrate EtherScan API for fetching address transactions Generate Ethereum specific secrets in Ethereum package * Adjust transactions fiat price for ERC20 tokens * Free Up GitHub Actions Ubuntu Runner Disk Space * Free Up GitHub Actions Ubuntu Runner Disk space (trial 2) * Fix Transaction Fee display * Save transaction history * Enhance loading time for erc20 tokens transactions * Minor Fixes and Enhancements * Fix sending erc20 fix block explorer issue * Fix int overflow * Fix transaction amount conversions * Minor: `slow` -> `Slow` [skip-ci] * initial changes * more base config stuff * config changes * successfully builds! * save * successfully add nano wallet * save * seed generation * receive screen + node screen working * tx history working and fiat fixes * balance working * derivation updates * nano-unfinished * sends working * remove fees from send screen, send and receive transactions working * fixes + auto receive incoming txs * fix for scanning QR codes * save * update translations * fixes * more fixes * more strings * small fix * fix github actions workflow * potential fix * potential fix * ci/cd fix * change rep working * seed generation fixes * fixes * save * change rep screen functional * save * banano changes * fixes, start adding ui for PoW * pow node changes * update translations * fix * account changing barely working * save * disable account generation * small fix * save * UI work * save * fixes after merge main * fixes * remove monero stuff, work on derivation ui * lots of fixes + finish up seed derivation * last minute fixes * node related fixes * more fixes * small fix * more fixes * fixes * pretty big refactor for pow, still some bugs * finally works! * get transactions after send * fix * merge conflict fixes * save * fix pow node showing up twice * done * initial changes * small fix * more merge fixes * fixes * more fixes * fix * save * fix manage pow nodes setting appearing on other wallets * fix contact bug * fixes * fiat fixes * save * save * save * save * updates * cleanup * restore fix * fixes * remove deprecated alert * fix * small fix * remove outdated warning * electrum restore fixes * fixes * fixes * fix * derivation fixes * nano fixes pt.1 * nano fixes pt.2 * bip39 fixes * pownode refactor * nodes pages fixes * observer fix * ssl fix * remove old references * remove unused imports * code cleanup * small fix * small potential fix * save * derivation fixes * deterministic fix * fix pt.2 * derivation class fixes * review fixes from nano that also apply here * formatting * stuff that should've stayed deleted * post merge fixes * remove problematic imports and duplicate changes * Delete lib/nano/nano.dart * move wallet restore page proxy code to the view model * fix dashboard page indicators being the same color * debatably better refactoring of derivationInfo, migration needed * additional refactor improvements * blanket comment some stuff out to narrow down this issue * refactor fixes * fix nano exchange * fix , bug, i.e. replace , with . when making a nano transaction * fix nano sending, update restore page wording, and other minor fixes * write migration for existing bitcoin and nano wallets * merge fixes * minor fixes * use default derivation type when restoring from qr code * fixes for restoring * fixes * fixes * merge fix * Fix issues with Creating Electrum and Restoring Bip39 * updates & fixes * Add missing case for no transactions BIP39 wallet restore * Make the default BIP39 the 84 derivation path * Add Samourai Deposit * litecoin mnemonic error fix * Bip39 passphrase support (#1412) * save * passphrase working * fix for when loading wallets + translation update * minor fix * Fix Nano * minor fix [skip ci] --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com> * change error state seed conditions into throwables [skip ci] * litecoin fixes * Bip39 minor enhancements (#1416) * minor enhancements * rename bitcoin_derivations -> electrum_derivations * Remove duplicate derivations handle default case * minor fix * Enable passphrase for Litecoin * obscure text of passphrase --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com> Co-authored-by: Justin Ehrenhofer <justin.ehrenhofer@gmail.com> Co-authored-by: fossephate <fosse@book.local>
2024-04-30 00:49:56 +00:00
Future<String> generateElectrumMnemonic({int strength = 264, String prefix = segwit}) async {
final wordBitlen = logBase(wordlist.length, 2).ceil();
final wordCount = strength / wordBitlen;
final byteCount = ((wordCount * wordBitlen).ceil() / 8).ceil();
var result = '';
do {
final bytes = await secRandom(byteCount);
maskBytes(bytes, strength);
result = encode(bytes);
} while (!prefixMatches(result, [prefix]).first);
return result;
}
Bitcoin derivations (#1089) * - Update and Fix Conflicts with main * Add Balances for ERC20 tokens * Fix conflicts with main * Add erc20 abi json * Add send erc20 tokens initial function * add missing getHeightByDate in Haven [skip ci] * Allow contacts and wallets from the same tag * Add Shiba Inu icon * Add send ERC-20 tokens initial flow * Add missing import in generated file * Add initial approach for transaction sending for ERC-20 tokens * Refactor signing/sending transactions * Add initial flow for transactions subscription * Refactor signing/sending transactions * Add home settings icon * Fix conflicts with main * Initial flow for home settings * Add logic flow for adding erc20 tokens * Fix initial UI * Finalize UI for Tokens * Integrate UI with Ethereum flow * Add "Enable/Disable" feature for ERC20 tokens * Add initial Erc20 tokens * Add Sorting and Pin Native Token features * Fix price sorting * Sort tokens list as well when Sort criteria changes * - Improve sorting balances flow - Add initial add token from search bar flow * Fix Accounts Popup UI * Fix Pin native token * Fix Enabling/Disabling tokens Fix sorting by fiat once app is opened Improve token availability mechanism * Fix deleting token Fix renaming tokens * Fix issue with search * Add more tokens * - Fix scroll issue - Add ERC20 tokens placeholder image in picker * - Separate and organize default erc20 tokens - Fix scrolling - Add token placeholder images in picker - Sort disabled tokens alphabetically * Change BNB token initial availability [skip ci] * Fix Conflicts with main * Fix Conflicts with main * Add Verse ERC20 token to the initial tokens list * Add rename wallet to Ethereum * Integrate EtherScan API for fetching address transactions Generate Ethereum specific secrets in Ethereum package * Adjust transactions fiat price for ERC20 tokens * Free Up GitHub Actions Ubuntu Runner Disk Space * Free Up GitHub Actions Ubuntu Runner Disk space (trial 2) * Fix Transaction Fee display * Save transaction history * Enhance loading time for erc20 tokens transactions * Minor Fixes and Enhancements * Fix sending erc20 fix block explorer issue * Fix int overflow * Fix transaction amount conversions * Minor: `slow` -> `Slow` [skip-ci] * initial changes * more base config stuff * config changes * successfully builds! * save * successfully add nano wallet * save * seed generation * receive screen + node screen working * tx history working and fiat fixes * balance working * derivation updates * nano-unfinished * sends working * remove fees from send screen, send and receive transactions working * fixes + auto receive incoming txs * fix for scanning QR codes * save * update translations * fixes * more fixes * more strings * small fix * fix github actions workflow * potential fix * potential fix * ci/cd fix * change rep working * seed generation fixes * fixes * save * change rep screen functional * save * banano changes * fixes, start adding ui for PoW * pow node changes * update translations * fix * account changing barely working * save * disable account generation * small fix * save * UI work * save * fixes after merge main * fixes * remove monero stuff, work on derivation ui * lots of fixes + finish up seed derivation * last minute fixes * node related fixes * more fixes * small fix * more fixes * fixes * pretty big refactor for pow, still some bugs * finally works! * get transactions after send * fix * merge conflict fixes * save * fix pow node showing up twice * done * initial changes * small fix * more merge fixes * fixes * more fixes * fix * save * fix manage pow nodes setting appearing on other wallets * fix contact bug * fixes * fiat fixes * save * save * save * save * updates * cleanup * restore fix * fixes * remove deprecated alert * fix * small fix * remove outdated warning * electrum restore fixes * fixes * fixes * fix * derivation fixes * nano fixes pt.1 * nano fixes pt.2 * bip39 fixes * pownode refactor * nodes pages fixes * observer fix * ssl fix * remove old references * remove unused imports * code cleanup * small fix * small potential fix * save * derivation fixes * deterministic fix * fix pt.2 * derivation class fixes * review fixes from nano that also apply here * formatting * stuff that should've stayed deleted * post merge fixes * remove problematic imports and duplicate changes * Delete lib/nano/nano.dart * move wallet restore page proxy code to the view model * fix dashboard page indicators being the same color * debatably better refactoring of derivationInfo, migration needed * additional refactor improvements * blanket comment some stuff out to narrow down this issue * refactor fixes * fix nano exchange * fix , bug, i.e. replace , with . when making a nano transaction * fix nano sending, update restore page wording, and other minor fixes * write migration for existing bitcoin and nano wallets * merge fixes * minor fixes * use default derivation type when restoring from qr code * fixes for restoring * fixes * fixes * merge fix * Fix issues with Creating Electrum and Restoring Bip39 * updates & fixes * Add missing case for no transactions BIP39 wallet restore * Make the default BIP39 the 84 derivation path * Add Samourai Deposit * litecoin mnemonic error fix * Bip39 passphrase support (#1412) * save * passphrase working * fix for when loading wallets + translation update * minor fix * Fix Nano * minor fix [skip ci] --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com> * change error state seed conditions into throwables [skip ci] * litecoin fixes * Bip39 minor enhancements (#1416) * minor enhancements * rename bitcoin_derivations -> electrum_derivations * Remove duplicate derivations handle default case * minor fix * Enable passphrase for Litecoin * obscure text of passphrase --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com> Co-authored-by: Justin Ehrenhofer <justin.ehrenhofer@gmail.com> Co-authored-by: fossephate <fosse@book.local>
2024-04-30 00:49:56 +00:00
Future<bool> checkIfMnemonicIsElectrum2(String mnemonic) async {
return prefixMatches(mnemonic, [segwit]).first;
}
Future<String> getMnemonicHash(String mnemonic) async {
final hmacSha512 = Hmac(sha512, utf8.encode('Seed version'));
final digest = hmacSha512.convert(utf8.encode(normalizeText(mnemonic)));
return digest.toString();
Bitcoin derivations (#1089) * - Update and Fix Conflicts with main * Add Balances for ERC20 tokens * Fix conflicts with main * Add erc20 abi json * Add send erc20 tokens initial function * add missing getHeightByDate in Haven [skip ci] * Allow contacts and wallets from the same tag * Add Shiba Inu icon * Add send ERC-20 tokens initial flow * Add missing import in generated file * Add initial approach for transaction sending for ERC-20 tokens * Refactor signing/sending transactions * Add initial flow for transactions subscription * Refactor signing/sending transactions * Add home settings icon * Fix conflicts with main * Initial flow for home settings * Add logic flow for adding erc20 tokens * Fix initial UI * Finalize UI for Tokens * Integrate UI with Ethereum flow * Add "Enable/Disable" feature for ERC20 tokens * Add initial Erc20 tokens * Add Sorting and Pin Native Token features * Fix price sorting * Sort tokens list as well when Sort criteria changes * - Improve sorting balances flow - Add initial add token from search bar flow * Fix Accounts Popup UI * Fix Pin native token * Fix Enabling/Disabling tokens Fix sorting by fiat once app is opened Improve token availability mechanism * Fix deleting token Fix renaming tokens * Fix issue with search * Add more tokens * - Fix scroll issue - Add ERC20 tokens placeholder image in picker * - Separate and organize default erc20 tokens - Fix scrolling - Add token placeholder images in picker - Sort disabled tokens alphabetically * Change BNB token initial availability [skip ci] * Fix Conflicts with main * Fix Conflicts with main * Add Verse ERC20 token to the initial tokens list * Add rename wallet to Ethereum * Integrate EtherScan API for fetching address transactions Generate Ethereum specific secrets in Ethereum package * Adjust transactions fiat price for ERC20 tokens * Free Up GitHub Actions Ubuntu Runner Disk Space * Free Up GitHub Actions Ubuntu Runner Disk space (trial 2) * Fix Transaction Fee display * Save transaction history * Enhance loading time for erc20 tokens transactions * Minor Fixes and Enhancements * Fix sending erc20 fix block explorer issue * Fix int overflow * Fix transaction amount conversions * Minor: `slow` -> `Slow` [skip-ci] * initial changes * more base config stuff * config changes * successfully builds! * save * successfully add nano wallet * save * seed generation * receive screen + node screen working * tx history working and fiat fixes * balance working * derivation updates * nano-unfinished * sends working * remove fees from send screen, send and receive transactions working * fixes + auto receive incoming txs * fix for scanning QR codes * save * update translations * fixes * more fixes * more strings * small fix * fix github actions workflow * potential fix * potential fix * ci/cd fix * change rep working * seed generation fixes * fixes * save * change rep screen functional * save * banano changes * fixes, start adding ui for PoW * pow node changes * update translations * fix * account changing barely working * save * disable account generation * small fix * save * UI work * save * fixes after merge main * fixes * remove monero stuff, work on derivation ui * lots of fixes + finish up seed derivation * last minute fixes * node related fixes * more fixes * small fix * more fixes * fixes * pretty big refactor for pow, still some bugs * finally works! * get transactions after send * fix * merge conflict fixes * save * fix pow node showing up twice * done * initial changes * small fix * more merge fixes * fixes * more fixes * fix * save * fix manage pow nodes setting appearing on other wallets * fix contact bug * fixes * fiat fixes * save * save * save * save * updates * cleanup * restore fix * fixes * remove deprecated alert * fix * small fix * remove outdated warning * electrum restore fixes * fixes * fixes * fix * derivation fixes * nano fixes pt.1 * nano fixes pt.2 * bip39 fixes * pownode refactor * nodes pages fixes * observer fix * ssl fix * remove old references * remove unused imports * code cleanup * small fix * small potential fix * save * derivation fixes * deterministic fix * fix pt.2 * derivation class fixes * review fixes from nano that also apply here * formatting * stuff that should've stayed deleted * post merge fixes * remove problematic imports and duplicate changes * Delete lib/nano/nano.dart * move wallet restore page proxy code to the view model * fix dashboard page indicators being the same color * debatably better refactoring of derivationInfo, migration needed * additional refactor improvements * blanket comment some stuff out to narrow down this issue * refactor fixes * fix nano exchange * fix , bug, i.e. replace , with . when making a nano transaction * fix nano sending, update restore page wording, and other minor fixes * write migration for existing bitcoin and nano wallets * merge fixes * minor fixes * use default derivation type when restoring from qr code * fixes for restoring * fixes * fixes * merge fix * Fix issues with Creating Electrum and Restoring Bip39 * updates & fixes * Add missing case for no transactions BIP39 wallet restore * Make the default BIP39 the 84 derivation path * Add Samourai Deposit * litecoin mnemonic error fix * Bip39 passphrase support (#1412) * save * passphrase working * fix for when loading wallets + translation update * minor fix * Fix Nano * minor fix [skip ci] --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com> * change error state seed conditions into throwables [skip ci] * litecoin fixes * Bip39 minor enhancements (#1416) * minor enhancements * rename bitcoin_derivations -> electrum_derivations * Remove duplicate derivations handle default case * minor fix * Enable passphrase for Litecoin * obscure text of passphrase --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com> Co-authored-by: Justin Ehrenhofer <justin.ehrenhofer@gmail.com> Co-authored-by: fossephate <fosse@book.local>
2024-04-30 00:49:56 +00:00
}
Future<Uint8List> mnemonicToSeedBytes(String mnemonic,
{String prefix = segwit, String passphrase = ''}) async {
Bitcoin derivations (#1089) * - Update and Fix Conflicts with main * Add Balances for ERC20 tokens * Fix conflicts with main * Add erc20 abi json * Add send erc20 tokens initial function * add missing getHeightByDate in Haven [skip ci] * Allow contacts and wallets from the same tag * Add Shiba Inu icon * Add send ERC-20 tokens initial flow * Add missing import in generated file * Add initial approach for transaction sending for ERC-20 tokens * Refactor signing/sending transactions * Add initial flow for transactions subscription * Refactor signing/sending transactions * Add home settings icon * Fix conflicts with main * Initial flow for home settings * Add logic flow for adding erc20 tokens * Fix initial UI * Finalize UI for Tokens * Integrate UI with Ethereum flow * Add "Enable/Disable" feature for ERC20 tokens * Add initial Erc20 tokens * Add Sorting and Pin Native Token features * Fix price sorting * Sort tokens list as well when Sort criteria changes * - Improve sorting balances flow - Add initial add token from search bar flow * Fix Accounts Popup UI * Fix Pin native token * Fix Enabling/Disabling tokens Fix sorting by fiat once app is opened Improve token availability mechanism * Fix deleting token Fix renaming tokens * Fix issue with search * Add more tokens * - Fix scroll issue - Add ERC20 tokens placeholder image in picker * - Separate and organize default erc20 tokens - Fix scrolling - Add token placeholder images in picker - Sort disabled tokens alphabetically * Change BNB token initial availability [skip ci] * Fix Conflicts with main * Fix Conflicts with main * Add Verse ERC20 token to the initial tokens list * Add rename wallet to Ethereum * Integrate EtherScan API for fetching address transactions Generate Ethereum specific secrets in Ethereum package * Adjust transactions fiat price for ERC20 tokens * Free Up GitHub Actions Ubuntu Runner Disk Space * Free Up GitHub Actions Ubuntu Runner Disk space (trial 2) * Fix Transaction Fee display * Save transaction history * Enhance loading time for erc20 tokens transactions * Minor Fixes and Enhancements * Fix sending erc20 fix block explorer issue * Fix int overflow * Fix transaction amount conversions * Minor: `slow` -> `Slow` [skip-ci] * initial changes * more base config stuff * config changes * successfully builds! * save * successfully add nano wallet * save * seed generation * receive screen + node screen working * tx history working and fiat fixes * balance working * derivation updates * nano-unfinished * sends working * remove fees from send screen, send and receive transactions working * fixes + auto receive incoming txs * fix for scanning QR codes * save * update translations * fixes * more fixes * more strings * small fix * fix github actions workflow * potential fix * potential fix * ci/cd fix * change rep working * seed generation fixes * fixes * save * change rep screen functional * save * banano changes * fixes, start adding ui for PoW * pow node changes * update translations * fix * account changing barely working * save * disable account generation * small fix * save * UI work * save * fixes after merge main * fixes * remove monero stuff, work on derivation ui * lots of fixes + finish up seed derivation * last minute fixes * node related fixes * more fixes * small fix * more fixes * fixes * pretty big refactor for pow, still some bugs * finally works! * get transactions after send * fix * merge conflict fixes * save * fix pow node showing up twice * done * initial changes * small fix * more merge fixes * fixes * more fixes * fix * save * fix manage pow nodes setting appearing on other wallets * fix contact bug * fixes * fiat fixes * save * save * save * save * updates * cleanup * restore fix * fixes * remove deprecated alert * fix * small fix * remove outdated warning * electrum restore fixes * fixes * fixes * fix * derivation fixes * nano fixes pt.1 * nano fixes pt.2 * bip39 fixes * pownode refactor * nodes pages fixes * observer fix * ssl fix * remove old references * remove unused imports * code cleanup * small fix * small potential fix * save * derivation fixes * deterministic fix * fix pt.2 * derivation class fixes * review fixes from nano that also apply here * formatting * stuff that should've stayed deleted * post merge fixes * remove problematic imports and duplicate changes * Delete lib/nano/nano.dart * move wallet restore page proxy code to the view model * fix dashboard page indicators being the same color * debatably better refactoring of derivationInfo, migration needed * additional refactor improvements * blanket comment some stuff out to narrow down this issue * refactor fixes * fix nano exchange * fix , bug, i.e. replace , with . when making a nano transaction * fix nano sending, update restore page wording, and other minor fixes * write migration for existing bitcoin and nano wallets * merge fixes * minor fixes * use default derivation type when restoring from qr code * fixes for restoring * fixes * fixes * merge fix * Fix issues with Creating Electrum and Restoring Bip39 * updates & fixes * Add missing case for no transactions BIP39 wallet restore * Make the default BIP39 the 84 derivation path * Add Samourai Deposit * litecoin mnemonic error fix * Bip39 passphrase support (#1412) * save * passphrase working * fix for when loading wallets + translation update * minor fix * Fix Nano * minor fix [skip ci] --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com> * change error state seed conditions into throwables [skip ci] * litecoin fixes * Bip39 minor enhancements (#1416) * minor enhancements * rename bitcoin_derivations -> electrum_derivations * Remove duplicate derivations handle default case * minor fix * Enable passphrase for Litecoin * obscure text of passphrase --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com> Co-authored-by: Justin Ehrenhofer <justin.ehrenhofer@gmail.com> Co-authored-by: fossephate <fosse@book.local>
2024-04-30 00:49:56 +00:00
final pbkdf2 =
cryptography.Pbkdf2(macAlgorithm: cryptography.Hmac.sha512(), iterations: 2048, bits: 512);
final text = normalizeText(mnemonic);
final passphraseBytes = utf8.encode(normalizeText(passphrase));
2022-10-12 17:09:57 +00:00
final key = await pbkdf2.deriveKey(
secretKey: cryptography.SecretKey(text.codeUnits),
nonce: [...'electrum'.codeUnits, ...passphraseBytes]);
2022-10-12 17:09:57 +00:00
final bytes = await key.extractBytes();
return Uint8List.fromList(bytes);
}
litecoin mweb support (#1455) * Fix stub creation * Generate MWEB addresses * Fix mweb address derivation * Use camel-case * Show utxos in tx list * A few fixes * Add spent processing * Update balance * Balance fixes * Update address records * Get rid of debounce hack * Get sending up to the confirmation box * Fee estimation * Stop the daemon if plugin is unloaded * Normal fee for non-mweb txns * Fix fee estimation for send all * Don't hash mweb addresses * More fee fixes * Broadcast mweb * Remove test files * One more * Confirm sent txns * Couple of fixes * Resign inputs after mweb create * Some more fixes * Update balance after sending * Correctly update address records * Update confs * [skip ci] updates * [skip ci] add dep overrides * working * small fix * merge fixes [skip ci] * merge fixes [skip ci] * [skip ci] minor fixes * silent payment fixes [skip ci] * updates [skip ci] * save [skip ci] * use mwebutxos box * [skip ci] lots of fixes, still testing * add rescan from height feature and test workflow build * install go * use sudo * correct package name * move building mweb higher for faster testing * install fixes * install later version of go * go fixes * testing * testing * testing * testing * testing * should workgit add .github/workflows/pr_test_build.yml * ??? * ??? pt.2 * should work, for real this time * fix tx history not persisting + update build_mwebd script * updates * fix some rescan and address gen issues * save [skip ci] * fix unconfirmed balance not updating when receiving * unspent coins / coin control fixes * coin control fixes * address balance and txCount fixes, try/catch electrum call * fix txCount for addresses * save [skip ci] * potential fixes * minor fix * minor fix - 2 * sync status fixes, potential fix for background state issue * workflow and script updates * updates * expirimental optimization * [skip ci] minor enhancements * workflow and script fixes * workflow minor cleanup [skip ci] * minor code cleanup & friendlier error message on failed tx's * balance when sending fix * experimental * more experiments * save * updates * coin control edge cases * remove neutrino.db if no litecoin wallets left after deleting * update translations * updates * minor fix * [skip ci] update translations + minor fixes * state fixes * configure fix * ui updates * translation fixes * [skip ci] addressbook updates * fix popup * fix popup2 * fix litecoin address book * fix ios mwebd build script * fix for building monero.com * minor fix * uncomment fix for state issues * potential mweb sync fix (ios) * remove print [skip ci] * electrum stream potential fix * fix ios build issues [skip ci] * connection reliability updates, update kotlin code to match swift code, minor electrum error handling * dep fixes * minor fix * more merge fixes * bitcoin_flutter removal fixes * [skip ci] fix always scan setting, swift updates * updates * fixes * small fix * small fix * fix * dart:convert != package:convert * change address fixes * update bitcoin_base to fix mweb address program checking * fix ios xcode project [skip ci] * updates * more fixes * more fixes * ensure we don't initialize mweb until we really have to * fix regression * improve mweb reliability * [skip ci] wip adress generation * wip * wip * [skip ci] wip * updates [skip ci] * ios fixes * fix workflows + ios fix * test old mweb version * update go version and mwebd hash * review updates pt.1 * Update cw_bitcoin/lib/litecoin_wallet.dart Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> * remove non-litecoin address types regex [skip ci] * more minor fixes * remove duplicate [skip ci] * Update lib/store/settings_store.dart Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> * script updates, swap params on createLitecoinWalletService * topup fix * [skip ci] wip * [skip ci] testing * [skip ci] file didn't get saved * more address generation reliability fixes * [skip ci] minor * minor code cleanup * hopefully prevents send issue * [skip ci] wip address changes * [skip ci] save * save mweb addresses, auto-restart sync process if it gets stuck [skip ci] * address generation issues mostly resolved * more performance fixes * [skip ci] * this should maybe be refactored, pt.1 * separate mweb balances, pt.2 * [skip ci] save * add translations [skip ci] * fix sending with mweb amounts * works for simple mweb-mweb case, further testing needed * found an edge case * [skip ci] make failed broadcast error message less serious * minor * capture all grpc errors and much better error handling overall * [skip ci] minor * prevent transactions with < 6 confirmations from being used + hide mweb balances if mweb is off * fix * merge fixes pt.1 [skip ci] * fix mweb tags * fix * [skip ci] fix tag spacing * fix transaction history not showing up * fix mweb crash on non-fully deleted mweb cache, sync status ETA, other connection fixes * [skip ci] minor code cleanup * [skip ci] minor code cleanup * additional cleanup * silent payments eta fixes and updates * revert sync eta changes into separate pr * [skip ci] minor * [skip ci] minor * revert sync status title * review fixes, additional cleanup * [skip ci] minor * [skip ci] minor * [skip ci] minor * trigger build * review fixes, pt.2 * check if still processing utxos before updating sync status [skip ci] * [skip ci] minor * balance fix * minor * minor * [skip ci] minor * [skip ci] fix test net btc * don't use mwebd for non-mweb tx's * [skip ci] minor cleanup * don't show all 1000+ mweb addresses on receive page * minor cleanup + additional logging --------- Co-authored-by: Hector Chu <hectorchu@gmail.com> Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
2024-09-28 02:22:25 +00:00
bool matchesAnyPrefix(String mnemonic) => prefixMatches(mnemonic, [segwit, mweb]).any((el) => el);
bool validateMnemonic(String mnemonic, {String prefix = segwit}) {
try {
return matchesAnyPrefix(mnemonic);
} catch (e) {
return false;
}
}
final englishWordlist = <String>[
'abandon',
'ability',
'able',
'about',
'above',
'absent',
'absorb',
'abstract',
'absurd',
'abuse',
'access',
'accident',
'account',
'accuse',
'achieve',
'acid',
'acoustic',
'acquire',
'across',
'act',
'action',
'actor',
'actress',
'actual',
'adapt',
'add',
'addict',
'address',
'adjust',
'admit',
'adult',
'advance',
'advice',
'aerobic',
'affair',
'afford',
'afraid',
'again',
'age',
'agent',
'agree',
'ahead',
'aim',
'air',
'airport',
'aisle',
'alarm',
'album',
'alcohol',
'alert',
'alien',
'all',
'alley',
'allow',
'almost',
'alone',
'alpha',
'already',
'also',
'alter',
'always',
'amateur',
'amazing',
'among',
'amount',
'amused',
'analyst',
'anchor',
'ancient',
'anger',
'angle',
'angry',
'animal',
'ankle',
'announce',
'annual',
'another',
'answer',
'antenna',
'antique',
'anxiety',
'any',
'apart',
'apology',
'appear',
'apple',
'approve',
'april',
'arch',
'arctic',
'area',
'arena',
'argue',
'arm',
'armed',
'armor',
'army',
'around',
'arrange',
'arrest',
'arrive',
'arrow',
'art',
'artefact',
'artist',
'artwork',
'ask',
'aspect',
'assault',
'asset',
'assist',
'assume',
'asthma',
'athlete',
'atom',
'attack',
'attend',
'attitude',
'attract',
'auction',
'audit',
'august',
'aunt',
'author',
'auto',
'autumn',
'average',
'avocado',
'avoid',
'awake',
'aware',
'away',
'awesome',
'awful',
'awkward',
'axis',
'baby',
'bachelor',
'bacon',
'badge',
'bag',
'balance',
'balcony',
'ball',
'bamboo',
'banana',
'banner',
'bar',
'barely',
'bargain',
'barrel',
'base',
'basic',
'basket',
'battle',
'beach',
'bean',
'beauty',
'because',
'become',
'beef',
'before',
'begin',
'behave',
'behind',
'believe',
'below',
'belt',
'bench',
'benefit',
'best',
'betray',
'better',
'between',
'beyond',
'bicycle',
'bid',
'bike',
'bind',
'biology',
'bird',
'birth',
'bitter',
'black',
'blade',
'blame',
'blanket',
'blast',
'bleak',
'bless',
'blind',
'blood',
'blossom',
'blouse',
'blue',
'blur',
'blush',
'board',
'boat',
'body',
'boil',
'bomb',
'bone',
'bonus',
'book',
'boost',
'border',
'boring',
'borrow',
'boss',
'bottom',
'bounce',
'box',
'boy',
'bracket',
'brain',
'brand',
'brass',
'brave',
'bread',
'breeze',
'brick',
'bridge',
'brief',
'bright',
'bring',
'brisk',
'broccoli',
'broken',
'bronze',
'broom',
'brother',
'brown',
'brush',
'bubble',
'buddy',
'budget',
'buffalo',
'build',
'bulb',
'bulk',
'bullet',
'bundle',
'bunker',
'burden',
'burger',
'burst',
'bus',
'business',
'busy',
'butter',
'buyer',
'buzz',
'cabbage',
'cabin',
'cable',
'cactus',
'cage',
'cake',
'call',
'calm',
'camera',
'camp',
'can',
'canal',
'cancel',
'candy',
'cannon',
'canoe',
'canvas',
'canyon',
'capable',
'capital',
'captain',
'car',
'carbon',
'card',
'cargo',
'carpet',
'carry',
'cart',
'case',
'cash',
'casino',
'castle',
'casual',
'cat',
'catalog',
'catch',
'category',
'cattle',
'caught',
'cause',
'caution',
'cave',
'ceiling',
'celery',
'cement',
'census',
'century',
'cereal',
'certain',
'chair',
'chalk',
'champion',
'change',
'chaos',
'chapter',
'charge',
'chase',
'chat',
'cheap',
'check',
'cheese',
'chef',
'cherry',
'chest',
'chicken',
'chief',
'child',
'chimney',
'choice',
'choose',
'chronic',
'chuckle',
'chunk',
'churn',
'cigar',
'cinnamon',
'circle',
'citizen',
'city',
'civil',
'claim',
'clap',
'clarify',
'claw',
'clay',
'clean',
'clerk',
'clever',
'click',
'client',
'cliff',
'climb',
'clinic',
'clip',
'clock',
'clog',
'close',
'cloth',
'cloud',
'clown',
'club',
'clump',
'cluster',
'clutch',
'coach',
'coast',
'coconut',
'code',
'coffee',
'coil',
'coin',
'collect',
'color',
'column',
'combine',
'come',
'comfort',
'comic',
'common',
'company',
'concert',
'conduct',
'confirm',
'congress',
'connect',
'consider',
'control',
'convince',
'cook',
'cool',
'copper',
'copy',
'coral',
'core',
'corn',
'correct',
'cost',
'cotton',
'couch',
'country',
'couple',
'course',
'cousin',
'cover',
'coyote',
'crack',
'cradle',
'craft',
'cram',
'crane',
'crash',
'crater',
'crawl',
'crazy',
'cream',
'credit',
'creek',
'crew',
'cricket',
'crime',
'crisp',
'critic',
'crop',
'cross',
'crouch',
'crowd',
'crucial',
'cruel',
'cruise',
'crumble',
'crunch',
'crush',
'cry',
'crystal',
'cube',
'culture',
'cup',
'cupboard',
'curious',
'current',
'curtain',
'curve',
'cushion',
'custom',
'cute',
'cycle',
'dad',
'damage',
'damp',
'dance',
'danger',
'daring',
'dash',
'daughter',
'dawn',
'day',
'deal',
'debate',
'debris',
'decade',
'december',
'decide',
'decline',
'decorate',
'decrease',
'deer',
'defense',
'define',
'defy',
'degree',
'delay',
'deliver',
'demand',
'demise',
'denial',
'dentist',
'deny',
'depart',
'depend',
'deposit',
'depth',
'deputy',
'derive',
'describe',
'desert',
'design',
'desk',
'despair',
'destroy',
'detail',
'detect',
'develop',
'device',
'devote',
'diagram',
'dial',
'diamond',
'diary',
'dice',
'diesel',
'diet',
'differ',
'digital',
'dignity',
'dilemma',
'dinner',
'dinosaur',
'direct',
'dirt',
'disagree',
'discover',
'disease',
'dish',
'dismiss',
'disorder',
'display',
'distance',
'divert',
'divide',
'divorce',
'dizzy',
'doctor',
'document',
'dog',
'doll',
'dolphin',
'domain',
'donate',
'donkey',
'donor',
'door',
'dose',
'double',
'dove',
'draft',
'dragon',
'drama',
'drastic',
'draw',
'dream',
'dress',
'drift',
'drill',
'drink',
'drip',
'drive',
'drop',
'drum',
'dry',
'duck',
'dumb',
'dune',
'during',
'dust',
'dutch',
'duty',
'dwarf',
'dynamic',
'eager',
'eagle',
'early',
'earn',
'earth',
'easily',
'east',
'easy',
'echo',
'ecology',
'economy',
'edge',
'edit',
'educate',
'effort',
'egg',
'eight',
'either',
'elbow',
'elder',
'electric',
'elegant',
'element',
'elephant',
'elevator',
'elite',
'else',
'embark',
'embody',
'embrace',
'emerge',
'emotion',
'employ',
'empower',
'empty',
'enable',
'enact',
'end',
'endless',
'endorse',
'enemy',
'energy',
'enforce',
'engage',
'engine',
'enhance',
'enjoy',
'enlist',
'enough',
'enrich',
'enroll',
'ensure',
'enter',
'entire',
'entry',
'envelope',
'episode',
'equal',
'equip',
'era',
'erase',
'erode',
'erosion',
'error',
'erupt',
'escape',
'essay',
'essence',
'estate',
'eternal',
'ethics',
'evidence',
'evil',
'evoke',
'evolve',
'exact',
'example',
'excess',
'exchange',
'excite',
'exclude',
'excuse',
'execute',
'exercise',
'exhaust',
'exhibit',
'exile',
'exist',
'exit',
'exotic',
'expand',
'expect',
'expire',
'explain',
'expose',
'express',
'extend',
'extra',
'eye',
'eyebrow',
'fabric',
'face',
'faculty',
'fade',
'faint',
'faith',
'fall',
'false',
'fame',
'family',
'famous',
'fan',
'fancy',
'fantasy',
'farm',
'fashion',
'fat',
'fatal',
'father',
'fatigue',
'fault',
'favorite',
'feature',
'february',
'federal',
'fee',
'feed',
'feel',
'female',
'fence',
'festival',
'fetch',
'fever',
'few',
'fiber',
'fiction',
'field',
'figure',
'file',
'film',
'filter',
'final',
'find',
'fine',
'finger',
'finish',
'fire',
'firm',
'first',
'fiscal',
'fish',
'fit',
'fitness',
'fix',
'flag',
'flame',
'flash',
'flat',
'flavor',
'flee',
'flight',
'flip',
'float',
'flock',
'floor',
'flower',
'fluid',
'flush',
'fly',
'foam',
'focus',
'fog',
'foil',
'fold',
'follow',
'food',
'foot',
'force',
'forest',
'forget',
'fork',
'fortune',
'forum',
'forward',
'fossil',
'foster',
'found',
'fox',
'fragile',
'frame',
'frequent',
'fresh',
'friend',
'fringe',
'frog',
'front',
'frost',
'frown',
'frozen',
'fruit',
'fuel',
'fun',
'funny',
'furnace',
'fury',
'future',
'gadget',
'gain',
'galaxy',
'gallery',
'game',
'gap',
'garage',
'garbage',
'garden',
'garlic',
'garment',
'gas',
'gasp',
'gate',
'gather',
'gauge',
'gaze',
'general',
'genius',
'genre',
'gentle',
'genuine',
'gesture',
'ghost',
'giant',
'gift',
'giggle',
'ginger',
'giraffe',
'girl',
'give',
'glad',
'glance',
'glare',
'glass',
'glide',
'glimpse',
'globe',
'gloom',
'glory',
'glove',
'glow',
'glue',
'goat',
'goddess',
'gold',
'good',
'goose',
'gorilla',
'gospel',
'gossip',
'govern',
'gown',
'grab',
'grace',
'grain',
'grant',
'grape',
'grass',
'gravity',
'great',
'green',
'grid',
'grief',
'grit',
'grocery',
'group',
'grow',
'grunt',
'guard',
'guess',
'guide',
'guilt',
'guitar',
'gun',
'gym',
'habit',
'hair',
'half',
'hammer',
'hamster',
'hand',
'happy',
'harbor',
'hard',
'harsh',
'harvest',
'hat',
'have',
'hawk',
'hazard',
'head',
'health',
'heart',
'heavy',
'hedgehog',
'height',
'hello',
'helmet',
'help',
'hen',
'hero',
'hidden',
'high',
'hill',
'hint',
'hip',
'hire',
'history',
'hobby',
'hockey',
'hold',
'hole',
'holiday',
'hollow',
'home',
'honey',
'hood',
'hope',
'horn',
'horror',
'horse',
'hospital',
'host',
'hotel',
'hour',
'hover',
'hub',
'huge',
'human',
'humble',
'humor',
'hundred',
'hungry',
'hunt',
'hurdle',
'hurry',
'hurt',
'husband',
'hybrid',
'ice',
'icon',
'idea',
'identify',
'idle',
'ignore',
'ill',
'illegal',
'illness',
'image',
'imitate',
'immense',
'immune',
'impact',
'impose',
'improve',
'impulse',
'inch',
'include',
'income',
'increase',
'index',
'indicate',
'indoor',
'industry',
'infant',
'inflict',
'inform',
'inhale',
'inherit',
'initial',
'inject',
'injury',
'inmate',
'inner',
'innocent',
'input',
'inquiry',
'insane',
'insect',
'inside',
'inspire',
'install',
'intact',
'interest',
'into',
'invest',
'invite',
'involve',
'iron',
'island',
'isolate',
'issue',
'item',
'ivory',
'jacket',
'jaguar',
'jar',
'jazz',
'jealous',
'jeans',
'jelly',
'jewel',
'job',
'join',
'joke',
'journey',
'joy',
'judge',
'juice',
'jump',
'jungle',
'junior',
'junk',
'just',
'kangaroo',
'keen',
'keep',
'ketchup',
'key',
'kick',
'kid',
'kidney',
'kind',
'kingdom',
'kiss',
'kit',
'kitchen',
'kite',
'kitten',
'kiwi',
'knee',
'knife',
'knock',
'know',
'lab',
'label',
'labor',
'ladder',
'lady',
'lake',
'lamp',
'language',
'laptop',
'large',
'later',
'latin',
'laugh',
'laundry',
'lava',
'law',
'lawn',
'lawsuit',
'layer',
'lazy',
'leader',
'leaf',
'learn',
'leave',
'lecture',
'left',
'leg',
'legal',
'legend',
'leisure',
'lemon',
'lend',
'length',
'lens',
'leopard',
'lesson',
'letter',
'level',
'liar',
'liberty',
'library',
'license',
'life',
'lift',
'light',
'like',
'limb',
'limit',
'link',
'lion',
'liquid',
'list',
'little',
'live',
'lizard',
'load',
'loan',
'lobster',
'local',
'lock',
'logic',
'lonely',
'long',
'loop',
'lottery',
'loud',
'lounge',
'love',
'loyal',
'lucky',
'luggage',
'lumber',
'lunar',
'lunch',
'luxury',
'lyrics',
'machine',
'mad',
'magic',
'magnet',
'maid',
'mail',
'main',
'major',
'make',
'mammal',
'man',
'manage',
'mandate',
'mango',
'mansion',
'manual',
'maple',
'marble',
'march',
'margin',
'marine',
'market',
'marriage',
'mask',
'mass',
'master',
'match',
'material',
'math',
'matrix',
'matter',
'maximum',
'maze',
'meadow',
'mean',
'measure',
'meat',
'mechanic',
'medal',
'media',
'melody',
'melt',
'member',
'memory',
'mention',
'menu',
'mercy',
'merge',
'merit',
'merry',
'mesh',
'message',
'metal',
'method',
'middle',
'midnight',
'milk',
'million',
'mimic',
'mind',
'minimum',
'minor',
'minute',
'miracle',
'mirror',
'misery',
'miss',
'mistake',
'mix',
'mixed',
'mixture',
'mobile',
'model',
'modify',
'mom',
'moment',
'monitor',
'monkey',
'monster',
'month',
'moon',
'moral',
'more',
'morning',
'mosquito',
'mother',
'motion',
'motor',
'mountain',
'mouse',
'move',
'movie',
'much',
'muffin',
'mule',
'multiply',
'muscle',
'museum',
'mushroom',
'music',
'must',
'mutual',
'myself',
'mystery',
'myth',
'naive',
'name',
'napkin',
'narrow',
'nasty',
'nation',
'nature',
'near',
'neck',
'need',
'negative',
'neglect',
'neither',
'nephew',
'nerve',
'nest',
'net',
'network',
'neutral',
'never',
'news',
'next',
'nice',
'night',
'noble',
'noise',
'nominee',
'noodle',
'normal',
'north',
'nose',
'notable',
'note',
'nothing',
'notice',
'novel',
'now',
'nuclear',
'number',
'nurse',
'nut',
'oak',
'obey',
'object',
'oblige',
'obscure',
'observe',
'obtain',
'obvious',
'occur',
'ocean',
'october',
'odor',
'off',
'offer',
'office',
'often',
'oil',
'okay',
'old',
'olive',
'olympic',
'omit',
'once',
'one',
'onion',
'online',
'only',
'open',
'opera',
'opinion',
'oppose',
'option',
'orange',
'orbit',
'orchard',
'order',
'ordinary',
'organ',
'orient',
'original',
'orphan',
'ostrich',
'other',
'outdoor',
'outer',
'output',
'outside',
'oval',
'oven',
'over',
'own',
'owner',
'oxygen',
'oyster',
'ozone',
'pact',
'paddle',
'page',
'pair',
'palace',
'palm',
'panda',
'panel',
'panic',
'panther',
'paper',
'parade',
'parent',
'park',
'parrot',
'party',
'pass',
'patch',
'path',
'patient',
'patrol',
'pattern',
'pause',
'pave',
'payment',
'peace',
'peanut',
'pear',
'peasant',
'pelican',
'pen',
'penalty',
'pencil',
'people',
'pepper',
'perfect',
'permit',
'person',
'pet',
'phone',
'photo',
'phrase',
'physical',
'piano',
'picnic',
'picture',
'piece',
'pig',
'pigeon',
'pill',
'pilot',
'pink',
'pioneer',
'pipe',
'pistol',
'pitch',
'pizza',
'place',
'planet',
'plastic',
'plate',
'play',
'please',
'pledge',
'pluck',
'plug',
'plunge',
'poem',
'poet',
'point',
'polar',
'pole',
'police',
'pond',
'pony',
'pool',
'popular',
'portion',
'position',
'possible',
'post',
'potato',
'pottery',
'poverty',
'powder',
'power',
'practice',
'praise',
'predict',
'prefer',
'prepare',
'present',
'pretty',
'prevent',
'price',
'pride',
'primary',
'print',
'priority',
'prison',
'private',
'prize',
'problem',
'process',
'produce',
'profit',
'program',
'project',
'promote',
'proof',
'property',
'prosper',
'protect',
'proud',
'provide',
'public',
'pudding',
'pull',
'pulp',
'pulse',
'pumpkin',
'punch',
'pupil',
'puppy',
'purchase',
'purity',
'purpose',
'purse',
'push',
'put',
'puzzle',
'pyramid',
'quality',
'quantum',
'quarter',
'question',
'quick',
'quit',
'quiz',
'quote',
'rabbit',
'raccoon',
'race',
'rack',
'radar',
'radio',
'rail',
'rain',
'raise',
'rally',
'ramp',
'ranch',
'random',
'range',
'rapid',
'rare',
'rate',
'rather',
'raven',
'raw',
'razor',
'ready',
'real',
'reason',
'rebel',
'rebuild',
'recall',
'receive',
'recipe',
'record',
'recycle',
'reduce',
'reflect',
'reform',
'refuse',
'region',
'regret',
'regular',
'reject',
'relax',
'release',
'relief',
'rely',
'remain',
'remember',
'remind',
'remove',
'render',
'renew',
'rent',
'reopen',
'repair',
'repeat',
'replace',
'report',
'require',
'rescue',
'resemble',
'resist',
'resource',
'response',
'result',
'retire',
'retreat',
'return',
'reunion',
'reveal',
'review',
'reward',
'rhythm',
'rib',
'ribbon',
'rice',
'rich',
'ride',
'ridge',
'rifle',
'right',
'rigid',
'ring',
'riot',
'ripple',
'risk',
'ritual',
'rival',
'river',
'road',
'roast',
'robot',
'robust',
'rocket',
'romance',
'roof',
'rookie',
'room',
'rose',
'rotate',
'rough',
'round',
'route',
'royal',
'rubber',
'rude',
'rug',
'rule',
'run',
'runway',
'rural',
'sad',
'saddle',
'sadness',
'safe',
'sail',
'salad',
'salmon',
'salon',
'salt',
'salute',
'same',
'sample',
'sand',
'satisfy',
'satoshi',
'sauce',
'sausage',
'save',
'say',
'scale',
'scan',
'scare',
'scatter',
'scene',
'scheme',
'school',
'science',
'scissors',
'scorpion',
'scout',
'scrap',
'screen',
'script',
'scrub',
'sea',
'search',
'season',
'seat',
'second',
'secret',
'section',
'security',
'seed',
'seek',
'segment',
'select',
'sell',
'seminar',
'senior',
'sense',
'sentence',
'series',
'service',
'session',
'settle',
'setup',
'seven',
'shadow',
'shaft',
'shallow',
'share',
'shed',
'shell',
'sheriff',
'shield',
'shift',
'shine',
'ship',
'shiver',
'shock',
'shoe',
'shoot',
'shop',
'short',
'shoulder',
'shove',
'shrimp',
'shrug',
'shuffle',
'shy',
'sibling',
'sick',
'side',
'siege',
'sight',
'sign',
'silent',
'silk',
'silly',
'silver',
'similar',
'simple',
'since',
'sing',
'siren',
'sister',
'situate',
'six',
'size',
'skate',
'sketch',
'ski',
'skill',
'skin',
'skirt',
'skull',
'slab',
'slam',
'sleep',
'slender',
'slice',
'slide',
'slight',
'slim',
'slogan',
'slot',
'slow',
'slush',
'small',
'smart',
'smile',
'smoke',
'smooth',
'snack',
'snake',
'snap',
'sniff',
'snow',
'soap',
'soccer',
'social',
'sock',
'soda',
'soft',
'solar',
'soldier',
'solid',
'solution',
'solve',
'someone',
'song',
'soon',
'sorry',
'sort',
'soul',
'sound',
'soup',
'source',
'south',
'space',
'spare',
'spatial',
'spawn',
'speak',
'special',
'speed',
'spell',
'spend',
'sphere',
'spice',
'spider',
'spike',
'spin',
'spirit',
'split',
'spoil',
'sponsor',
'spoon',
'sport',
'spot',
'spray',
'spread',
'spring',
'spy',
'square',
'squeeze',
'squirrel',
'stable',
'stadium',
'staff',
'stage',
'stairs',
'stamp',
'stand',
'start',
'state',
'stay',
'steak',
'steel',
'stem',
'step',
'stereo',
'stick',
'still',
'sting',
'stock',
'stomach',
'stone',
'stool',
'story',
'stove',
'strategy',
'street',
'strike',
'strong',
'struggle',
'student',
'stuff',
'stumble',
'style',
'subject',
'submit',
'subway',
'success',
'such',
'sudden',
'suffer',
'sugar',
'suggest',
'suit',
'summer',
'sun',
'sunny',
'sunset',
'super',
'supply',
'supreme',
'sure',
'surface',
'surge',
'surprise',
'surround',
'survey',
'suspect',
'sustain',
'swallow',
'swamp',
'swap',
'swarm',
'swear',
'sweet',
'swift',
'swim',
'swing',
'switch',
'sword',
'symbol',
'symptom',
'syrup',
'system',
'table',
'tackle',
'tag',
'tail',
'talent',
'talk',
'tank',
'tape',
'target',
'task',
'taste',
'tattoo',
'taxi',
'teach',
'team',
'tell',
'ten',
'tenant',
'tennis',
'tent',
'term',
'test',
'text',
'thank',
'that',
'theme',
'then',
'theory',
'there',
'they',
'thing',
'this',
'thought',
'three',
'thrive',
'throw',
'thumb',
'thunder',
'ticket',
'tide',
'tiger',
'tilt',
'timber',
'time',
'tiny',
'tip',
'tired',
'tissue',
'title',
'toast',
'tobacco',
'today',
'toddler',
'toe',
'together',
'toilet',
'token',
'tomato',
'tomorrow',
'tone',
'tongue',
'tonight',
'tool',
'tooth',
'top',
'topic',
'topple',
'torch',
'tornado',
'tortoise',
'toss',
'total',
'tourist',
'toward',
'tower',
'town',
'toy',
'track',
'trade',
'traffic',
'tragic',
'train',
'transfer',
'trap',
'trash',
'travel',
'tray',
'treat',
'tree',
'trend',
'trial',
'tribe',
'trick',
'trigger',
'trim',
'trip',
'trophy',
'trouble',
'truck',
'true',
'truly',
'trumpet',
'trust',
'truth',
'try',
'tube',
'tuition',
'tumble',
'tuna',
'tunnel',
'turkey',
'turn',
'turtle',
'twelve',
'twenty',
'twice',
'twin',
'twist',
'two',
'type',
'typical',
'ugly',
'umbrella',
'unable',
'unaware',
'uncle',
'uncover',
'under',
'undo',
'unfair',
'unfold',
'unhappy',
'uniform',
'unique',
'unit',
'universe',
'unknown',
'unlock',
'until',
'unusual',
'unveil',
'update',
'upgrade',
'uphold',
'upon',
'upper',
'upset',
'urban',
'urge',
'usage',
'use',
'used',
'useful',
'useless',
'usual',
'utility',
'vacant',
'vacuum',
'vague',
'valid',
'valley',
'valve',
'van',
'vanish',
'vapor',
'various',
'vast',
'vault',
'vehicle',
'velvet',
'vendor',
'venture',
'venue',
'verb',
'verify',
'version',
'very',
'vessel',
'veteran',
'viable',
'vibrant',
'vicious',
'victory',
'video',
'view',
'village',
'vintage',
'violin',
'virtual',
'virus',
'visa',
'visit',
'visual',
'vital',
'vivid',
'vocal',
'voice',
'void',
'volcano',
'volume',
'vote',
'voyage',
'wage',
'wagon',
'wait',
'walk',
'wall',
'walnut',
'want',
'warfare',
'warm',
'warrior',
'wash',
'wasp',
'waste',
'water',
'wave',
'way',
'wealth',
'weapon',
'wear',
'weasel',
'weather',
'web',
'wedding',
'weekend',
'weird',
'welcome',
'west',
'wet',
'whale',
'what',
'wheat',
'wheel',
'when',
'where',
'whip',
'whisper',
'wide',
'width',
'wife',
'wild',
'will',
'win',
'window',
'wine',
'wing',
'wink',
'winner',
'winter',
'wire',
'wisdom',
'wise',
'wish',
'witness',
'wolf',
'woman',
'wonder',
'wood',
'wool',
'word',
'work',
'world',
'worry',
'worth',
'wrap',
'wreck',
'wrestle',
'wrist',
'write',
'wrong',
'yard',
'year',
'yellow',
'you',
'young',
'youth',
'zebra',
'zero',
'zone',
'zoo'
];