summaryrefslogtreecommitdiff
path: root/46/552b75afd79785cb8afe93518c6617f0749970
blob: 6fe706621adc8a535eb78f8f4170d83137b21b15 (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
Return-Path: <j@toom.im>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 91CA0258
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 28 Oct 2015 04:26:59 +0000 (UTC)
X-Greylist: from auto-whitelisted by SQLgrey-1.7.6
Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 3E349AD
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 28 Oct 2015 04:26:59 +0000 (UTC)
Received: from [192.168.1.190] (63.135.62.197.nwinternet.com [63.135.62.197]
	(may be forged)) (authenticated bits=0)
	by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id t9S4QsWJ006241
	(version=TLSv1 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT)
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Tue, 27 Oct 2015 21:26:57 -0700
From: Jonathan Toomim <j@toom.im>
X-Pgp-Agent: GPGMail 2.5.2
Content-Type: multipart/signed;
	boundary="Apple-Mail=_5A83DE76-7C50-465D-8261-1EC99018955C";
	protocol="application/pgp-signature"; micalg=pgp-sha512
Date: Tue, 27 Oct 2015 21:26:52 -0700
Message-Id: <291B85A6-D8D4-443B-B03B-C675CBEEC662@toom.im>
To: Bitcoin Dev <bitcoin-dev@lists.linuxfoundation.org>
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
X-Mailer: Apple Mail (2.1878.6)
X-Sonic-CAuth: UmFuZG9tSVbUQA9Az301SwSVlg2FOQD8EPAjY4X4jkzqitScq8v9Ji4tjI5tTq4ROVWFGhlDu2hDn0bsF0oGX34TZrj8+31o
X-Sonic-ID: C;QD6MHix95RG+SuK7sH9FTg== M;ED/JHyx95RG+SuK7sH9FTg==
X-Sonic-Spam-Details: 0.0/5.0 by cerberusd
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW
	autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
Subject: [bitcoin-dev] Composite priority: combining fees and bitcoin-days
	into one number
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Bitcoin Development Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>,
	<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>,
	<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Wed, 28 Oct 2015 04:26:59 -0000


--Apple-Mail=_5A83DE76-7C50-465D-8261-1EC99018955C
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Assigning 5% of block space based on bitcoin-days destroyed (BDD) and =
the other 95% based on fees seems like a rather awkward approach to me. =
For one thing, it means two code paths in pretty much every procedure =
dealing with a constrained resource (e.g. mempool, CNB). This makes code =
harder two write, harder to maintain, and slower to execute. As a =
result, some people have proposed eliminating BDD priority altogether. I =
have another idea.

We can create and maintain a conversion rate between BDD and fees to =
create a composite priority metric. Then we just do compPrio =3D BDD * =
conversionRate + txFee.

How do we calculate conversionRate? We want the following equation to be =
true:

sum(fees) =3D sum(BDD) * conversionRate * BDDweight

So we sum up the mempool fees, and we sum up the mempool BDD. We get a =
policy statement from the command line for a relative weight of BDD vs =
fees (default 0.05), and then conversionRate =3D (summedFees / =
summedBDD) * BDDWeight.

As an optimization, rather than scanning over the whole mempool to =
calculate this, we can just store the sum and add or subtract from it =
each time a tx enters or leaves the mempool. In order to minimize drift =
(the BDD for a transaction changes over time), we recalculate the whole =
thing each time a new block is found.

--Apple-Mail=_5A83DE76-7C50-465D-8261-1EC99018955C
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail

-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - https://gpgtools.org

iQEcBAEBCgAGBQJWME6NAAoJEIEuMk4MG0P148kIALz6R4nr1+bz6kL17ZO+7nB+
YYUe3AHs2yolOYrIbdtYDSrmWWJEEZywlk9YhLLyXLhS2DWXyL3RgJdozdd7s6wS
zAx88INZkvP5jZH2yY9iA7lRfAmh1WEkY5gO+D0Uk63/v8wR3cqv2a/7UB6KJ/R5
YGa4Bf5v3+Ur4V9tjny3giSN82ylfUMRNfNW3BIJYWyQadZotquNbWq1ps+61MNS
+71pBr1luM/+Rw/005+ml5h+Le+27/OR4TDiK4ZwiepnkwWHNNHoo3mdD+2vC9kZ
dTfhzl3tRUTF2gMaqAPcvJEdU81XiCbs89tikmOwHJNr4G/teDMMBcfeeNpHQrM=
=MUzu
-----END PGP SIGNATURE-----

--Apple-Mail=_5A83DE76-7C50-465D-8261-1EC99018955C--