ord icon indicating copy to clipboard operation
ord copied to clipboard

Is it possible to look for rare sats in a non-taproot wallet?

Open timechainz opened this issue 1 year ago • 4 comments

The guide refers to a process of importing wallet descriptors into a read only wallet and then searching for rare sats within. The example shows a wpkh descriptor.

https://docs.ordinals.com/guides/sat-hunting.html#searching-for-rare-ordinals-in-a-wallet-that-exports-multi-path-descriptors

But running the following with a native segwit wallet fails

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

https://github.com/casey/ord/blob/master/src/options.rs#L208

It seems this is now only possible on taproot wallets. Is it possible to scan a non-taproot wallet for rare sats?

timechainz avatar Mar 01 '23 03:03 timechainz

You can use this as a workaround:

bitcoin-cli -rpcwallet=mywallet listunspent | jq -r '.[] | [ .txid, .vout|tostring ] | join(":")' | xargs -L 1 ord list | jq '.[] | select(.rarity != "common")'

timechainz avatar Mar 01 '23 13:03 timechainz

Brilliant. This worked for me. For anyone like me where you've got stuff in nonstandard locations and have to tell ord about the locations, here's what worked for me. Run this from the directory that contains your ord binary:

bitcoin-cli -rpcwallet=mywallet listunspent | jq -r '.[] | [ .txid, .vout|tostring ] | join(":")' | xargs -L 1 ./ord --index /pathto/sats/index.redb --bitcoin-data-dir /pathto/SSD/BITCOIN list | jq '.[] | select(.rarity != "common")'

so7ow avatar Mar 01 '23 17:03 so7ow

Ord is fussy about what wallets it will talk to.

I removed the fussiness and it works to allow scanning for rare sats:

diff --git a/src/options.rs b/src/options.rs
index 6b0823f..e676e06 100644
--- a/src/options.rs
+++ b/src/options.rs
@@ -192,6 +192,8 @@ impl Options {
         client.load_wallet(&self.wallet)?;
       }
 
+      let skip_wallet_descriptor_checks = true;
+      if !skip_wallet_descriptor_checks {
       let descriptors = client.list_descriptors(None)?.descriptors;
 
       let tr = descriptors
@@ -208,6 +210,7 @@ impl Options {
         bail!("wallet \"{}\" contains unexpected output descriptors, and does not appear to be an `ord` wallet, create a new wallet with `ord wallet create`", self.wallet);
       }
     }
+    }
 
     Ok(client)
   }

gmart7t2 avatar Mar 01 '23 18:03 gmart7t2

Thanks. That was going to be my next step.

timechainz avatar Mar 01 '23 22:03 timechainz

I removed the fussiness

Is this in your fork, @gmart7t2 ?

so7ow avatar Jul 05 '23 15:07 so7ow