public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Ross Nicoll <jrn@jrn.me.uk>
To: Gregory Maxwell <gmaxwell@gmail.com>
Cc: bitcoin-development <bitcoin-development@lists.sourceforge.net>
Subject: Re: [Bitcoin-development] Re-enabling simple tx replacement
Date: Sun, 04 Jan 2015 17:22:11 +0000	[thread overview]
Message-ID: <54A976C3.1030805@jrn.me.uk> (raw)
In-Reply-To: <CAAS2fgSw=Goibe2LkXsEH5xjyftjQq4FxJh-dhaP_N5ea21ugQ@mail.gmail.com>

On 04/01/15 17:04, Gregory Maxwell wrote:
> On Sun, Jan 4, 2015 at 2:43 PM, Ross Nicoll <jrn@jrn.me.uk> wrote:
>> Dear all,
>>
>> I've been looking at atomic cross-chain trading (
>> https://en.bitcoin.it/wiki/Atomic_cross-chain_trading ) between the
>> Bitcoin and Dogecoin blockchains, and have a mostly functional
>> prototype. However as it stands if the refund transaction is relayed
>> before the actual spend transaction, it "blocks" the legitimate spend
>> transaction from being accepted into the memory pool.
> 
> Unless there is a serious bug that I am not aware of this is not the
> case. The unlocked transaction is not relayable and will not be
> mempooled (well, until right before it locks).

Grabbing a simple test case:
https://chain.so/tx/BTCTEST/f903a31f2474df737d324c60abf2407e1cf7e052844da4ccffbfab81cf6ac1f8
- that won't lock until 0028 UTC on the 5th.

I've tried closing the wallet, moving the wallet.dat file out of the
way, and then attempting the spend transaction (which can be locked
immediately), and it either rejects it on acceptance to mempool, or it
is never included in a block.

Compare with
https://chain.so/tx/BTCTEST/0b96eb0c9bf8a6ca08bb9d75e44970889db77779c6d3122296c0169959f979cc
where the refund was not sent first, and the transaction has succeeded.

>> I've drafted a patch for this
>> https://github.com/rnicoll/bitcoin/commit/e668d36607f008990ccaac7275e463a6efdd9b5a
>> but have not yet raised a PR, as historically this has lead to a lot of
>> discussion in Github which is better suited to this mailing list.
>>
>> I'm therefore looking for feedback while I continue testing that patch,
>> and any comments would be welcomed.
> 
> This appears to have absolutely no protection against denial of
> service, it seems to me that a single user can rapidly update their
> transaction and exhaust the relay bandwidth of the entire network.
> 

They can only replace a non-final transaction with a final transaction,
so the replacement can happen at most once (any later replacement would
be attempting to replace a final transaction, and therefore fails). So,
while they can expend twice the bandwidth compared to a non-replacement,
I don't think that's a major issue?




  reply	other threads:[~2015-01-04 17:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-04 14:43 [Bitcoin-development] Re-enabling simple tx replacement Ross Nicoll
2015-01-04 17:04 ` Gregory Maxwell
2015-01-04 17:22   ` Ross Nicoll [this message]
2015-01-04 17:35     ` Gregory Maxwell
2015-01-04 17:44       ` Gregory Maxwell
2015-01-04 17:47         ` Peter Todd
2015-01-04 18:11         ` Ross Nicoll
2015-01-04 18:31           ` Gregory Maxwell
2015-01-04 23:06             ` Jorge Timón
2015-01-04 17:45       ` Ross Nicoll

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54A976C3.1030805@jrn.me.uk \
    --to=jrn@jrn.me.uk \
    --cc=bitcoin-development@lists.sourceforge.net \
    --cc=gmaxwell@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox