-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
187 lines (178 loc) · 5.95 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Block Delivery Network</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
display: flex;
}
#navbar {
width: 300px;
background-color: #f4f4f4;
padding: 10px;
height: 100vh;
box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}
#navbar a {
text-decoration: none;
color: #333;
display: block;
padding: 8px;
}
#navbar b {
color: #333333;
display: block;
padding: 8px;
}
#navbar a:hover {
background-color: #ddd;
}
#content {
flex-grow: 1;
padding: 20px;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th {
background-color: #f0f0f0;
}
</style>
</head>
<body>
<div id="navbar">
<b>Content:</b>
<a href="#content">What is BDN?</a>
<a href="#rest">REST endpoints</a>
<a href="#github">GitHub</a>
</div>
<div id="content">
<h1>Block Delivery Network</h1>
<p>
<code>block-dn</code> is a simple web server that connects to your
existing Bitcoin full node to serve data from the time chain to fetch
over HTTP(S).
<br />
The goal is to serve the following data to Light Clients (e.g. mobile
wallets):
</p>
<ul>
<li>Block headers</li>
<li>Blocks</li>
<li>Compact Filter headers</li>
<li>Compact Filters</li>
</ul>
<p>
There are two ways to use <code>block-dn</code>:
</p>
<h2>Connect to your own node</h2>
<p>
Install and run <code>block-dn</code> on your own device and configure
that HTTP endpoint in your compatible wallet. Your own node's chain
information is then used to sync the wallet state.
</p>
<h2>Use the Cloud Flare CDN cached instance</h2>
<p>
If you have a way to find out the current most recent block hash from
your peers or your own node, the rest of the chain data (e.g. block
headers, blocks, compact filters) can be downloaded from an untrusted
source. Such an untrusted source can be found at
<a href="https://bdn.world">bdn.world</a> and
<a href="https://block-dn.org">block-dn.org</a> respectively. Both these
sites run an instance of <code>block-dn</code> and are behind Cloud
Flare's caching proxy service, effectively caching the data in
geographically distributed sites around the world for maximum access
speed and very low latency.
</p>
<section id="rest">
<h2>Available REST endpoints</h2>
<table>
<tr>
<th>Endpoint</th>
<th>Description</th>
<th>Example</th>
</tr>
<tr>
<td><code>/status</code></td>
<td>
Returns a JSON file with the latest block height and hash.
</td>
<td>
<a href="https://bdn.world/status">bdn.world/status</a>
</td>
</tr>
<tr>
<td><code>/block/<block_hash></code></td>
<td>
Returns a single block, identified by its block hash.
</td>
<td>
<a href="https://bdn.world/block/000000000000000000030ee5fab96c79dad247fc458d488dd7928d2536e75efc">
bdn.world/block/000000000000000000030ee5....
</a>
</td>
</tr>
<tr>
<td><code>/headers/<start_block></code></td>
<td>
Returns a binary file containing 100'000 block headers,
serialized as 80 bytes per header (8 MB per file).
</td>
<td>
<a href="https://bdn.world/headers/0">
bdn.world/headers/0
</a>
</td>
</tr>
<tr>
<td><code>/filter-headers/<start_block></code></td>
<td>
Returns a binary file containing 100'000 compact filter
headers, serialized as 32 bytes per filter header hash
(3.2 MB per file).
</td>
<td>
<a href="https://bdn.world/filter-headers/100000">
bdn.world/filter-headers/100000
</a>
</td>
</tr>
<tr>
<td><code>/filters/<start_block></code></td>
<td>
Returns a binary file containing 2'000 compact filters,
serialized as variable length byte arrays:
Each filter starting with a <code>VarInt</code> specifying
the length of a filter, followed by that many bytes for the
actual filter (up to 58 MiB per file as per block 817'995).
</td>
<td>
<a href="https://bdn.world/filters/802000">
bdn.world/filters/802000
</a>
</td>
</tr>
</table>
</section>
<section id="github">
<h2>Source code on GitHub</h2>
<p>
Check out the source code and installation instructions for this
project at <a href="https://github.com/guggero/block-dn">
github.com/guggero/block-dn</a>.
</p>
</section>
</div>
</body>
</html>