summaryrefslogtreecommitdiff
path: root/b6/19e6bd5792a36cd76b9d8d61d47bb0784ae1bc
blob: f7e64206c020b4ee34cb8c7f1367e38df494e808 (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
Return-Path: <jameson.lopp@gmail.com>
Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 9FFE4C016F
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 27 May 2020 18:52:17 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by silver.osuosl.org (Postfix) with ESMTP id 8C5FC20532
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 27 May 2020 18:52:17 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from silver.osuosl.org ([127.0.0.1])
 by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id e4Rhv7vkJxFr
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 27 May 2020 18:52:16 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6
Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com
 [209.85.160.174])
 by silver.osuosl.org (Postfix) with ESMTPS id 3210920525
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 27 May 2020 18:52:16 +0000 (UTC)
Received: by mail-qt1-f174.google.com with SMTP id i68so20122460qtb.5
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Wed, 27 May 2020 11:52:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=Z4NAueB/k88rfr4NQP3Oyc19Hxn82dQZjf9g+JTOKec=;
 b=X9k5nuik/BC4cIvq7GI8RxuTYaN++BDwrKHOVC/b96jrpb1nu+H/v796zF+bcuBayl
 9NCfI9iI7ialtmRkcgxhAbZ8j26y2qsCSTxGjmtxYeN6+FEQPrEdTN/DzC6qA9eE5Vce
 rKjSDhlIorGbNc+d8TXJ5ey3d1Q7Lf6WEcJ/rEt+U+HhOXzoHmEQSWBWISo+6AyqEIGI
 LxOkV16Jsy7mMGHMNDLjZ4x+2x3wwDGjvTddsIkAAjh8OYOjeeuKrfPoxhAAjqzeqGjH
 mdL7L9ecDkTqXuEg6/zI489V6R1QpvRlQQAGJKQxx3cHwKWTJod1TQR5nI7U9Jnp8U46
 ZVbw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=Z4NAueB/k88rfr4NQP3Oyc19Hxn82dQZjf9g+JTOKec=;
 b=SjbfFKgypbVdjnl5Zn6HVxuQLAEATP6+IcqlZOdiT228rcT3HRYO9vVhOSFCgTyA+Q
 ea+hhVE5Y5P6Yjp1se4rd775lNa9Th1Do+q1i+Ozv5Z3bKCPf5WU+JW+Zv4fmRO5/cCr
 QFwILUHgF3W0u7oqK3rr5o99rn4nV3r9qiNp+6YQpYv0qMkoOuDpdjQVqcKycZ+xh56m
 5gm1yIwGqUv0B/Ej8uf+jV9+Yis222iZ28W8IggZGw9QoYax1BTbi570DYWNDUd+FWcS
 N65j48Kztv0p42euTgPkSfjwi84K2Lw/DN7Tm+J2mnqlICPXoXOPjWOIF2CQfBfYxamo
 F2HA==
X-Gm-Message-State: AOAM530or8OAgkgHjQFtlTNt+Xlg6K8vYAOE7Ri2QfSp4WAgcZoEqMhd
 qIhD/jAZ9YfeeTOqL+3Ppt/3iviGS7cCwDteNSpYlAOd
X-Google-Smtp-Source: ABdhPJyrmV42FYRJuKKAj0Oks6oBm8DuRpIbjQpYbkiapWT1179E/l7+jQJ9/RRAgK0/8AfbE2/LwIhkJfQpMfQyrtk=
X-Received: by 2002:aed:2341:: with SMTP id i1mr5893753qtc.358.1590605534843; 
 Wed, 27 May 2020 11:52:14 -0700 (PDT)
MIME-Version: 1.0
From: Jameson Lopp <jameson.lopp@gmail.com>
Date: Wed, 27 May 2020 14:52:03 -0400
Message-ID: <CADL_X_fa4hzy2qOd+p1GwNOg_x8EOvk4fQSDQnz5mmtPwNdH+Q@mail.gmail.com>
To: Bitcoin Dev <bitcoin-dev@lists.linuxfoundation.org>
Content-Type: multipart/alternative; boundary="000000000000e1db7705a6a5b5e4"
Subject: [bitcoin-dev] Transaction size & weight calculation tooling
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Bitcoin Protocol 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, 27 May 2020 18:52:17 -0000

--000000000000e1db7705a6a5b5e4
Content-Type: text/plain; charset="UTF-8"

Hi all,

Anyone who has built a Bitcoin wallet / service has to deal with a variety
of challenges when it comes to transaction construction. One of these
challenges is around determining an appropriate fee; aside from block space
market volatility and the inherent problems of forecasting the future, you
need to know how much block space for which your transaction needs to "bid."

Every time I've run into the problem of calculating the size of a
transaction with specific attributes I've ended up having to sift through
answers scatter across stack overflow posts, so I finally got around to
building a user friendly tool at
https://jlopp.github.io/bitcoin-transaction-size-calculator/

As I was looking for more data on constants to use in the calculation I was
informed that the folks at Bitcoin Optech have also been working on a
calculator: https://bitcoinops.org/en/tools/calc-size

It seems clear that this is a common problem for which we could use better
tooling. I'm also about 99% certain that there's at least 1 or 2 bugs in my
current calculator code.

Please bookmark and share these tools; if you're capable and so inclined,
code reviews would be greatly appreciated!

- Jameson

--000000000000e1db7705a6a5b5e4
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi all,<div><br></div><div>Anyone who has built a Bitcoin =
wallet / service has to deal with a variety of challenges when it comes to =
transaction construction. One of these challenges is around determining an =
appropriate fee; aside from block space market volatility and the inherent =
problems of forecasting the future, you need to know how much block space f=
or which your transaction needs to &quot;bid.&quot;</div><div><br></div><di=
v>Every time I&#39;ve run into the problem of calculating the size of a tra=
nsaction with specific attributes I&#39;ve ended up having to sift through =
answers scatter across stack overflow posts, so I finally got around to bui=
lding a user friendly tool at=C2=A0<a href=3D"https://jlopp.github.io/bitco=
in-transaction-size-calculator/">https://jlopp.github.io/bitcoin-transactio=
n-size-calculator/</a></div><div><br></div><div>As I was looking for more d=
ata on constants to use in the calculation I was informed that the folks at=
 Bitcoin Optech have also been working on a calculator:=C2=A0<a href=3D"htt=
ps://bitcoinops.org/en/tools/calc-size">https://bitcoinops.org/en/tools/cal=
c-size</a></div><div><br></div><div>It seems clear that this is a common pr=
oblem for which we could use better tooling. I&#39;m also about 99% certain=
 that there&#39;s at least 1 or 2 bugs in my current calculator code.</div>=
<div><br></div><div>Please bookmark and share these tools; if you&#39;re ca=
pable and so inclined, code reviews would be greatly appreciated!</div><div=
><br></div><div>- Jameson</div></div>

--000000000000e1db7705a6a5b5e4--