summaryrefslogtreecommitdiff
path: root/71/97d4b515b8152f796220422a9204c6b8a85579
blob: ffab4d73b0e14f24cfd9a094cddb569208e5044a (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
Return-Path: <elombrozo@gmail.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 54946121A
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 23 Sep 2015 00:07:25 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com
	[209.85.220.46])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id D99F71CC
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 23 Sep 2015 00:07:24 +0000 (UTC)
Received: by pacbt3 with SMTP id bt3so4835098pac.3
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Tue, 22 Sep 2015 17:07:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:to:subject:cc:date:message-id:in-reply-to:reply-to:user-agent
	:mime-version:content-type:content-transfer-encoding;
	bh=dncAtn0PsDDcR5MFdLSPV6wecCAwZ9OfZ5ulKnXIKus=;
	b=cCcfPx+YY7MqNYUMtVy7L1ESbOvTiOyCs9MDJU9GUU3o07xc5dzRKE2Xqa2zX1xQVm
	IqKQQaoRcWNIqb5d08H50sfxUVTO0PIHZrwSoQgAxyShFqLiFWQXtlz/iVdZ+M00Xipp
	nk90HWCYAM7JSvCVlaimt//YbXjMIb3gEzg2PkFIyg88EG+bm2XJreHdcXZ5gBNGY7Nk
	JjXzIo12yy6TsgC/F8N6Aipc1VXzjc04BecX/X1YP2Xp19+Fe+nA6oK1X3MLYH28Vi68
	bCpWVjYQq3bdwe4ODTA12D2Gh5HqpvGnvPJc+JYzufLzKAqoNMH0Xdxy15PaJON/NjgX
	eicg==
X-Received: by 10.66.144.40 with SMTP id sj8mr34124953pab.72.1442966844610;
	Tue, 22 Sep 2015 17:07:24 -0700 (PDT)
Received: from [192.168.1.108] (cpe-76-167-237-202.san.res.rr.com.
	[76.167.237.202]) by smtp.gmail.com with ESMTPSA id
	d13sm4402535pbu.17.2015.09.22.17.07.23
	(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Tue, 22 Sep 2015 17:07:24 -0700 (PDT)
From: "Eric Lombrozo" <elombrozo@gmail.com>
To: =?utf-8?q?Jorge=20Tim=c3=b3n?= <jtimon@jtimon.cc>,
	"Wladimir J. van der Laan" <laanwj@gmail.com>
Date: Wed, 23 Sep 2015 00:07:22 +0000
Message-Id: <em9a15c95a-cdb0-451f-8b69-e73572a722d2@platinum>
In-Reply-To: <CABm2gDrx4uDVPFL_tWUsvh_cN6qV903WCmgpA_Kj9Deq+Q3yfA@mail.gmail.com>
Reply-To: "Eric Lombrozo" <elombrozo@gmail.com>
User-Agent: eM_Client/6.0.23181.0
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM,
	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
Cc: Bitcoin development mailing list <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] Long-term vision for bitcoind (was libconsensus
 and bitcoin development process)
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, 23 Sep 2015 00:07:25 -0000

Here's what I propose as a long-term plan:

1) libconsensus
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
We should probably start by defining an API for libconsensus. It should=20
support an abstract DB model, track chain state, provide query=20
mechanisms for blocks and transactions with optional pruning and=20
indexing, expose a subscription mechanism for events such as NEW_TIP,=20
REORG, etc, and contain a script interpreter.

We can develop the library in parallel with Bitcoin Core without too=20
much refactoring of Bitcoin Core itself...just moving pieces of Bitcoin=20
Core's consensus code into the new library, tracking code movements to=20
make merging easier. Yes, this is a bit ugly as it requires code=20
duplication...but it will temporarily avoid much of the downstream=20
pushback we're getting. The idea is that we can prove out the library=20
with some simple projects, then start removing the consensus stuff from=20
Bitcoin Core once we have greater acceptance of the library and better=20
documentation.


2) peer services
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
We develop a peer services library that performs the tasks of peer=20
discovery and relay, with the ability to connect to appropriate peers=20
and queue messages. It uses libconsensus for all validation=20
functionality and as a datastore for the consensus state but maintains=20
its own database for peer history and statistics. I believe Cory has=20
been working on this already using libevent. I've already developed an=20
async library for this as well.


3) API/RPC
=3D=3D=3D=3D=3D=3D=3D
We provide high level calls and pub/sub mechanisms. ZMQ has been=20
implemented and added already, but we could support other transports as=20
well.


4) Wallet
=3D=3D=3D=3D=3D=3D
The wallet is split out into a separate process that connects to the=20
stack via the API/RPC layer.


- Eric

------ Original Message ------
From: "Jorge Tim=C3=B3n" <bitcoin-dev@lists.linuxfoundation.org>
To: "Wladimir J. van der Laan" <laanwj@gmail.com>
Cc: "Bitcoin development mailing list"=20
<bitcoin-dev@lists.linuxfoundation.org>
Sent: 9/22/2015 11:36:14 AM
Subject: [bitcoin-dev] Long-term vision for bitcoind (was libconsensus=20
and bitcoin development process)

>On Fri, Sep 18, 2015 at 2:07 AM, Wladimir J. van der Laan via
>bitcoin-dev <bitcoin-dev@lists.linuxfoundation.org> wrote:
>>  My long-term vision of bitcoind is a P2P node with validation and=20
>>blockchain store, with a couple of data sources that can be subscribed=
=20
>>to or pulled from.
>
>I agree with this long term vision.
>Here's how I think it could happen:
>
>1) Libconsensus is completed and moved to a subtree (which has libsecp
>as an internal subtree)
>
>2) Bitcoind becomes a subtree of bitcoin-wallet (which has
>bitcoin-wallet and bitcoin-qt)
>
>Without aggressively changing it for this purpose, libconsensus should
>tend to become C, like libsecp, which is better for proving
>correctness.
>Hopefully at some point it won't take much to move to C.
>
>Upper layers should move to C++11
>
>Don't focus on the git subtrees, the basic architecture is bitcoin-qt
>on top of bitcoin-wallet, bitcoin-wallet on top of bitcoind (and
>friends like bitcoin-cli and bitcoin-tx), bitcoind on top of
>libconsensus on top of libsecp256k1.
>
>I believe this would maximize the number of people who can safely
>contribute to the project.
>I also believe this is the architecture most contributors have in mind
>for the long term, but I may be wrong about it.
>
>Criticisms to this plan?
>_______________________________________________
>bitcoin-dev mailing list
>bitcoin-dev@lists.linuxfoundation.org
>https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev