Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 9A8F598F for ; Wed, 20 Jul 2016 06:17:56 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from zinan.dashjr.org (unknown [192.3.11.21]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 49D0E7D for ; Wed, 20 Jul 2016 06:17:56 +0000 (UTC) Received: from ishibashi.localnet (unknown [IPv6:2001:470:5:265:61b6:56a6:b03d:28d6]) (Authenticated sender: luke-jr) by zinan.dashjr.org (Postfix) with ESMTPSA id C8D4738A17CC; Wed, 20 Jul 2016 06:17:41 +0000 (UTC) X-Hashcash: 1:25:160720:bitcoin-dev@lists.linuxfoundation.org::P7PT5665Be=tk0f/:Kt9V X-Hashcash: 1:25:160720:pete@petertodd.org::MxM72nS+KKvh9mzP:apYRW X-Hashcash: 1:25:160720:sean@z.cash::Zd8/fZU83odZV7bU:ogHB From: Luke Dashjr To: bitcoin-dev@lists.linuxfoundation.org, Peter Todd Date: Wed, 20 Jul 2016 06:17:39 +0000 User-Agent: KMail/1.13.7 (Linux/4.1.18-gentoo; KDE/4.14.16; x86_64; ; ) References: <20160720054654.GA1420@fedora-21-dvm> In-Reply-To: <20160720054654.GA1420@fedora-21-dvm> X-PGP-Key-Fingerprint: E463 A93F 5F31 17EE DE6C 7316 BD02 9424 21F4 889F X-PGP-Key-ID: BD02942421F4889F X-PGP-Keyserver: hkp://pgp.mit.edu MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201607200617.40917.luke@dashjr.org> X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: Re: [bitcoin-dev] BIP draft: HTLC transactions X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2016 06:17:56 -0000 On Wednesday, July 20, 2016 5:46:54 AM Peter Todd via bitcoin-dev wrote: > On Tue, Jul 19, 2016 at 10:35:39PM -0600, Sean Bowe via bitcoin-dev wrote: > > I'm requesting feedback for Hash Time-Locked Contract (HTLC) transactions > > in Bitcoin. > > > > HTLC transactions allow you to pay for the preimage of a hash. CSV/CLTV > > can be used to recover your funds if the other party is not cooperative. > > These > > > > scripts take the following general form: > > [HASHOP] OP_EQUAL > > OP_IF > > > > > > > > OP_ELSE > > > > [TIMEOUTOP] OP_DROP > > > > OP_ENDIF > > OP_CHECKSIG > > Note that because you're hashing the top item on the stack regardless > scriptSig's that satisfy HTLC's are malleable: that top stack item can be > changed anything in the digest-not-provided case and the script still > passes. OP_SIZE OP_IF [HASHOP] OP_EQUALVERIFY OP_ELSE [TIMEOUTOP] OP_ENDIF OP_CHECKSIG