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
|
Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192]
helo=mx.sourceforge.net)
by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76)
(envelope-from <mark@monetize.io>) id 1WERlX-0000hI-F8
for bitcoin-development@lists.sourceforge.net;
Fri, 14 Feb 2014 23:01:51 +0000
Received: from mail-pb0-f41.google.com ([209.85.160.41])
by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128)
(Exim 4.76) id 1WERlW-0007VI-C0
for bitcoin-development@lists.sourceforge.net;
Fri, 14 Feb 2014 23:01:51 +0000
Received: by mail-pb0-f41.google.com with SMTP id up15so13011550pbc.0
for <bitcoin-development@lists.sourceforge.net>;
Fri, 14 Feb 2014 15:01:44 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20130820;
h=x-gm-message-state:message-id:date:from:organization:user-agent
:mime-version:to:subject:references:in-reply-to:content-type
:content-transfer-encoding;
bh=fyZWOQAiTh6OihIncq5GViQ/yS7Wr6UGRXNVoxIU/ak=;
b=bRPRalEU8L6ozktWsC52gPd5h2eBxyW2aW6L+3rMLZM50vCxNeP88kVXMvfoRfp61P
H/HdxP5xLDVHyaCBkRYYA2wu42sWjRF3jDshPxwhD2Mm0eynN09GejBD0Wode/8D0huZ
thzuomHCDeOppM3d9dBLr8g3n4EX47yMaJ1t7rfryK2qTV7CpsHaOrRCb7gkLsfAFIFO
/zH48UKw0zyi+N+1kif/M2qQ0q0T1O2l1wbJUR6mjujgeOv1WOkLYcvLyvTlarghM4bF
Llgm/l3W5/JgP2HGfrGME7r1ztWjqH/patkIDnJMX0ezBtysZ2mnhn2nsg3cOs7Aou2B
tneg==
X-Gm-Message-State: ALoCoQlMgZHGez7tfF8O+6UlMQeCPn/ld+BHg2V8Z8qHq0Ve7Jg1i0u8JGr+4FJ2+4/hrNtac21n
X-Received: by 10.68.133.229 with SMTP id pf5mr11985376pbb.115.1392418904329;
Fri, 14 Feb 2014 15:01:44 -0800 (PST)
Received: from [192.168.127.188] (50-0-36-81.dsl.dynamic.sonic.net.
[50.0.36.81])
by mx.google.com with ESMTPSA id xs1sm51113645pac.7.2014.02.14.15.01.42
for <multiple recipients>
(version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
Fri, 14 Feb 2014 15:01:43 -0800 (PST)
Message-ID: <52FEA055.7010408@monetize.io>
Date: Fri, 14 Feb 2014 15:01:41 -0800
From: Mark Friedenbach <mark@monetize.io>
Organization: Monetize.io Inc.
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
rv:24.0) Gecko/20100101 Thunderbird/24.2.0
MIME-Version: 1.0
To: Denis Andrejew <da.colonel@gmail.com>,
bitcoin-development@lists.sourceforge.net
References: <CAPc1t_8kp7dRpjPkK0K6K+mBz4dF9tsVx9n55eaW30FeFvU1EA@mail.gmail.com>
<52FE4782.6020001@monetize.io>
<CAPc1t_8DPeEZnHHhxNNYs9YXP+C78kW-u_hgxahAAGQVLDzpFw@mail.gmail.com>
In-Reply-To: <CAPc1t_8DPeEZnHHhxNNYs9YXP+C78kW-u_hgxahAAGQVLDzpFw@mail.gmail.com>
X-Enigmail-Version: 1.6
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Spam-Report: Spam Filtering performed by mx.sourceforge.net.
See http://spamassassin.org/tag/ for more details.
X-Headers-End: 1WERlW-0007VI-C0
Subject: Re: [Bitcoin-development] working with the blockchain: transaction
fees & sum(inputs) != sum(outputs) (newbie questions)
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: Fri, 14 Feb 2014 23:01:51 -0000
Still straightforward: get a list of transaction hashes for the block
from bitcoind, then query these transactions from the UTXO changestate
database.
On 02/14/2014 12:56 PM, Denis Andrejew wrote:
> Thanks Wladimir, perfect info!
>
> Mark, sounds good. But most likely this DB is keeping this
> information only for the current state of the blockchain and what I
> need really is to be able to get the unspent outputs (and calculate
> the balance for all addresses) for any particular block I happen to
> be interested in :)
>
> - Denis
>
> "Be the change you want to see in the world." (Mahatma Gandhi)
>
>
> On Fri, Feb 14, 2014 at 5:42 PM, Mark Friedenbach
> <mark@monetize.io <mailto:mark@monetize.io>> wrote:
>
> On 02/14/2014 04:20 AM, Denis Andrejew wrote:
>> What I'm trying to do is read the blockchain in order to find
>> all unspent outputs. I'm using bitcoind via rpc as my source of
>> information about the blockchain.
>
> By the way, bitcoind keeps this information in a special LevelDB
> database in the chainstate directory. It would be rather simple to
> iterate over the database for the list of al unspent outputs.
>
>
|