Title: Lock funds in transaction A until transaction B? Post by: andrewdb on March 13, 2016, 05:55:57 PM I am learning about Bitcoin script, and wondering if something like the following is possible:
Is there a way to create a transaction which will lock funds until another transaction from someone else with a certain metadata exists? Title: Re: Lock funds in transaction A until transaction B? Post by: achow101 on March 13, 2016, 05:58:27 PM I am learning about Bitcoin script, and wondering if something like the following is possible: You cannot lock them until a certain transaction exists. However, what you can do is have a script can only be spent from when a certain secret is known. That secret could be published in another transaction.Is there a way to create a transaction which will lock funds until another transaction from someone else with a certain metadata exists? You can also lock to a certain date or block height. Title: Re: Lock funds in transaction A until transaction B? Post by: andrewdb on March 13, 2016, 06:07:36 PM You cannot lock them until a certain transaction exists. However, what you can do is have a script can only be spent from when a certain secret is known. That secret could be published in another transaction. Interesting. Which opcodes are involved in this "lock-until-secret-published" strategy? Is this P2SH? I'd love to learn more about this. Title: Re: Lock funds in transaction A until transaction B? Post by: achow101 on March 13, 2016, 06:24:12 PM You cannot lock them until a certain transaction exists. However, what you can do is have a script can only be spent from when a certain secret is known. That secret could be published in another transaction. Interesting. Which opcodes are involved in this "lock-until-secret-published" strategy? Is this P2SH? I'd love to learn more about this. The script itself may look something like: Code: OP_SHA256 <sha256(secret)> OP_EQUALVERIFY |