Bitcoin Forum
September 16, 2019, 05:17:51 PM *
News: Latest Bitcoin Core release: 0.18.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Math problem regarding recovery seed  (Read 555 times)
BldSwtTrs
Legendary
*
Offline Offline

Activity: 971
Merit: 1002


View Profile
January 05, 2019, 12:59:41 AM
 #1

Hi,

I have a math problem regarding my recovery seed for the Ledger Nano S.

There are 24 words. I have written down the 24 words. But as an encryption method, I have inverted the position of two of these words, two times.

I thought I know eaxctly whose of those words were inverted, but apparently this is not the case because when I enter the words in the order that I thought would be correct, this is not a valid seed.

So you could say I am very stupid, but anyway, let's work with that.

So I have 24 words. 20 words are in the right position, and 4 words are in the wrong position. I don't know which words are in good position and which words are in a bad position.

How many possibilities there are?
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1568654271
Hero Member
*
Offline Offline

Posts: 1568654271

View Profile Personal Message (Offline)

Ignore
1568654271
Reply with quote  #2

1568654271
Report to moderator
1568654271
Hero Member
*
Offline Offline

Posts: 1568654271

View Profile Personal Message (Offline)

Ignore
1568654271
Reply with quote  #2

1568654271
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 1890
Merit: 2736


bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl


View Profile WWW
January 05, 2019, 01:36:23 AM
 #2

What do you mean by "inverted the position of two of those words, two times"? How exactly you did that will affect the number of possibilities (as some orderings could be ruled out).

The upper bound to this is (24 choose 4) * 4! = 255024. (24 choose 4) is the number of ways you can choose 4 items from a set of 24 elements. 4! is the number of ways you can order those 4 elements. This is a multiplication since for each way you can choose 4 items, there are 4! ways you can rearrange them.

BldSwtTrs
Legendary
*
Offline Offline

Activity: 971
Merit: 1002


View Profile
January 05, 2019, 02:01:23 AM
Last edit: January 05, 2019, 02:13:36 AM by BldSwtTrs
 #3

What do you mean by "inverted the position of two of those words, two times"? How exactly you did that will affect the number of possibilities (as some orderings could be ruled out).

The upper bound to this is (24 choose 4) * 4! = 255024. (24 choose 4) is the number of ways you can choose 4 items from a set of 24 elements. 4! is the number of ways you can order those 4 elements. This is a multiplication since for each way you can choose 4 items, there are 4! ways you can rearrange them.
Let's say the seed is:
Word1 Word2 Word3 Word4 Word5 Word6 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word19 Word20 Word21 Word22 Word23 Word24

Well, my "encryption" technique was to write in that order:
Word1 Word23 Word3 Word21 Word5 Word6 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word19 Word20 Word4 Word22 Word2 Word24

So I switched Word2 <> Word23 and Word21 <> Word4

But when I try to revert that, this doesn't work. So I must have screwed up somewhere. My hypothesis is that I have inverted the "wrong" words, but I don't know which ones.
The inversion should have been made in a symetrical position, like in my example.
But since I screw up, maybe I have switched words in a non symetrical position.
BldSwtTrs
Legendary
*
Offline Offline

Activity: 971
Merit: 1002


View Profile
January 05, 2019, 02:24:02 AM
Last edit: January 05, 2019, 02:39:59 AM by BldSwtTrs
 #4

I am not sure exactly what I did either...

I have 24 words, I am pretty sure there are correct.

I am also pretty sure most of them are in the right position. Only few of them, probably 4, are not in a correct position, because I used to move the position of 4 words for my "encryption" .
But now I don't know which 20 words are in the right position. I think the fact that there is 20 words in the right position, even if we don't know which, allows to greatly reduce the number of combination.
pooya87
Legendary
*
Offline Offline

Activity: 1764
Merit: 1874


Remember tonight for it's the beginning of forever


View Profile
January 05, 2019, 04:02:39 AM
 #5

(24 choose 4) is the number of ways you can choose 4 items from a set of 24 elements. 4! is the number of ways you can order those 4 elements.

it can not be 4! because after choosing the 4 words there is no difference between changing the position of (1 with 2) and (2 with 1). the number of possible combinations are 7:
1234
2134
3214
4231
1324
1432
1243

the number of possibilities can be further reduced if we exclude cases like swapping Word5 and word6 (two consecutive words)

achow101
Moderator
Legendary
*
Offline Offline

Activity: 1890
Merit: 2736


bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl


View Profile WWW
January 05, 2019, 05:23:16 AM
 #6

it can not be 4! because after choosing the 4 words there is no difference between changing the position of (1 with 2) and (2 with 1). the number of possible combinations are 7:
Indeed. This reduces the number of possibilities to 74382. This is definitely brute forceable in probably a few minutes at most.

Coding Enthusiast
Hero Member
*****
Offline Offline

Activity: 666
Merit: 1027


Novice C♯ Coder


View Profile WWW
January 05, 2019, 05:35:02 AM
Last edit: January 05, 2019, 09:50:52 AM by Coding Enthusiast
Merited by BldSwtTrs (50), bones261 (5), achow101 (3), LoyceV (3), ETFbitcoin (2), xandry (2), OgNasty (1), vapourminer (1), NeuroticFish (1), HeRetiK (1), khaled0111 (1), xtraelv (1), o_e_l_e_o (1), MagicByt3 (1)
 #7

Code:
namespace SeedCracker
{
    class Program
    {
        static void Main(string[] args)
        {
            string origin = "adjust concert sun teach sting ivory dentist increase hammer snake abandon loyal poem write tiger manage earth win slot weird rapid flat believe rhythm";
            string[] words = origin.Split(' ');

            for (int i = 0; i < words.Length; i++)
            {
                for (int j = i + 1; j < words.Length; j++)
                {
                    string[] clone1 = (string[])words.Clone();
                    string temp = clone1[i];
                    clone1[i] = clone1[j];
                    clone1[j] = temp;

                    for (int k = i + 1; k < words.Length; k++)
                    {
                        if (k == j)
                        {
                            continue;
                        }
                        for (int m = k + 1; m < words.Length; m++)
                        {
                            if (m == j)
                            {
                                continue;
                            }
                            string[] clone2 = (string[])clone1.Clone();
                            string temp2 = clone2[k];
                            clone2[k] = clone2[m];
                            clone2[m] = temp2;

                            string origNew = string.Join(' ', clone2);

                            // Pass origNew to your BIP39 to get the BIP32 out of it
                            // Use m/44'/0'/0' as path
                            // Check the privatekey/publickey/address of index 0,1,2... (depending on what you have) against the result
                            // Print seed if equal and break out of the loop.
                        }
                    }
                }
            }
            Console.ReadLine();
        }
    }
}

The original seed that I changed was (randomly generated using https://iancoleman.io/bip39/):
Code:
adjust concert sun rapid sting ivory dentist increase write snake abandon loyal poem hammer tiger manage earth win slot weird teach flat believe rhythm

The total count of this loop is 31878 and the correct seed was found after 16729 iterations.
It takes about 20 minutes to find the correct answer but it may be reduced if the code was optimized (which mine isn't).
The commented part above is like this:
Code:
using CryptoCurrency.Net;
using CryptoCurrency.Net.BIPs;
using CryptoCurrency.Net.Coins;
using CryptoCurrency.Net.Cryptography.Hashing;
/**snipped***/
using (BIP0039 bip39 = new BIP0039(origNew, coin: new Bitcoin())
{
   using (BIP0032 bip32 = bip39.ToBip32())
   {
        BIP0032Path path = new BIP0032Path("m/44'/0'/0'");
        PrivateKey[] pks = bip32.GetPrivateKeys(path, startIndex:0, count:1, step:1);
        if (pks[0].ToBytes() == pkBytesThatUserEnteredInTheBeginning)
        {
            Console.WriteLine($"Your correct seed is: {origNew}");
        }
        pk.Dispose();
        break;
   }
}
I took this part out because it is using my own library (CryptoCurrency.Net) which I have not released yet so you wouldn't be able to use it. But the first part should give you the idea of how to do it with any library or in any programming language.
The bottlenecks are the following:
- The PBDK inside of BIP39 (mine is optimized so it is fast)
- The calculations inside BIP32:
  * If it is based on one private key they are only BigInteger math so can be pretty fast (mine is fast)
  * If it is based on public key then they are based on modular asthmatics that is used for EC multiplication which can be slow (here is the slowest part).
  * If it is based on address then it is limited by the speed of encoding (base58 or bech32)

Projects List+Suggestion box
Donation link using BIP21
Bech32 Donation link!
BitcoinTransactionTool (0.9.2):  Ann - Source Code
Watch Only Bitcoin Wallet (supporting SegWit) (3.1.0):  Ann - Source Code
SharpPusher (broadcast transactions) (0.10.0): Ann - Source Code

dlystyr
Newbie
*
Offline Offline

Activity: 29
Merit: 1


View Profile WWW
January 05, 2019, 06:56:05 AM
 #8

Thanks for the useful post Coding Enthusiast, I look forward to the Net library release.

I would merit you if I could!
khaled0111
Hero Member
*****
Online Online

Activity: 826
Merit: 550



View Profile
January 05, 2019, 04:41:20 PM
 #9

Coding Enthusiast can you explain more, please, how did you find that there are 31878 possibilitie!

Here is what I got:
number of possible combinations: 24!/(24-4)! = 10626

for each combination there is 4 possibilities to find the right order:
10626*4 = 42504
what you got is:
10626*3 = 31878

Did I miss something!!

Edit: I got it ,sorry, since the first order we have in each combination should be removed then remains only 3 permutation possibilities.
Thank you for the code.

          ███████
      ██   ▀███▀   ██
  ▄█▄  ▄▄█████████▄▄  ▄█▄
 ▄███▄██▀▀       ▀▀██▄███▄
 ██▀███    ▄▄█▄█    ███▀██
    ██      █▀▀██    ██
██  ██     █████▀    ██  ██
    ██   ▄▄█▄▄▄██    ██
 ██▄███    █▀█▀▀    ███▄██
 ▀███▀██▄▄       ▄▄██▀███▀
  ▀██  ▀▀█████████▀▀  ██▀
      ██   ▄███▄   ██
          ███████
bspin   ███████████████████████
███████████████████████████
███████████████████████████
███████▀█▀    ▀▀▀██▀███████
███████            ▄███████
███████ ▄██▄▄▄▄▄▀ ▄████████
███ ▀  ▀  ██▀▀   ▄▀  ▀  ███
███▄▄█▀  █▀     █▄▄█▀  ████
█████   █▀       ██   █████
████▄▄▄▄█▄▄▄▄▄▄▄▄█▄▄▄▄█████
███████████████████████████
███████████████████████████
  ███████████████████████
       ▄▄█████████▄▄
    ▄█████████████████▄
  ▄█████████████████████▄
 ▄█████████  █  █████████▄
▄████████        █████████▄
███████████  ██  ██████████
███████████       █████████
███████████  ███  █████████
▀████████        ▄████████▀
 ▀█████████  █  █████████▀
  ▀█████████████████████▀
    ▀█████████████████▀
       ▀▀█████████▀▀
..PLAY NOW..
KingZee
Sr. Member
****
Offline Offline

Activity: 602
Merit: 424


Check your coin privilege


View Profile
January 07, 2019, 06:28:49 PM
Merited by achow101 (5), bones261 (4), LoyceV (3), ETFbitcoin (2), khaled0111 (2), Coding Enthusiast (2), vapourminer (1), o_e_l_e_o (1), MagicByt3 (1)
 #10

What do you mean by "inverted the position of two of those words, two times"? How exactly you did that will affect the number of possibilities (as some orderings could be ruled out).

The upper bound to this is (24 choose 4) * 4! = 255024. (24 choose 4) is the number of ways you can choose 4 items from a set of 24 elements. 4! is the number of ways you can order those 4 elements. This is a multiplication since for each way you can choose 4 items, there are 4! ways you can rearrange them.
Let's say the seed is:
Word1 Word2 Word3 Word4 Word5 Word6 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word19 Word20 Word21 Word22 Word23 Word24

Well, my "encryption" technique was to write in that order:
Word1 Word23 Word3 Word21 Word5 Word6 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word19 Word20 Word4 Word22 Word2 Word24

So I switched Word2 <> Word23 and Word21 <> Word4

But when I try to revert that, this doesn't work. So I must have screwed up somewhere. My hypothesis is that I have inverted the "wrong" words, but I don't know which ones.
The inversion should have been made in a symetrical position, like in my example.
But since I screw up, maybe I have switched words in a non symetrical position.

I know I'm late to the party with Coding Enthusiast showered with merits. I hope he helped you get your key back, because if he didn't :

I don't see how there are that many combinations unless he bruteforced every possible permutation of 4 from 24, which is roughly 331776 possibilities (minus repetitions I guess.)

If I strictly follow the way you switched up your words :

You swap every word with its symmetrical other word.
You swap exactly 2 words.

This will HUGELY reduce the number of possibilities, but don't take my word for it :

http://jsfiddle.net/gu2809ht/

I wrote this in 5 minutes and didn't bother to make an output in html (sorry), so press run and open your console and you'll see the output :

Code:
Word24 Word23 Word3 Word4 Word5 Word6 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word19 Word20 Word21 Word22 Word2 Word1
Word24 Word2 Word22 Word4 Word5 Word6 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word19 Word20 Word21 Word3 Word23 Word1
Word24 Word2 Word3 Word21 Word5 Word6 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word19 Word20 Word4 Word22 Word23 Word1
Word24 Word2 Word3 Word4 Word20 Word6 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word19 Word5 Word21 Word22 Word23 Word1
Word24 Word2 Word3 Word4 Word5 Word19 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word6 Word20 Word21 Word22 Word23 Word1
Word24 Word2 Word3 Word4 Word5 Word6 Word18 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word7 Word19 Word20 Word21 Word22 Word23 Word1
Word24 Word2 Word3 Word4 Word5 Word6 Word7 Word17 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word8 Word18 Word19 Word20 Word21 Word22 Word23 Word1
Word24 Word2 Word3 Word4 Word5 Word6 Word7 Word8 Word16 Word10 Word11 Word12 Word13 Word14 Word15 Word9 Word17 Word18 Word19 Word20 Word21 Word22 Word23 Word1
Word24 Word2 Word3 Word4 Word5 Word6 Word7 Word8 Word9 Word15 Word11 Word12 Word13 Word14 Word10 Word16 Word17 Word18 Word19 Word20 Word21 Word22 Word23 Word1
Word24 Word2 Word3 Word4 Word5 Word6 Word7 Word8 Word9 Word10 Word14 Word12 Word13 Word11 Word15 Word16 Word17 Word18 Word19 Word20 Word21 Word22 Word23 Word1
Word24 Word2 Word3 Word4 Word5 Word6 Word7 Word8 Word9 Word10 Word11 Word13 Word12 Word14 Word15 Word16 Word17 Word18 Word19 Word20 Word21 Word22 Word23 Word1
Word1 Word23 Word22 Word4 Word5 Word6 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word19 Word20 Word21 Word3 Word2 Word24
Word1 Word23 Word3 Word21 Word5 Word6 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word19 Word20 Word4 Word22 Word2 Word24
Word1 Word23 Word3 Word4 Word20 Word6 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word19 Word5 Word21 Word22 Word2 Word24
Word1 Word23 Word3 Word4 Word5 Word19 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word6 Word20 Word21 Word22 Word2 Word24
Word1 Word23 Word3 Word4 Word5 Word6 Word18 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word7 Word19 Word20 Word21 Word22 Word2 Word24
Word1 Word23 Word3 Word4 Word5 Word6 Word7 Word17 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word8 Word18 Word19 Word20 Word21 Word22 Word2 Word24
Word1 Word23 Word3 Word4 Word5 Word6 Word7 Word8 Word16 Word10 Word11 Word12 Word13 Word14 Word15 Word9 Word17 Word18 Word19 Word20 Word21 Word22 Word2 Word24
Word1 Word23 Word3 Word4 Word5 Word6 Word7 Word8 Word9 Word15 Word11 Word12 Word13 Word14 Word10 Word16 Word17 Word18 Word19 Word20 Word21 Word22 Word2 Word24
Word1 Word23 Word3 Word4 Word5 Word6 Word7 Word8 Word9 Word10 Word14 Word12 Word13 Word11 Word15 Word16 Word17 Word18 Word19 Word20 Word21 Word22 Word2 Word24
Word1 Word23 Word3 Word4 Word5 Word6 Word7 Word8 Word9 Word10 Word11 Word13 Word12 Word14 Word15 Word16 Word17 Word18 Word19 Word20 Word21 Word22 Word2 Word24
Word1 Word2 Word22 Word21 Word5 Word6 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word19 Word20 Word4 Word3 Word23 Word24
Word1 Word2 Word22 Word4 Word20 Word6 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word19 Word5 Word21 Word3 Word23 Word24
Word1 Word2 Word22 Word4 Word5 Word19 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word6 Word20 Word21 Word3 Word23 Word24
Word1 Word2 Word22 Word4 Word5 Word6 Word18 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word7 Word19 Word20 Word21 Word3 Word23 Word24
Word1 Word2 Word22 Word4 Word5 Word6 Word7 Word17 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word8 Word18 Word19 Word20 Word21 Word3 Word23 Word24
Word1 Word2 Word22 Word4 Word5 Word6 Word7 Word8 Word16 Word10 Word11 Word12 Word13 Word14 Word15 Word9 Word17 Word18 Word19 Word20 Word21 Word3 Word23 Word24
Word1 Word2 Word22 Word4 Word5 Word6 Word7 Word8 Word9 Word15 Word11 Word12 Word13 Word14 Word10 Word16 Word17 Word18 Word19 Word20 Word21 Word3 Word23 Word24
Word1 Word2 Word22 Word4 Word5 Word6 Word7 Word8 Word9 Word10 Word14 Word12 Word13 Word11 Word15 Word16 Word17 Word18 Word19 Word20 Word21 Word3 Word23 Word24
Word1 Word2 Word22 Word4 Word5 Word6 Word7 Word8 Word9 Word10 Word11 Word13 Word12 Word14 Word15 Word16 Word17 Word18 Word19 Word20 Word21 Word3 Word23 Word24
Word1 Word2 Word3 Word21 Word20 Word6 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word19 Word5 Word4 Word22 Word23 Word24
Word1 Word2 Word3 Word21 Word5 Word19 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word6 Word20 Word4 Word22 Word23 Word24
Word1 Word2 Word3 Word21 Word5 Word6 Word18 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word7 Word19 Word20 Word4 Word22 Word23 Word24
Word1 Word2 Word3 Word21 Word5 Word6 Word7 Word17 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word8 Word18 Word19 Word20 Word4 Word22 Word23 Word24
Word1 Word2 Word3 Word21 Word5 Word6 Word7 Word8 Word16 Word10 Word11 Word12 Word13 Word14 Word15 Word9 Word17 Word18 Word19 Word20 Word4 Word22 Word23 Word24
Word1 Word2 Word3 Word21 Word5 Word6 Word7 Word8 Word9 Word15 Word11 Word12 Word13 Word14 Word10 Word16 Word17 Word18 Word19 Word20 Word4 Word22 Word23 Word24
Word1 Word2 Word3 Word21 Word5 Word6 Word7 Word8 Word9 Word10 Word14 Word12 Word13 Word11 Word15 Word16 Word17 Word18 Word19 Word20 Word4 Word22 Word23 Word24
Word1 Word2 Word3 Word21 Word5 Word6 Word7 Word8 Word9 Word10 Word11 Word13 Word12 Word14 Word15 Word16 Word17 Word18 Word19 Word20 Word4 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word20 Word19 Word7 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word18 Word6 Word5 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word20 Word6 Word18 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word7 Word19 Word5 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word20 Word6 Word7 Word17 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word8 Word18 Word19 Word5 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word20 Word6 Word7 Word8 Word16 Word10 Word11 Word12 Word13 Word14 Word15 Word9 Word17 Word18 Word19 Word5 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word20 Word6 Word7 Word8 Word9 Word15 Word11 Word12 Word13 Word14 Word10 Word16 Word17 Word18 Word19 Word5 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word20 Word6 Word7 Word8 Word9 Word10 Word14 Word12 Word13 Word11 Word15 Word16 Word17 Word18 Word19 Word5 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word20 Word6 Word7 Word8 Word9 Word10 Word11 Word13 Word12 Word14 Word15 Word16 Word17 Word18 Word19 Word5 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word19 Word18 Word8 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word17 Word7 Word6 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word19 Word7 Word17 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word8 Word18 Word6 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word19 Word7 Word8 Word16 Word10 Word11 Word12 Word13 Word14 Word15 Word9 Word17 Word18 Word6 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word19 Word7 Word8 Word9 Word15 Word11 Word12 Word13 Word14 Word10 Word16 Word17 Word18 Word6 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word19 Word7 Word8 Word9 Word10 Word14 Word12 Word13 Word11 Word15 Word16 Word17 Word18 Word6 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word19 Word7 Word8 Word9 Word10 Word11 Word13 Word12 Word14 Word15 Word16 Word17 Word18 Word6 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word18 Word17 Word9 Word10 Word11 Word12 Word13 Word14 Word15 Word16 Word8 Word7 Word19 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word18 Word8 Word16 Word10 Word11 Word12 Word13 Word14 Word15 Word9 Word17 Word7 Word19 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word18 Word8 Word9 Word15 Word11 Word12 Word13 Word14 Word10 Word16 Word17 Word7 Word19 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word18 Word8 Word9 Word10 Word14 Word12 Word13 Word11 Word15 Word16 Word17 Word7 Word19 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word18 Word8 Word9 Word10 Word11 Word13 Word12 Word14 Word15 Word16 Word17 Word7 Word19 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word7 Word17 Word16 Word10 Word11 Word12 Word13 Word14 Word15 Word9 Word8 Word18 Word19 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word7 Word17 Word9 Word15 Word11 Word12 Word13 Word14 Word10 Word16 Word8 Word18 Word19 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word7 Word17 Word9 Word10 Word14 Word12 Word13 Word11 Word15 Word16 Word8 Word18 Word19 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word7 Word17 Word9 Word10 Word11 Word13 Word12 Word14 Word15 Word16 Word8 Word18 Word19 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word7 Word8 Word16 Word15 Word11 Word12 Word13 Word14 Word10 Word9 Word17 Word18 Word19 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word7 Word8 Word16 Word10 Word14 Word12 Word13 Word11 Word15 Word9 Word17 Word18 Word19 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word7 Word8 Word16 Word10 Word11 Word13 Word12 Word14 Word15 Word9 Word17 Word18 Word19 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word7 Word8 Word9 Word15 Word14 Word12 Word13 Word11 Word10 Word16 Word17 Word18 Word19 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word7 Word8 Word9 Word15 Word11 Word13 Word12 Word14 Word10 Word16 Word17 Word18 Word19 Word20 Word21 Word22 Word23 Word24
Word1 Word2 Word3 Word4 Word5 Word6 Word7 Word8 Word9 Word10 Word14 Word13 Word12 Word11 Word15 Word16 Word17 Word18 Word19 Word20 Word21 Word22 Word23 Word24

The number is so small because symmetrical swapping reduces in half the number of permutation, (1<>24 is the same as 24<>1). The list above is exhaustive of every possible way you can permute using your special technique.

I just couldn't help comment in case you still didn't try to import/test the 30 thousand possibilities, I hope you don't have to Smiley

In case you're not sure you swapped them symmetrically of course, you can expand the search radius, but there are a few steps before trying the full 30k solutions. (Like if the 2 words you swapped were neighbors, or far away by n words, etc.. which are also much less)

I'm also as jealous as a middleschool schoolgirl because this is a really easy problem.. Right place at the right time I guess Undecided

khaled0111
Hero Member
*****
Online Online

Activity: 826
Merit: 550



View Profile
January 07, 2019, 09:58:25 PM
Last edit: January 09, 2019, 09:17:20 AM by khaled0111
Merited by KingZee (1)
 #11

Thank you for pointing this out, symetric swapping will reduce the number of possibilities to 66.

Now, we will work only on 2 words out of 12 words and swap them against their symeyric from the other 12 words.

n!/(n-r)! * 1/r! gives us 12!/(12-10)! *1/2! = 66
gave you +2 for this (wish I got many of them, you deserve much more)

          ███████
      ██   ▀███▀   ██
  ▄█▄  ▄▄█████████▄▄  ▄█▄
 ▄███▄██▀▀       ▀▀██▄███▄
 ██▀███    ▄▄█▄█    ███▀██
    ██      █▀▀██    ██
██  ██     █████▀    ██  ██
    ██   ▄▄█▄▄▄██    ██
 ██▄███    █▀█▀▀    ███▄██
 ▀███▀██▄▄       ▄▄██▀███▀
  ▀██  ▀▀█████████▀▀  ██▀
      ██   ▄███▄   ██
          ███████
bspin   ███████████████████████
███████████████████████████
███████████████████████████
███████▀█▀    ▀▀▀██▀███████
███████            ▄███████
███████ ▄██▄▄▄▄▄▀ ▄████████
███ ▀  ▀  ██▀▀   ▄▀  ▀  ███
███▄▄█▀  █▀     █▄▄█▀  ████
█████   █▀       ██   █████
████▄▄▄▄█▄▄▄▄▄▄▄▄█▄▄▄▄█████
███████████████████████████
███████████████████████████
  ███████████████████████
       ▄▄█████████▄▄
    ▄█████████████████▄
  ▄█████████████████████▄
 ▄█████████  █  █████████▄
▄████████        █████████▄
███████████  ██  ██████████
███████████       █████████
███████████  ███  █████████
▀████████        ▄████████▀
 ▀█████████  █  █████████▀
  ▀█████████████████████▀
    ▀█████████████████▀
       ▀▀█████████▀▀
..PLAY NOW..
Coding Enthusiast
Hero Member
*****
Offline Offline

Activity: 666
Merit: 1027


Novice C♯ Coder


View Profile WWW
January 08, 2019, 03:06:37 AM
 #12

I don't see how there are that many combinations unless he bruteforced every possible permutation of 4 from 24, which is roughly 331776 possibilities (minus repetitions I guess.)

I didn't brute force all the possible permutations, actually I am skipping a lot (eg. w1-w5 and w5-w1, also w1-w5 and w5-w10 since w5 was already swapped) which is why the total is 31878 instead of 255024. Additionally I stuck to this part of OP's comment:
But since I screw up, maybe I have switched words in a non symetrical position.

Projects List+Suggestion box
Donation link using BIP21
Bech32 Donation link!
BitcoinTransactionTool (0.9.2):  Ann - Source Code
Watch Only Bitcoin Wallet (supporting SegWit) (3.1.0):  Ann - Source Code
SharpPusher (broadcast transactions) (0.10.0): Ann - Source Code

birr
Hero Member
*****
Offline Offline

Activity: 785
Merit: 520


View Profile
January 08, 2019, 05:01:19 AM
 #13

Not all combos are valid, because of the checksum, amirite?
HeRetiK
Legendary
*
Offline Offline

Activity: 1232
Merit: 1118


the forkings will continue until morale improves


View Profile
January 08, 2019, 01:11:48 PM
 #14

Not all combos are valid, because of the checksum, amirite?

Yes. I think actually most combos won't be valid. However there's little to be done besides brute forcing the available combinations and then 1) checking whether the checksum is correct, and if the checksum is correct 2) whether it's associated with any transactions.

birr
Hero Member
*****
Offline Offline

Activity: 785
Merit: 520


View Profile
January 09, 2019, 03:55:04 AM
 #15

So in terms of saving time, there's the question of which is quicker:  validating the checksum or looking for transactions?
If it takes less time to validate the checksum than it does to look for transactions, then it's worth it to validate checksums.
On the other hand, if validating a checksum takes longer than looking for transactions, then checksum validation isn't worth the trouble.
I don't have enough experience with this stuff to say for sure one way or the other, but my guess is that checksum validation, because it's done locally, takes less time than searching for transactions.
And since checksum validation will eliminate 99.99% of the seeds, the time savings of not having to do all those searches for transactions really adds up.
pooya87
Legendary
*
Offline Offline

Activity: 1764
Merit: 1874


Remember tonight for it's the beginning of forever


View Profile
January 09, 2019, 04:11:17 AM
 #16

So in terms of saving time, there's the question of which is quicker:  validating the checksum or looking for transactions?
If it takes less time to validate the checksum than it does to look for transactions, then it's worth it to validate checksums.
On the other hand, if validating a checksum takes longer than looking for transactions, then checksum validation isn't worth the trouble.
I don't have enough experience with this stuff to say for sure one way or the other, but my guess is that checksum validation, because it's done locally, takes less time than searching for transactions.
And since checksum validation will eliminate 99.99% of the seeds, the time savings of not having to do all those searches for transactions really adds up.

since checksum is a simple SHA256 hash of the bytes that the seed phrase gives you then it is so much faster than doing anything else. not to mention that you should already return a "fail" in first step meaning when you convert the set of words into a byte array and not even move to turning anything into keys > addresses > transaction checking!

birr
Hero Member
*****
Offline Offline

Activity: 785
Merit: 520


View Profile
January 09, 2019, 03:59:24 PM
 #17

So in terms of saving time, there's the question of which is quicker:  validating the checksum or looking for transactions?
If it takes less time to validate the checksum than it does to look for transactions, then it's worth it to validate checksums.
On the other hand, if validating a checksum takes longer than looking for transactions, then checksum validation isn't worth the trouble.
I don't have enough experience with this stuff to say for sure one way or the other, but my guess is that checksum validation, because it's done locally, takes less time than searching for transactions.
And since checksum validation will eliminate 99.99% of the seeds, the time savings of not having to do all those searches for transactions really adds up.

since checksum is a simple SHA256 hash of the bytes that the seed phrase gives you then it is so much faster than doing anything else. not to mention that you should already return a "fail" in first step meaning when you convert the set of words into a byte array and not even move to turning anything into keys > addresses > transaction checking!
yup
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!