1

Context: I am looking for a method in Bitcoin where I can lock my funds for a certain period and have them automatically unlocked after the specified time passes. In most time-locked transactions, such as HTLCs, a second transaction is required to either claim or refund the funds. I’m interested in exploring whether there is a way to automate the unlocking process without the need for an additional transaction.

Question: Is there any existing method or script in Bitcoin that allows funds to be locked for a certain time and then automatically unlocked without requiring a second transaction for the refund? If not, are there any alternatives or workarounds to achieve this functionality in Bitcoin?

1 Answer 1

2

A timelocked output is already "automatically unlocked" when the timelock expires. The reason a HTLC requires a second transaction when claiming the funds is to prevent the other party from refunding after the timelock expires. Similarly, the other party might want to start the refund as soon as the timelock expires to ensure they get the funds back even if the hash preimage is later leaked.

However, in a single-party setup, there is no rush to spend a timelocked output as soon as the timelock expires. You can simply consider it unlocked and spend it whenever you need the funds for something.

4
  • can you explain more in detailed the last passage ? I cant get You can simply consider it unlocked and spend it whenever you need the funds for something. . Does this this mean there is no need for refund transaction ? Commented Oct 18 at 11:46
  • 1
    Yes, a refund transaction would spend the timelocked output and create a non-timelocked one to use in a future transaction, but you can skip this step and just use the timelocked output in the future transaction. Commented Oct 18 at 13:35
  • but will it be in balance of user ? Or you say there is no need to do refund as setup is single-party ? Commented Oct 18 at 14:19
  • User balances don't exist on the blockchain, only unspent transaction outputs with specific amounts. After the timelock has expired, the previously timelocked output is as spendable as a non-timelocked one, so there is no need to count it separately. Commented Oct 18 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.