summaryrefslogtreecommitdiff
path: root/a2/47b4ddfa0b005a6b984022c63a3d13694f60dd
blob: f3d2b796bb2a21ca4b3e99228215db7f18334bb6 (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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
Return-Path: <christophera@gmail.com>
Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 458C2C002D
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 29 Aug 2022 18:19:47 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by smtp4.osuosl.org (Postfix) with ESMTP id 117CB4032C
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 29 Aug 2022 18:19:47 +0000 (UTC)
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 117CB4032C
Authentication-Results: smtp4.osuosl.org;
 dkim=pass (2048-bit key) header.d=lifewithalacrity-com.20210112.gappssmtp.com
 header.i=@lifewithalacrity-com.20210112.gappssmtp.com header.a=rsa-sha256
 header.s=20210112 header.b=XSzETYHm
X-Virus-Scanned: amavisd-new at osuosl.org
X-Spam-Flag: NO
X-Spam-Score: -1.399
X-Spam-Level: 
X-Spam-Status: No, score=-1.399 tagged_above=-999 required=5
 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001,
 HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
 autolearn=no autolearn_force=no
Received: from smtp4.osuosl.org ([127.0.0.1])
 by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id lg8cRNM9dmEc
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 29 Aug 2022 18:19:45 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.8.0
DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6ED444032B
Received: from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com
 [IPv6:2607:f8b0:4864:20::1133])
 by smtp4.osuosl.org (Postfix) with ESMTPS id 6ED444032B
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 29 Aug 2022 18:19:45 +0000 (UTC)
Received: by mail-yw1-x1133.google.com with SMTP id
 00721157ae682-33dce2d4bc8so216854127b3.4
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Mon, 29 Aug 2022 11:19:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=lifewithalacrity-com.20210112.gappssmtp.com; s=20210112;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc;
 bh=XO4L9no3a63DlRK9i30vMge7hafVme5jb6PO34BYves=;
 b=XSzETYHmTr4/G4ypXvQO6Obg2qR5+lb1eB0ScL30HyxrpysY5Woo82kbaU5/AOqdbM
 cgueK+wkV209tqgN4AAskJ5wD+u90Iv8+V3lXPHBBIhCuVqlEJPNSFPS5DgifSw65lnS
 TpD2IztRdOpDUAgsD+tSsY0+AnruMGXwBVc/GRcekgIrlJnAJfPsTaByRvGVQ2KGVQIP
 LltEYBuvnwqm7Z8X9mrjpTX75kHuCQbewL5hWmHuL7JJyKStN0LK5d/WkkWwlRjl1IX6
 9Zp04Z7eJwlhkEQQKMtnEhiJqS0hwhyqJJ2IdvpSRLE1DoBKQ8SQa1lhC1sfMa7pdFHr
 C+og==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc;
 bh=XO4L9no3a63DlRK9i30vMge7hafVme5jb6PO34BYves=;
 b=xsZZ9UqyUOH2ZQESWtT4xGbsD36mBscPSgN2VDtjD9VW/Pw0LSyK5TdKLCzx+t5FX2
 mHRrLk8MbR/EBnRTNwK4fCbhZh04hdJGDh82le0NJ6UP+UnLkzm0bKYbK1tsljPKqKz3
 q6aWvDQcizMz+dmzhfBTYlXs1mmHwYiHMP8OlQ97OGsrJCsuAh7cFZ9qpr7HrOkchl0L
 0fYOkAA99YNZkigDeAsLx4Ta/yEluKaDk/XpUWN4dnjO764uVxw4nk/VbW4SwjmClnLS
 WYgm81Vei2e4uyUUouYdxYgmlQGYu6OlTrxCN+TnAX3wKXznI2U4e+TaAZz+I1EZQvlW
 4OIQ==
X-Gm-Message-State: ACgBeo2h/VfgpwVJMLtEI4VM1r2J9k23RKjOZFWHAcDqgSw+6o2hEUr+
 7IgyxWrDsgbFRhpPj7NDomuXvonm+uPOP5zAX+0bX9ulQbg=
X-Google-Smtp-Source: AA6agR76oNqrmFfbfOj/0kjTHvr4UhQ9W1WIDUstA3ADsiOxGnYa65PJyZ2kQdIfuychfFS3mvjhycrzNZkQ/zp4JHY=
X-Received: by 2002:a81:f10:0:b0:33d:c7c6:434 with SMTP id
 16-20020a810f10000000b0033dc7c60434mr11399226ywp.78.1661797184319; 
 Mon, 29 Aug 2022 11:19:44 -0700 (PDT)
MIME-Version: 1.0
References: <mailman.13106.1661772392.956.bitcoin-dev@lists.linuxfoundation.org>
 <20220829154603.fec7mlm526vdfo2i@artanis>
In-Reply-To: <20220829154603.fec7mlm526vdfo2i@artanis>
From: Christopher Allen <ChristopherA@lifewithalacrity.com>
Date: Mon, 29 Aug 2022 11:19:07 -0700
Message-ID: <CACrqygDR4sGX8oY=BT9K_RSYCjsG0P-YBpi-sY5cuM8LBvsQtQ@mail.gmail.com>
To: Ali Sherief <ali@notatether.com>, 
 Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Content-Type: multipart/alternative; boundary="000000000000dc362d05e7654e1f"
X-Mailman-Approved-At: Mon, 29 Aug 2022 18:30:14 +0000
Cc: Nicholas Ochiel <nochiel@gmail.com>
Subject: Re: [bitcoin-dev] BIP Proposal: Wallet Labels Export Format
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: Mon, 29 Aug 2022 18:19:47 -0000

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

On Mon, Aug 29, 2022 at 9:12 AM Ali Sherief via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> wrote:

> I am aware that business processes are mostly CSV file oriented


I disagree that business processes are mostly CSV.  Amateur processes
maybe, but professional accounting, no. Trying to do my business accounting
with CSV files from various exchanges is PITA.


> so you can make a statement akin to BIP174 in the Goal 2 BIP, that expects
> the medium of exchange to be in files ending in .csv. I wouldn't mind if
> you require .csv file extension in a BIP for Goal 2. But such a statement
> is not appropriate in the Goal 1 BIP which is only concerned with the
> wallet label format itself.


I too would like to see some separation of layers here, as there are other
possible output formats. Maybe expanding on another use case for this data
would help.

I've been working with @nochiel <https://github.com/nochiel> on export
to a Plain-Text
Accounting <https://plaintextaccounting.org> friendly format,
initially the beancount
python app <https://github.com/beancount/beancount/>: (our prototype is
current at /beancounter.py but it is being refactored into new repo).

Basically what the final tool will do is: given a descriptor, get any
transactions for that descriptor from a random explora via Tor (initially
ours and Blockstream's), and then get price information from a random
Spotbit price server via Tor (initially just ours, but seeking more hosts),
and export a beancount compatible file.

```

python app.py beancount
"wpkh(tpubD9hudZxy8Uj3453QrsEbr8KiyXTYC5ExHjJ5sNDVW7yKJ8wc7acKQcpdbvZX6dFerHK6MfVvs78VvGfotjN28yC4ij6nr4uSVhX2qorUV8V/0/*)"
Outputs: spotbit.beancount

2008-10-31 commodity BTC
  name: "Bitcoin"
  asset-class: "cryptocurrency"

2018-04-02 open Assets:BTC BTC
2018-04-02 open Liabilities:Cash:USDT USDT

2018-04-02 * "tb1qcrekknrspx28t9vl53ltsag5gqgqdj066ydf75" "Transaction
hash: 2a2f7f24761fa54cb6e559efea5678415d9cbbabc42e6a4e2ce463ee3c446230"
Assets:BTC 1.00000000 BTC { 6935.16 USDT }
Liabilities:Cash:USDT - 6935.16 USDT

2018-04-02 * "tb1q45whzx3emntntnpzjdx3gzj6z5cgxakkg7s3sa" "Transaction
hash: 387123efcaa707759a4af8159cb1309fae86b793d26b5fd8bba42637852dde89"
Assets:BTC - 0.36300616 BTC @  6935.16 USDT
Liabilities:Cash:USDT 2517.51 USDT

2018-04-02 * "tb1qgv5484m83e2mzz3n8tf4snvnwj5qgqgampnhvv" "Transaction
hash: 387123efcaa707759a4af8159cb1309fae86b793d26b5fd8bba42637852dde89"
Assets:BTC - 0.63699243 BTC @  6935.16 USDT
Liabilities:Cash:USDT 4417.64 USDT

2018-04-02 * "tb1q45whzx3emntntnpzjdx3gzj6z5cgxakkg7s3sa" "Transaction
hash: 387123efcaa707759a4af8159cb1309fae86b793d26b5fd8bba42637852dde89"
Assets:BTC 0.36300616 BTC { 6935.16 USDT }
Liabilities:Cash:USDT - 2517.51 USDT
```

I can then use the beancount cli app (or it's fava webapp) to easily add
other details to this file to do my bitcoin accounting (and any other
accounting I need). In particular, as beancount support lots, it solves a
problem for me with US taxes which is unrealized capital gain (I get 1 BTC
from donor at $20K, the price goes up to $30K and I pay it to an engineer,
my BTC balance is 0 but my unrealized capital gain for US tax purposes  is
$10K).

More ideally, if there were additional details that I could merge in from
my wallet export, such as payer and payee, notes, etc. it would make my
accounting much easier.

Thus I'd like to see an easier and interoperable way to merge these details
(my account details from an Esplora and price details from Spotbit), with
what my different wallets may (or may not) have available.

I hope that this might inspire some ideas from the people working on this
wallet export format.

-- Christopher Allen

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

<div dir=3D"ltr"><div dir=3D"ltr">On Mon, Aug 29, 2022 at 9:12 AM Ali Sheri=
ef via bitcoin-dev &lt;<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.=
org">bitcoin-dev@lists.linuxfoundation.org</a>&gt; wrote:<br></div><div cla=
ss=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0p=
x 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color=
:rgb(204,204,204);padding-left:1ex">I am aware that business processes are =
mostly CSV file oriented</blockquote><div><br></div><div>I disagree that bu=
siness processes are mostly CSV.=C2=A0 Amateur processes maybe, but profess=
ional accounting, no. Trying to do my business accounting with CSV files fr=
om various exchanges is PITA.</div><div>=C2=A0</div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left-width:1px;border-l=
eft-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">so you=
 can make a statement akin to BIP174 in the Goal 2 BIP, that expects the me=
dium of exchange to be in files ending in .csv. I wouldn&#39;t mind if you =
require .csv file extension in a BIP for Goal 2. But such a statement is no=
t appropriate in the Goal 1 BIP which is only concerned with the wallet lab=
el format itself.</blockquote><div><br></div><div>I too would like to see s=
ome separation of layers here, as there are other possible output formats. =
Maybe expanding on another use case for this data would help.</div><div><br=
></div><div>I&#39;ve been working with=C2=A0<a href=3D"https://github.com/n=
ochiel">@nochiel</a>=C2=A0on export to a <a href=3D"https://plaintextaccoun=
ting.org">Plain-Text Accounting</a> friendly format, initially the <a href=
=3D"https://github.com/beancount/beancount/ ">beancount python=C2=A0app</a>=
: (our prototype is current at=C2=A0<a href=3D"http:///beancounter.py">/bea=
ncounter.py</a> but it is being refactored into new repo).</div><div><br></=
div><div>Basically what the final tool will do is: given a descriptor, get =
any transactions for that descriptor from a random explora via Tor (initial=
ly ours and Blockstream&#39;s), and then get price information from a rando=
m Spotbit price server via Tor (initially just ours, but seeking more hosts=
), and export a beancount compatible file.</div><div><br></div><div><font f=
ace=3D"monospace">```</font></div><div><font face=3D"monospace"><span id=3D=
"gmail-docs-internal-guid-09e35ecc-7fff-4e65-0c46-2d6d7acdfb59" style=3D"co=
lor:rgb(0,0,0)"><p dir=3D"ltr" style=3D"line-height:1.38;margin-top:0pt;mar=
gin-bottom:0pt">python app.py beancount &quot;wpkh(tpubD9hudZxy8Uj3453QrsEb=
r8KiyXTYC5ExHjJ5sNDVW7yKJ8wc7acKQcpdbvZX6dFerHK6MfVvs78VvGfotjN28yC4ij6nr4u=
SVhX2qorUV8V/0/*)&quot;<br>Outputs: spotbit.beancount<br><br>2008-10-31 com=
modity BTC<br>=C2=A0 name: &quot;Bitcoin&quot;<br>=C2=A0 asset-class: &quot=
;cryptocurrency&quot;<br><br>2018-04-02 open Assets:BTC	BTC<br>2018-04-02 o=
pen Liabilities:Cash:USDT	USDT<br><br>2018-04-02 * &quot;tb1qcrekknrspx28t9=
vl53ltsag5gqgqdj066ydf75&quot; &quot;Transaction hash: 2a2f7f24761fa54cb6e5=
59efea5678415d9cbbabc42e6a4e2ce463ee3c446230&quot;<br>	Assets:BTC	 1.000000=
00 BTC { 6935.16 USDT }<br>	Liabilities:Cash:USDT	- 6935.16 USDT	<br><br>20=
18-04-02 * &quot;tb1q45whzx3emntntnpzjdx3gzj6z5cgxakkg7s3sa&quot; &quot;Tra=
nsaction hash: 387123efcaa707759a4af8159cb1309fae86b793d26b5fd8bba42637852d=
de89&quot;<br>	Assets:BTC	- 0.36300616 BTC @ =C2=A06935.16 USDT	<br>	Liabil=
ities:Cash:USDT	 2517.51 USDT	<br><br>2018-04-02 * &quot;tb1qgv5484m83e2mzz=
3n8tf4snvnwj5qgqgampnhvv&quot; &quot;Transaction hash: 387123efcaa707759a4a=
f8159cb1309fae86b793d26b5fd8bba42637852dde89&quot;<br>	Assets:BTC	- 0.63699=
243 BTC @ =C2=A06935.16 USDT	<br>	Liabilities:Cash:USDT	 4417.64 USDT	<br><=
br>2018-04-02 * &quot;tb1q45whzx3emntntnpzjdx3gzj6z5cgxakkg7s3sa&quot; &quo=
t;Transaction hash: 387123efcaa707759a4af8159cb1309fae86b793d26b5fd8bba4263=
7852dde89&quot;<br>	Assets:BTC	 0.36300616 BTC { 6935.16 USDT }<br>	Liabili=
ties:Cash:USDT	- 2517.51 USDT=C2=A0<br></p></span><font color=3D"#000000"><=
span style=3D"caret-color: rgb(0, 0, 0);">```</span></font></font></div><di=
v><br></div><div>I can then use the beancount cli app (or it&#39;s fava web=
app) to easily add other details to this file to do my bitcoin accounting (=
and any other accounting I need). In particular, as beancount support lots,=
 it solves a problem for me with US taxes which is unrealized capital gain =
(I get 1 BTC from donor at $20K, the price goes up to $30K and I pay it to =
an engineer, my BTC balance is 0 but my unrealized capital gain for US tax =
purposes =C2=A0is $10K).</div><div><br></div><div>More ideally, if there we=
re additional details that I could merge in from my wallet export, such as =
payer and payee, notes, etc. it would make my accounting much easier.=C2=A0=
</div><div><br></div><div>Thus I&#39;d like to see an easier and interopera=
ble way to merge these details (my account details from an Esplora and pric=
e details from Spotbit), with what my different wallets may (or may not) ha=
ve available.</div><div><br></div><div>I hope that this might inspire some =
ideas from the people working on this wallet export format.</div><div><br><=
/div><div>-- Christopher Allen</div><div><br></div></div></div>

--000000000000dc362d05e7654e1f--