ord icon indicating copy to clipboard operation
ord copied to clipboard

Ord wallet restore doesn't restore the correct wallet - copy of wallet.dat and wallet.dat-journal works

Open nisilag opened this issue 2 years ago • 9 comments

Not sure if this has been tested by anyone yet but I'm having a really hard time getting the wallet restore command to restore the correct wallet for me. I've tried with multiple machines and the only thing that works is if I copy the wallet files (dat and dat-journal) to the wallets folder. Yes - I know there's a possibility I didn't correctly store my mnemonic lol but after having dealt with several hundred of them I'm pretty sure I have the right mnemonic Has anyone successfully restored a wallet using the wallet restore command and verified its the correct wallet.

Steps:

  1. Install bitcoin core and wait for it to complete sync
  2. Install ord
  3. Copy index.redb from @Greg's torrent (thank you @Greg)
  4. run ord index to get to latest block
  5. run ord --wallet wallet restore ""
  6. run ord --wallet wallet inscriptions (it doesn't show my inscriptions)
  7. stop bitcoin daemon
  8. copy wallet dat files (that I got from the original machine that's setup with the wallet in question) to wallets folder to replace the ones that are already there
  9. start bitcoin daemon
  10. run ord --wallet wallet inscriptions (voila! shows all my inscriptions)

nisilag avatar Feb 24 '23 15:02 nisilag

I think I have a clue on what's going on (thx to some direction from Greg#0913 on discord). it may be possible the wallet receive command is generating several addresses instead of just 1. this may inadvertently be creating a gap that's causing the wallet restore to not show all addresses from the original wallet

some additional steps to repro this

  • after creating the original wallet run wallet receive 2 times
  • run wallet receive again and use this address to receive ordinal
  • this will most likely repro this issue i.e. the wallet restore followed by wallet inscriptions will not show the ordinal

nisilag avatar Feb 24 '23 17:02 nisilag

Same issue here. ord restore doesn't show txs. I need to manually copy the original wallet.dat & wallet.dat-journal.

To verify the seed is correct, I restored into Sparrow and saw the expected txs.

cmdallas avatar Feb 24 '23 18:02 cmdallas

so restoring into Sparrow is safe? I just tried it and while the checksum is getting verified the "Discover wallet" button stays grayed out. Thoughts?

nisilag avatar Feb 24 '23 18:02 nisilag

I think I know what's happening. When you restore a wallet ord creates the descriptors in the new wallet with timestamp "now" and so bitcoind only scans blocks from the last 2 hours.

People affected by this can get their transactions back by rescanning the blockchain:

bitcoin-cli -rpcwallet=<restorewalletname> rescanblockchain 767430

That will rescan from block 767430, the first block that contained an inscription. Use a block number from shortly before your first transaction confirmed.

gmart7t2 avatar Feb 25 '23 00:02 gmart7t2

You are AMAZING! that WORKED!! thx ser!

nisilag avatar Feb 25 '23 00:02 nisilag

I think I know what's happening. When you restore a wallet ord creates the descriptors in the new wallet with timestamp "now" and so bitcoind only scans blocks from the last 2 hours.

People affected by this can get their transactions back by rescanning the blockchain:

bitcoin-cli -rpcwallet=<restorewalletname> rescanblockchain 767430

That will rescan from block 767430, the first block that contained an inscription. Use a block number from shortly before your first transaction confirmed.

i use ord wallet create so no name what i should put for -rpcwallet= ???

spzjulien avatar Feb 25 '23 17:02 spzjulien

I think I know what's happening. When you restore a wallet ord creates the descriptors in the new wallet with timestamp "now" and so bitcoind only scans blocks from the last 2 hours.

Note that it rescans blocks from 2 hours before the most recent block's mediantime. So to reproduce this on regtest I had to wait 2 hours and also generate enough new blocks to allow the mediantime to catch up with the current time.

gmart7t2 avatar Feb 26 '23 16:02 gmart7t2

i use ord wallet create so no name what i should put for -rpcwallet= ???

The default wallet name used by ord is ord.

gmart7t2 avatar Feb 26 '23 16:02 gmart7t2

ofc I'm stupid, need more sleep ;) ty

Le dim. 26 févr. 2023 à 17:04, gmart7t2 @.***> a écrit :

i use ord wallet create so no name what i should put for -rpcwallet= ???

The default wallet name used by ord is ord.

— Reply to this email directly, view it on GitHub https://github.com/casey/ord/issues/1831#issuecomment-1445397424, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFO5XEWNMZV2TCJA2L3SKXTWZN5JDANCNFSM6AAAAAAVHAJBFM . You are receiving this because you commented.Message ID: @.***>

spzjulien avatar Feb 26 '23 19:02 spzjulien

Hi we had this same issue.

I think I know what's happening. When you restore a wallet ord creates the descriptors in the new wallet with timestamp "now" and so bitcoind only scans blocks from the last 2 hours.

People affected by this can get their transactions back by rescanning the blockchain:

bitcoin-cli -rpcwallet=<restorewalletname> rescanblockchain 767430

That will rescan from block 767430, the first block that contained an inscription. Use a block number from shortly before your first transaction confirmed.

We had this issue as well and this fix solved it. Thank you!

a-straus avatar Mar 14 '23 20:03 a-straus