Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: drdeus on May 24, 2025, 06:08:05 AM



Title: Sparrow Wallet descriptor miniscript: time-locked, conditionally multisig wallet
Post by: drdeus on May 24, 2025, 06:08:05 AM
Hello, I'm looking for help on a project I'm working on. This is my first time posting on the Bitcoin Forum. I'm not sure if it's appropriate to ask for help in this way. I have also posted this on Reddit - but I suspect as this question (to me at least) is somewhat technical, I may get better advice from a more specific (or sophisticated) crowd. 

My intended goal: use Sparrow Wallet and Seedsigner to create a 2-of-2 multi sig wallet that after a certain amount of time becomes a 1-of-2 multi sig wallet, such that either wallet can sign a transaction on its own.

To be clear, my intended policy is:

Both RED key and GREEN key are required to sign a transaction prior to a certain date (in this case July 5th, 2037, which is unix timestamp 2130393600)
AFTER 2130393600 either RED key OR GREEN key can sign a transaction alone

I've used ChatGPT to help me with this. This is the miniscript it came up with:

wsh(thresh(1, and(and(pk([REDfp/48h/0h/0h/2h]xpubRED.../0/*), pk([GREENfp/48h/0h/0h/2h]xpubGREEN/0/*)), after(2130393600)), pk([REDfp/48h/0h/0h/2h]xpubRED.../0/*), pk([GREENfp/48h/0h/0h/2h]xpubGREEN.../0/*)))

I believe the miniscript is correct.

The problem is that I'm not able to get Sparrow Wallet to create the wallet using this miniscript. I'm using Sparrow 2.1.2.

After placing the script in the "Edit wallet output descriptor" and hitting "OK", sparrow wallet seems to accept the script (or at least I get no error messages). However, it does not create the wallet with the intended policy as I've stated above.

The Descriptor on the main settings page reverts to "wsh(sortedmulti(1..." rather than "wsh(thresh(..."

I've spent hours trying to troubleshoot this problem with ChatGPT and have ultimately been unsuccessful. ChatGPT seems to believe if I'm still getting "wsh(sortedmulti(..." that it is a syntax error.

Do you have any advice? Any ideas on solutions? Any help you can provide is very much appreciated!!

This is the link to the reddit post if looking at a few screenshots I've taken for this question are helpful:
https://www.reddit.com/r/Bitcoin/comments/1ku4cmm/help_help_with_sparrow_wallet_descriptor/


Title: Re: Sparrow Wallet descriptor miniscript: time-locked, conditionally multisig wallet
Post by: nc50lc on May 24, 2025, 06:46:16 AM
Sparrow doesn't support miniscript (yet).

There are a few still-open "Feature Request" issues concerning that but the developers seem to set it to low priority as of now.
Links:
  • Add support for miniscript descriptors #1700 (https://github.com/sparrowwallet/sparrow/issues/1700)
  • [FEATURE REQUEST] Time locked Recovery Support  #1296 (https://github.com/sparrowwallet/sparrow/issues/1296)


Title: Re: Sparrow Wallet descriptor miniscript: time-locked, conditionally multisig wallet
Post by: satscraper on May 24, 2025, 12:37:44 PM

To be clear, my intended policy is:

Both RED key and GREEN key are required to sign a transaction prior to a certain date (in this case July 5th, 2037, which is unix timestamp 2130393600)
AFTER 2130393600 either RED key OR GREEN key can sign a transaction alone


You might want to consider using Liana wallet, which supports Miniscript and offers various multisig schemes including decaying multisig, which seems to be your primary concern.

Below is an example of a setup using three keys, but it can be easily adapted to your RED and Green keys configuration.


In my view, the possible setup for you in Liana could look like this:

Assign both your RED and Green keys as the primary signers for transactions.

Quote from: satscraper_over_Liana

From there, you can configure decaying conditions allowing both of you keys to act separately after time delay if the primary 2-of-2 scheme is inactive.

Quote from: satscraper_over_Liana


Title: Re: Sparrow Wallet descriptor miniscript: time-locked, conditionally multisig wallet
Post by: LoyceV on May 25, 2025, 07:03:00 AM
This is the first time I've heard about decaying multisig. It sounds interesting in case you lose access to one of the keys over time, but the same applies to a potential attacker who gained access to that key! It may even increase the risk of a $5 wrench attack.


Title: Re: Sparrow Wallet descriptor miniscript: time-locked, conditionally multisig wallet
Post by: drdeus on May 27, 2025, 07:46:13 AM
Yup. Turns out you're correct! Thanks for pushing me in the right direction!!

Sparrow doesn't support miniscript (yet).