From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1YxWK0-0001zN-AJ for bitcoin-development@lists.sourceforge.net; Wed, 27 May 2015 08:04:16 +0000 Received-SPF: pass (sog-mx-3.v43.ch3.sourceforge.com: domain of gmail.com designates 209.85.213.173 as permitted sender) client-ip=209.85.213.173; envelope-from=lemientelephone@gmail.com; helo=mail-ig0-f173.google.com; Received: from mail-ig0-f173.google.com ([209.85.213.173]) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1YxWJy-0005fu-JC for bitcoin-development@lists.sourceforge.net; Wed, 27 May 2015 08:04:16 +0000 Received: by igbsb11 with SMTP id sb11so8039027igb.0 for ; Wed, 27 May 2015 01:04:09 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.107.29.148 with SMTP id d142mr41513649iod.9.1432713849285; Wed, 27 May 2015 01:04:09 -0700 (PDT) Received: by 10.64.16.229 with HTTP; Wed, 27 May 2015 01:04:09 -0700 (PDT) In-Reply-To: References: Date: Wed, 27 May 2015 10:04:09 +0200 Message-ID: From: Telephone Lemien Cc: Bitcoin Development Content-Type: multipart/alternative; boundary=001a114089c40d333105170bb049 X-Spam-Score: 3.3 (+++) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (lemientelephone[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 1.2 MISSING_HEADERS Missing To: header 1.0 HTML_MESSAGE BODY: HTML included in message -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 2.7 MALFORMED_FREEMAIL Bad headers on message from free email service X-Headers-End: 1YxWJy-0005fu-JC Subject: Re: [Bitcoin-development] Consensus-enforced transaction replacement via sequence numbers X-BeenThere: bitcoin-development@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 May 2015 08:04:16 -0000 --001a114089c40d333105170bb049 Content-Type: text/plain; charset=UTF-8 Please remove me from the mailing list 2015-05-27 3:50 GMT+02:00 Mark Friedenbach : > Sequence numbers appear to have been originally intended as a mechanism > for transaction replacement within the context of multi-party transaction > construction, e.g. a micropayment channel. The idea is that a participant > can sign successive versions of a transaction, each time incrementing the > sequence field by some amount. Relay nodes perform transaction replacement > according to some policy rule making use of the sequence numbers, e.g. > requiring sequence numbers in a replacement to be monotonically increasing. > > As it happens, this cannot be made safe in the bitcoin protocol as > deployed today, as there is no enforcement of the rule that miners include > the most recent transaction in their blocks. As such, any protocol relying > on a transaction replacement policy can be defeated by miners choosing not > to follow that policy, which they may even be incentivised to do so (if > older transactions provide higher fee per byte, for example). Transaction > replacement is presently disabled in Bitcoin Core. > > These shortcomings can be fixed in an elegant way by giving sequence > numbers new consensus-enforced semantics as a relative lock-time: if a > sequence number is non-final (MAX_INT), its bitwise inverse is interpreted > as either a relative height or time delta which is added to the height or > median time of the block containing the output being spent to form a > per-input lock-time. The lock-time of each input constructed in this manor, > plus the nLockTime of the transaction itself if any input is non-final must > be satisfied for a transaction to be valid. > > For example, a transaction with an txin.nSequence set to 0xffffff9b [== > ~(uint32_t)100] is prevented by consensus rule from being selected for > inclusion in a block until the 100th block following the one including the > parent transaction referenced by that input. > > In this way one may construct, for example, a bidirectional micropayment > channel where each change of direction increments sequence numbers to make > the transaction become valid prior to any of the previously exchanged > transactions. > > This also enables the discussed relative-form of CHECKLOCKTIMEVERIFY to be > implemented in the same way: by checking transaction data only and not > requiring contextual information like the block height or timestamp. > > An example implementation of this concept, as a policy change to the > mempool processing of Bitcoin Core is available on github: > > https://github.com/maaku/bitcoin/tree/sequencenumbers > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Bitcoin-development mailing list > Bitcoin-development@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bitcoin-development > > --001a114089c40d333105170bb049 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Please remove me from the mailing list

2015-05-27 3:50 GMT+02:00 M= ark Friedenbach <mark@friedenbach.org>:
Sequence numbers appear to have been orig= inally intended as a mechanism for transaction replacement within the conte= xt of multi-party transaction construction, e.g. a micropayment channel. Th= e idea is that a participant can sign successive versions of a transaction,= each time incrementing the sequence field by some amount. Relay nodes perf= orm transaction replacement according to some policy rule making use of the= sequence numbers, e.g. requiring sequence numbers in a replacement to be m= onotonically increasing.

As it happens, this cannot be made safe in = the bitcoin protocol as deployed today, as there is no enforcement of the r= ule that miners include the most recent transaction in their blocks. As suc= h, any protocol relying on a transaction replacement policy can be defeated= by miners choosing not to follow that policy, which they may even be incen= tivised to do so (if older transactions provide higher fee per byte, for ex= ample). Transaction replacement is presently disabled in Bitcoin Core.
<= br>These shortcomings can be fixed in an elegant way by giving sequence num= bers new consensus-enforced semantics as a relative lock-time: if a sequenc= e number is non-final (MAX_INT), its bitwise inverse is interpreted as eith= er a relative height or time delta which is added to the height or median t= ime of the block containing the output being spent to form a per-input lock= -time. The lock-time of each input constructed in this manor, plus the nLoc= kTime of the transaction itself if any input is non-final must be satisfied= for a transaction to be valid.

For example, a transaction with an t= xin.nSequence set to 0xffffff9b [=3D=3D ~(uint32_t)100] is prevented by con= sensus rule from being selected for inclusion in a block until the 100th bl= ock following the one including the parent transaction referenced by that i= nput.

In this way one may construct, for example, a bidirectional mi= cropayment channel where each change of direction increments sequence numbe= rs to make the transaction become valid prior to any of the previously exch= anged transactions.

This also enables the discussed relative-form of= CHECKLOCKTIMEVERIFY to be implemented in the same way: by checking transac= tion data only and not requiring contextual information like the block heig= ht or timestamp.

An example implementation of this concept, as a pol= icy change to the mempool processing of Bitcoin Core is available on github= :

https://github.com/maaku/bitcoin/tree/sequencenumbers=

-----------------------------------------------------------------------= -------

_______________________________________________
Bitcoin-development mailing list
Bitcoin-develo= pment@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bitcoin-de= velopment


--001a114089c40d333105170bb049--