ord icon indicating copy to clipboard operation
ord copied to clipboard

Cannot restore mmenonics

Open hantuzun opened this issue 2 years ago • 22 comments

Steps to reproduce:

$ ord --signet wallet create
{
  "mnemonic": "actress easy busy upset image sport vital attend long fault whisper increase"
}

Delete the ord file.

$ ord --signet wallet restore "actress easy busy upset image sport vital attend long fault whisper increase"

$ ord --signet wallet receive
error: wallet "ord" contains unexpected output descriptors, and does not appear to be an `ord` wallet, create a new wallet with `ord wallet create`

$ ord --signet wallet transactions
error: wallet "ord" contains unexpected output descriptors, and does not appear to be an `ord` wallet, create a new wallet with `ord wallet create`

$ ord --signet wallet inscriptions
error: wallet "ord" contains unexpected output descriptors, and does not appear to be an `ord` wallet, create a new wallet with `ord wallet create`

Running 0.4.2 on macOS.

hantuzun avatar Feb 01 '23 21:02 hantuzun

Can you post the output of bitcoin-cli -signet listdescriptors? That error message means that there are extra descriptors in the wallet that ord doesn't recognize, which makes it think that it's not an ord wallet. Please only post the descriptors here if it's a test wallet without real funds.

casey avatar Feb 01 '23 22:02 casey

You might need:

bitcoin-cli -signet -rpcwallet=ord listdescriptors                                                                                                                                                         ```

casey avatar Feb 01 '23 22:02 casey

The descriptors are:

{
  "wallet_name": "ord",
  "descriptors": [
    {
      "desc": "rawtr(63c1e3e42c43442300a98e866b7223baecde666665b74aff41c533ad276257cc)#0s2cl5y5",
      "timestamp": 1675281941,
      "active": false
    },
    {
      "desc": "tr([7f6833d3/86'/1'/0']tpubDDdYhQPCaVm9C3EAAbk11PKYiBGfbF1iXHfg9Njzr48nWaScwF1PYiM5GgmPLQkUDhCdXhYaExhovQfLqTQDVB7k6P1pqzge9sXHpAFY4J4/0/*)#tz9vzfr6",
      "timestamp": 1675280601,
      "active": false,
      "range": [
        0,
        1005
      ],
      "next": 6
    },
    {
      "desc": "tr([7f6833d3/86'/1'/0']tpubDDdYhQPCaVm9C3EAAbk11PKYiBGfbF1iXHfg9Njzr48nWaScwF1PYiM5GgmPLQkUDhCdXhYaExhovQfLqTQDVB7k6P1pqzge9sXHpAFY4J4/1/*)#6kqdlunz",
      "timestamp": 1675280601,
      "active": false,
      "range": [
        0,
        1001
      ],
      "next": 2
    },
    {
      "desc": "tr([a425da5b/86'/1'/0']tpubDChiJ7dFGzCzXRu5wEko6A8udiUs9ZcCdR7L1BSAA6bc23rWTiVkPQP746LNMqm29N6PE57B69BBtrRjiqYtLM2RNYqcg2frU4NYTEE4NfA/0/*)#csktfpdq",
      "timestamp": 1675281941,
      "active": true,
      "internal": true,
      "range": [
        0,
        999
      ],
      "next": 0
    },
    {
      "desc": "tr([a425da5b/86'/1'/0']tpubDChiJ7dFGzCzXRu5wEko6A8udiUs9ZcCdR7L1BSAA6bc23rWTiVkPQP746LNMqm29N6PE57B69BBtrRjiqYtLM2RNYqcg2frU4NYTEE4NfA/1/*)#fyn255ac",
      "timestamp": 1675281941,
      "active": true,
      "internal": false,
      "range": [
        0,
        999
      ],
      "next": 0
    }
  ]
}

hantuzun avatar Feb 02 '23 03:02 hantuzun

balance outputs a different error:

$ ord --signet wallet balance
error: Database already open. Cannot acquire lock.

hantuzun avatar Feb 02 '23 03:02 hantuzun

Okay, weird. It looks like ord wallet create ran twice and created two sets of descriptors. One set has been used, and the other set hasn't, if I"m reading it correctly. (Two have next: 0, which indicates that no addresses have been used.) To recover this specific wallet, I would delete the wallet, and restore from the seed. (Make sure it's the right one!) Use ord --wallet NEW_WALLET restore <SEED>, make sure you have everything you expect. You can then rename NEW_WALLET to ord, which is the default name.

casey avatar Feb 02 '23 04:02 casey

This is still a bug though, we need to figure out why ord wallet create could run when the wallet already existed.

casey avatar Feb 02 '23 04:02 casey

I have this same issue. Restored a wallet and got:

unexpected output descriptors

Core wallet has 4 descriptors (2 internal, 2 external).

Sadly Core has no commands to delete descriptors.

ottosch avatar Feb 04 '23 21:02 ottosch

I was able to workaround this by creating a new Core wallet and importing both descriptors (receive and change).

ottosch avatar Feb 04 '23 21:02 ottosch

I'm having a similar issue to this, it would seem. Is there an easy way to fix?

cryptoquick avatar Feb 05 '23 12:02 cryptoquick

Steps to reproduce:

  • ord --signet wallet create
  • Delete the ord file.
  • ord --signet wallet restore "actress easy busy upset image sport vital attend long fault whisper increase"
  • ord --signet wallet receive

@hantuzun I'm unable to reproduce this with these steps. Are there any extra steps I might be missing?

casey avatar Feb 05 '23 16:02 casey

I'm having a similar issue to this, it would seem. Is there an easy way to fix?

@cryptoquick Is this consistently reproducible? I've tried a couple times and I can't reproduce it.

ord checks to make sure that it's using an ord wallet, and the way it checks is to see that there are exactly two tr descriptors (main and change) and any number of rawtr descriptors. (commit recovery keys) If you can remove the extra descriptors, it should work.

Ideally, recovering from a seed phrase would work, but since that seems to be the issue, you could also manually export the descriptors with bitcoin-cli listdescriptors and then re-import them with importdescriptors.

casey avatar Feb 05 '23 16:02 casey

I get error: Database already open. Cannot acquire lock. when I try to run various commands. Is this related? I see he had a similar error above.

lylepratt avatar Feb 06 '23 02:02 lylepratt

I'm also unable to recreate this. The descriptors in Bitcoin Core also look like they should:

 bitcoin-cli -signet listdescriptors
{
  "wallet_name": "ord",
  "descriptors": [
    {
      "desc": "tr([7ef8bfd3/86'/1'/0']tpubDDnnbFYrWRpaVXf28KeK7V9iNE8JPeij8BdkxBdGRBA4Zd48iFNVyA1uCmbXN4VsAGAYbFVmTVzyHmidfhH8ox1omntpyt8dx66wi214keS/0/*)#c2ly0vlc",
      "timestamp": 1675699799,
      "active": true,
      "internal": true,
      "range": [
        0,
        999
      ],
      "next": 0
    },
    {
      "desc": "tr([7ef8bfd3/86'/1'/0']tpubDDnnbFYrWRpaVXf28KeK7V9iNE8JPeij8BdkxBdGRBA4Zd48iFNVyA1uCmbXN4VsAGAYbFVmTVzyHmidfhH8ox1omntpyt8dx66wi214keS/1/*)#f769je0q",
      "timestamp": 1675699799,
      "active": true,
      "internal": false,
      "range": [
        0,
        999
      ],
      "next": 0
    }
  ]
}

raphjaph avatar Feb 06 '23 17:02 raphjaph

Can it be related to having 2 wallets named "ord" in different networks? I had this issue after I ran ord on regtest.

ottosch avatar Feb 06 '23 18:02 ottosch

This is blocked for now, until we can reproduce it.

casey avatar Feb 06 '23 19:02 casey

Can it be related to having 2 wallets named "ord" in different networks? I had this issue after I ran ord on regtest.

I don't think so, bitcoin core should be putting wallets for different networks in different subdirectories.

casey avatar Feb 06 '23 19:02 casey

I messed up my seed and I have some missing words. I still have the wallet.dat file thought. Here is how I got to this same problem:

  1. So in panic I moved the ord wallet.dat manually and ran ord wallet create to get a new wallet. The idea was to move the inscriptions to the new wallet. I did not know at that time that I could just create a new wallet in parallel.
  2. The I tried to call balance of the new wallet and I got to this error here.
  3. I was surprised when I could not use my old wallet.dat again when copying it back to .bitcoin/wallets/ord/wallet.dat

Do you know how to fix the descriptors so I can recover my oridignal wallet.dat?

Codonyat avatar Feb 08 '23 09:02 Codonyat

I was able to workaround this by creating a new Core wallet and importing both descriptors (receive and change).

@ottosch could you give me a hand on how to repair the descriptors? I am struggling deleteing the correct parts and parsing the JSON correctly.

Codonyat avatar Feb 08 '23 15:02 Codonyat

uld delete the wallet, and restore from the seed. (Make sure it's the right one!) Use ord --wallet NEW_WALLET restore <SEED>, make sure you have everyth

Should we remove the active or inactive tr descriptors?

Codonyat avatar Feb 08 '23 15:02 Codonyat

@Codonyat the easiest way I found is to import the seed in Sparrow to discover the correct descriptors (they are 2: 1 for receive addresses and 1 for change addresses). Then create a new wallet on Core (rename the old ord wallet first) and import the correct descriptors. Edit: without Sparrow you can find them by trial and error too, since there are probably only 2 options.

Send me a DM on Discord and I'll help you. Just don't send any data (seed words, xprv and preferably not even xpubs).

ottosch avatar Feb 08 '23 19:02 ottosch

@Codonyat the easiest way I found is to import the seed in Sparrow to discover the correct descriptors (they are 2: 1 for receive addresses and 1 for change addresses). Then create a new wallet on Core (rename the old ord wallet first) and import the correct descriptors. Edit: without Sparrow you can find them by trial and error too, since there are probably only 2 options.

Send me a DM on Discord and I'll help you. Just don't send any data (seed words, xprv and preferably not even xpubs).

Thanks for the tip @ottosch. Eventually I just managed to find the other two words by brute force in the mnemonic phrase.

Codonyat avatar Feb 10 '23 13:02 Codonyat

I had the same issue and somehow fixed it by just repeatedly deleting and restoring the wallet until there were only two descriptors.

carboncls avatar Feb 11 '23 21:02 carboncls

I got this.. I got this problem earlier when i tried to restor a diff wallet and solved it by erasing the dir.. but that seems to not work more than once

[1]> bitcoin-cli -rpcwallet=ord listdescriptors { "wallet_name": "ord", "descriptors": [ ] }

dvncan avatar May 28 '23 08:05 dvncan

solved it by removing dir ord rm -rf .bitcoin/wallet/ord then.. ord wallet restore "seed here between quotes like this"

dvncan avatar May 28 '23 09:05 dvncan

This is blocked for now, until we can reproduce it.

I can reproduce it easily...

Create a wallet, delete the wallet, restore the wallet and it will throw the error

dvncan avatar May 28 '23 09:05 dvncan