BIPs bitcoin improvement proposals

199 - Hashed Time-Locked Contract transactions

<pre> BIP: 199 Layer: Applications Title: Hashed Time-Locked Contract transactions Author: Sean Bowe <sean@z.cash> Daira Hopwood <daira@z.cash> Comments-Summary: No comments yet. Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0199 Status: Draft Type: Standards Track Created: 2017-03-27 License: BSD-3-Clause CC0-1.0 </pre> ==Abstract== This BIP describes a script for generalized off-chain contract negotiation. ==Summary== A Hashed Time-Locked Contract (HTLC) is a script that permits a designated party (the "seller") to spend funds by disclosing the preimage of a hash. It also permits a second party (the "buyer") to spend the funds after a timeout is reached, in a refund situation. The script takes the following form: OP_IF [HASHOP] <digest> OP_EQUALVERIFY OP_DUP OP_HASH160 <seller pubkey hash> OP_ELSE <num> [TIMEOUTOP] OP_DROP OP_DUP OP_HASH160 <buyer pubkey hash> OP_ENDIF OP_EQ...