For my scenarios, I want freeze some funds from my wallet for some given time/block and then make that amount spendable in a single transaction.
As I understand so far, I can do it using 2 transactions with CheckLockTimeVerify (CLTV) op_code as follows:
- Create a transaction with an output that has the CLTV op_code to freeze some funds from the input(s).
- Then create another transaction which uses the above output as the input. The output of this transaction will transfer the funds back to my wallet. The nLockTime of this transaction will be set to the expire time of the previous transaction.
But is there a way to do the same as above in a single transaction? As in create a transaction whose output has CLTV op_code but is a pubkeyhash back to my wallet. This way the frozen coins become spendable without having to create another transaction?