summaryrefslogtreecommitdiff
path: root/1e/5cf8e25d0277be4786752b0f8a4916b40a2ac6
blob: 099f731280de22a3db77b5796f5da4b8427ab446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192]
	helo=mx.sourceforge.net)
	by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
	(envelope-from <pete@petertodd.org>) id 1YLnYi-0006xR-K4
	for bitcoin-development@lists.sourceforge.net;
	Thu, 12 Feb 2015 06:47:32 +0000
Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of petertodd.org
	designates 62.13.148.110 as permitted sender)
	client-ip=62.13.148.110; envelope-from=pete@petertodd.org;
	helo=outmail148110.authsmtp.com; 
Received: from outmail148110.authsmtp.com ([62.13.148.110])
	by sog-mx-2.v43.ch3.sourceforge.com with esmtp (Exim 4.76)
	id 1YLnYg-0005L6-N1 for bitcoin-development@lists.sourceforge.net;
	Thu, 12 Feb 2015 06:47:32 +0000
Received: from mail-c235.authsmtp.com (mail-c235.authsmtp.com [62.13.128.235])
	by punt16.authsmtp.com (8.14.2/8.14.2/) with ESMTP id t1C6lOkG010008
	for <bitcoin-development@lists.sourceforge.net>;
	Thu, 12 Feb 2015 06:47:24 GMT
Received: from savin.petertodd.org (75-119-251-161.dsl.teksavvy.com
	[75.119.251.161]) (authenticated bits=128)
	by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id t1C6lKq0001991
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO)
	for <bitcoin-development@lists.sourceforge.net>;
	Thu, 12 Feb 2015 06:47:22 GMT
Date: Thu, 12 Feb 2015 01:47:19 -0500
From: Peter Todd <pete@petertodd.org>
To: bitcoin-development@lists.sourceforge.net
Message-ID: <20150212064719.GA6563@savin.petertodd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="0OAP2g/MAC+5xKAE"
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Server-Quench: ffa90f06-b282-11e4-b396-002590a15da7
X-AuthReport-Spam: If SPAM / abuse - report it at:
	http://www.authsmtp.com/abuse
X-AuthRoute: OCd2Yg0TA1ZNQRgX IjsJECJaVQIpKltL GxAVJwpGK10IU0Fd
	P1hXKl1LNVAaWXld WiVPGEoXDxgzCjYj NEgGOBsDNw4AXgd1
	Jh0bXVBSFQB4ARoL AhkUUBo8cABYeX95 e0RnX25aWkVlcE56
	XU8aUWx1YzsbKWAf UEFRfgIacQFOfRsL PAYuXXNbYWMaNHho
	RUpqZj1teD8EeXoQ GllXcANKSB9WEjdj UQoPBTEmFkBATTR2
	IRErYkBEWh9JdB0o OgdJ
X-Authentic-SMTP: 61633532353630.1023:706
X-AuthFastPath: 0 (Was 255)
X-AuthSMTP-Origin: 75.119.251.161/587
X-AuthVirus-Status: No virus detected - but ensure you scan with your own
	anti-virus system.
X-Spam-Score: -1.5 (-)
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 SPF_PASS               SPF: sender matches SPF record
X-Headers-End: 1YLnYg-0005L6-N1
Subject: [Bitcoin-development] replace-by-fee v0.10.0rc4
X-BeenThere: bitcoin-development@lists.sourceforge.net
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: <bitcoin-development.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum_name=bitcoin-development>
List-Post: <mailto:bitcoin-development@lists.sourceforge.net>
List-Help: <mailto:bitcoin-development-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/bitcoin-development>,
	<mailto:bitcoin-development-request@lists.sourceforge.net?subject=subscribe>
X-List-Received-Date: Thu, 12 Feb 2015 06:47:32 -0000


--0OAP2g/MAC+5xKAE
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

My replace-by-fee patch is now available for the v0.10.0rc4 release:

    https://github.com/petertodd/bitcoin/tree/replace-by-fee-v0.10.0rc4

Along with demo scripts of the functionality:

    https://github.com/petertodd/replace-by-fee-tools

New to this version is a comprehensive set of unittests under
qa/replace-by-fee

Additionally the preferential peering support now preferentially peers
with Bitcoin XT=C2=B9 nodes that support Andresen/Harding's double-spend
relaying=C2=B2 patch. While Bitcoin XT nodes don't accept double-spends into
their mempool, they do relay them perfectly well and thus are an asset
to those doing replace-by-fee mining.=C2=B3

I've had a number of requests from miners for a version of
replace-by-fee against Luke-Jr's Eligius patches=E2=81=B4; I'll be also
releasing that shortly once this release has undergone some more
testing.


What's replace-by-fee?
----------------------

Currently most Bitcoin nodes accept the first transaction they see
spending an output to the mempool; all later transactions are rejected.
Replace-by-fee changes this behavior to accept the transaction paying
the highest fee, both absolutely, and in terms of fee-per-KB. Replaced
children are also considered - a chain of transactions is only replaced
if the replacement has a higher fee than the sum of all replaced
transactions.

Doing this aligns standard node behavior with miner incentives: earn the
most amount of money per block. It also makes for a more efficient
transaction fee marketplace, as transactions that are "stuck" due to bad
fee estimates can be "unstuck" by double-spending them with higher
paying versions of themselves. With scorched-earth techniques=E2=81=B5 it g=
ives
a path to making zeroconf transactions economically secure by relying on
economic incentives, rather than "honesty" and alturism, in the same way
Bitcoin mining itself relies on incentives rather than "honesty" and
alturism.

Finally for miners adopting replace-by-fee avoids the development of an
ecosystem that relies heavily on large miners punishing smaller ones for
misbehavior, as seen in Harding's proposal=E2=81=B6 that miners collectivel=
y 51%
attack miners who include doublespends in their blocks - an unavoidable
consequence of imperfect p2p networking in a decentralized system - or
even Hearn's proposal=E2=81=B7 that a majority of miners be able to vote to
confiscate the earnings of the minority and redistribute them at will.


Installation
------------

Once you've compiled the replace-by-fee-v0.10.0rc4 branch just run your
node normally. With -debug logging enabled, you'll see messages like the
following in your ~/.bitcoin/debug.log indicating your node is replacing
transactions with higher-fee paying double-spends:

    2015-02-12 05:45:20 replacing tx ca07cc2a5eaf55ab13be7ed7d7526cb9d30308=
6f116127608e455122263f93ea with c23973c08d71cdadf3a47bae45566053d364e77d217=
47ae7a1b66bf1dffe80ea for 0.00798 BTC additional fees, -1033 delta bytes

Additionally you can tell if you are connected to other replace-by-fee
nodes, or Bitcoin XT nodes, by examining the service bits advertised by
your peers:

    $ bitcoin-cli getpeerinfo | grep services | egrep '((0000000000000003)|=
(0000000004000001))'
            "services" : "0000000000000003",
            "services" : "0000000004000001",
            "services" : "0000000004000001",
            "services" : "0000000000000003",
            "services" : "0000000004000001",
            "services" : "0000000004000001",
            "services" : "0000000000000003",
            "services" : "0000000000000003",

Replace-by-fee nodes advertise service bit 26 from the experimental use
range; Bitcoin XT nodes advertise service bit 1 for their getutxos
support. The code sets aside a certain number of outgoing and incoming
slots just for double-spend relaying nodes, so as long as everything is
working you're node should be connected to like-minded nodes a within 30
minutes or so of starting up.

If you *don't* want to advertise the fact that you are running a
replace-by-fee node, just checkout a slightly earlier commit in git; the
actual mempool changes are separate from the preferential peering
commits. You can then connect directly to a replace-by-fee node using
the -addnode command line flag.

1) https://github.com/bitcoinxt/bitcoinxt
2) https://github.com/bitcoin/bitcoin/pull/3883
3) https://github.com/bitcoin/bitcoin/pull/3883#issuecomment-45543370
4) https://github.com/luke-jr/bitcoin/tree/0.10.x-ljrP
5) http://www.mail-archive.com/bitcoin-development%40lists.sourceforge.net/=
msg05211.html
6) http://www.mail-archive.com/bitcoin-development@lists.sourceforge.net/ms=
g06970.html
7) http://www.mail-archive.com/bitcoin-development%40lists.sourceforge.net/=
msg04972.html

--=20
'peter'[:-1]@petertodd.org
000000000000000013c290b77d45d2ea7f9220aedfadfd556ad41b6bd39822f3

--0OAP2g/MAC+5xKAE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature

-----BEGIN PGP SIGNATURE-----

iQGrBAEBCACVBQJU3ExzXhSAAAAAABUAQGJsb2NraGFzaEBiaXRjb2luLm9yZzAw
MDAwMDAwMDAwMDAwMDAwMmZhMjFjODQyZDQ4YjEzMzM0NjFhMWVkN2Y1ZjE4MDlj
NjFkZDE0YjZiM2E1OTAvFIAAAAAAFQARcGthLWFkZHJlc3NAZ251cGcub3JncGV0
ZUBwZXRlcnRvZC5vcmcACgkQJIFAPaXwkft5KAgAtGeMGNPw54+FHqH3vHULQSfK
gGHabXF5F2u6x9OKSpl8R2LbzCYZOGSkVnxEsfvqvKjd53xPAYGl6ugTKy03mkcU
keXX2dmnoQSjaE29XTJz+9T6p3BKZuosY8gA74+z7bkyfzU+Nd7LvZLmNcTHHHq4
qoHq7aBi1gSOsCxW+tUtmcEfc21PfRvwdX5nx+oY1UcIZV9xXWk92wyO6MiUH+Bm
nWKDe/Sp+S8SkmJLw8dhSaweaGVUJRRza5IB/OkIFj1byZflbQZBGkhkFfPkyw+5
AAu3m7CJTgOmsVGqiX0gkJeZEZ4WUfIsd04DI3Onk/yhQxlDsvd7CwvEHl9B7A==
=W/oB
-----END PGP SIGNATURE-----

--0OAP2g/MAC+5xKAE--