Miniscript can be used to implement the equivalent of Vaults, including timelocked "cancellable" transactions. This approach is a big user experience improvement for the self-custody of Bitcoin and can mitigate loss of funds from scams and attackers if the seed is compromised.
Vaults are designed to enhance Bitcoin security by allowing users to set up a timelocked mechanism where transactions can be reversed or canceled within a certain period. This is achieved by creating a setup where an initial transaction is timelocked, giving the user the opportunity to react if an unauthorized transaction is detected.
Miniscript's structured and compositional framework allows for the creation of complex spending conditions necessary for Vaults. A vault setup can be designed using Miniscript by combining timelocks and cancellable conditions, like this:
  1. Initial Funding Transaction: This transaction funds the Vault address. The Vault address would have a script that includes a timelock, ensuring that funds cannot be spent immediately.
  2. Spending Conditions: The script at the Vault address would specify two main conditions for spending:
    • Timelock Condition: This condition specifies that funds can only be spent after a certain timelock period has passed.
    • Cancellation Condition: This condition allows the user to cancel the transaction within the timelock period by spending to a new address or returning the funds to the original address.
Example Miniscript for a Vault:
This script translates to:
  • or_d: An or condition with different paths.
  • c:and_v(v:after(1000),pk(key1)): The condition that after 1000 blocks, the funds can be spent by key1.
  • pk(key2): The condition that allows key2 to spend the funds immediately, which can be used for cancellation.
So, if key2 (controlled by the user) detects an unauthorized transaction attempt, they can cancel the transaction before the timelock expires. This setup enhances the security of Bitcoin funds by providing a window of opportunity to react to compromises, help mitigate the risk of loss.
Looks exactly like AI generated output. The link to Vaults is dead. I urge whoever is running the @dollarparity account to reconsider the ethics of what they are doing. This is not a trivial issue. @koob