upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md255
1 files changed, 237 insertions, 18 deletions
diff --git a/README.md b/README.md
index 9a55a5b..4453529 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,20 @@
1## Bitflash `BTF` 1<div align="center">
2
3<img src="docs/social.png" width="820" alt="Bitflash"/>
4
5# Bitflash `BTF`
6
2CPU-only cryptocurrency. A revival of Bitcoin 0.1.0 with RandomX proof of work and anonymous `.btf` addressing over Nostr. 7CPU-only cryptocurrency. A revival of Bitcoin 0.1.0 with RandomX proof of work and anonymous `.btf` addressing over Nostr.
3 8
4## Bitflash community 9![PoW](https://img.shields.io/badge/PoW-RandomX%20(CPU)-2ea44f?style=for-the-badge)
5Discord: https://discord.gg/TJG6vnXS9 10![Privacy](https://img.shields.io/badge/addresses-.btf%20anonymous-2ea44f?style=for-the-badge)
11![Tor](https://img.shields.io/badge/tor-onion%20service-7d4698?style=for-the-badge)
12![Fair Launch](https://img.shields.io/badge/premine-none-2ea44f?style=for-the-badge)
13[![Discord](https://img.shields.io/badge/discord-join-5865F2?style=for-the-badge)](https://discord.gg/n7B2Eamn3)
14
15**[Download](https://releases.bitflash.network/)** · **[Discord](https://discord.gg/n7B2Eamn3)**
16
17</div>
6 18
7--- 19---
8 20
@@ -12,7 +24,7 @@ Bitflash keeps Satoshi's original consensus rules and replaces two things:
12 24
13**RandomX proof of work.** Memory-hard algorithm used by Monero. A laptop competes equally with a server. ASICs and GPUs have no advantage. 25**RandomX proof of work.** Memory-hard algorithm used by Monero. A laptop competes equally with a server. ASICs and GPUs have no advantage.
14 26
15**Anonymous addressing.** Every node has a `.btf` address derived from its public key, similar to a Tor `.onion`. Nodes reach each other through encrypted rendezvous tunnels, so no port forwarding is needed and a node behind CGNAT works normally. 27**Anonymous addressing.** Every node has a `.btf` address derived from its public key, similar to a Tor `.onion`. Nodes reach each other through encrypted rendezvous tunnels by default, and can advertise a signed direct `.onion` endpoint for Tor peers.
16 28
17No premine. No ICO. 50 BTF per block, halving on schedule, 21M cap, ~2 minute blocks. 29No premine. No ICO. 50 BTF per block, halving on schedule, 21M cap, ~2 minute blocks.
18 30
@@ -20,27 +32,128 @@ No premine. No ICO. 50 BTF per block, halving on schedule, 21M cap, ~2 minute bl
20 32
21Worth being precise, because the difference matters if you are relying on it. 33Worth being precise, because the difference matters if you are relying on it.
22 34
23**A peer you reach over `.btf` does not learn your IP.** All outbound connections go through a rendezvous tunnel; there is no IP-based peer dialling left in the node. The relay forwards encrypted bytes and cannot read or alter them. 35**A peer you reach over `.btf` does not learn your IP.** Outbound peer discovery uses rendezvous tunnels by default. If both sides use Tor and the peer advertises a signed `.onion` endpoint, the node connects directly to that hidden service instead. In both cases the peer does not see your clearnet IP.
24 36
25**The rendezvous relay does see your IP.** It has to — it is the thing your TCP connection terminates on. Relays are run by volunteers, so treat that as a party who knows you are on the network. 37**The rendezvous relay sees your IP unless you use Tor.** It has to — it is the thing your TCP connection terminates on. With `-tor`, the relay sees Tor instead. With a signed direct `.onion` peer endpoint, the relay is not on that connection path at all.
26 38
27**The node still listens on 8433.** Nothing dials by IP any more, but the listener is still there, so anyone who already knows your address and can reach that port may connect directly. If that matters to you, firewall it. 39**The node still listens on 8433.** Nothing dials by IP any more, but the listener is still there, so anyone who already knows your address and can reach that port may connect directly. If that matters to you, firewall it.
28 40
29This is unlinkability between peers, not anonymity against a network observer. It is not Tor. 41This is unlinkability between peers, not anonymity against a network observer.
42For Tor routing and direct onion peer endpoints, start the node with `-tor`;
43see [Tor mode](docs/tor.md).
44For a plain SOCKS5 proxy without Tor-specific defaults, use
45`-socks=HOST:PORT`.
30 46
31--- 47---
32 48
33## Quick start 49## Quick start
34 50
51Download the [latest release](https://releases.bitflash.network/) and run. No
52install, no configuration — it connects automatically and starts syncing.
53
35**Linux:** make the `.AppImage` executable and run it. 54**Linux:** make the `.AppImage` executable and run it.
36 55
37**Windows:** extract the `-windows.zip` and run `Bitflash.exe`. 56**Windows:** extract the `-windows-with-tor.zip` and run `Bitflash.exe`. Tor is
57bundled and a managed Tor instance starts automatically, so onion transport
58works with no separate install. Pass `-nomanagedtor` to turn it off.
59
60Every release ships a `SHA256SUMS` covering the assets. Verifying takes a second
61and is worth doing:
62
63```bash
64sha256sum -c SHA256SUMS
65```
66
67For newer signed releases, verify the checksum file itself first:
68
69```bash
70gpg --verify SHA256SUMS.asc SHA256SUMS
71sha256sum -c SHA256SUMS
72```
73
74The helper below downloads the release assets, verifies `SHA256SUMS.asc` when it
75is present, then checks the hashes:
76
77```bash
78scripts/verify-release.sh latest
79```
80
81See [release verification](docs/release-verification.md) for the full release
82audit flow and the maintainer signing step.
83
84Public mirrors should make the latest checksum files available both under the
85versioned release directory and at the release root:
86
87```text
88https://releases.bitflash.network/v1.2.20/SHA256SUMS
89https://releases.bitflash.network/SHA256SUMS # alias to latest
90```
91
92Bitflash also ships a deterministic UTXO-set commitment tool:
93
94```bash
95python3 scripts/verify-utxo-set.py --out utxo-report.json --json
96```
97
98It reconstructs the best chain from local block files, computes the current
99UTXO root and supply, and writes canonical JSON that independent auditors can
100compare or timestamp externally with OpenTimestamps. See
101[UTXO-set commitments](docs/utxo-commitment.md).
102
103The same root can prove one unspent output without sharing the full UTXO set:
104
105```bash
106python3 scripts/prove-utxo.py TXID:VOUT --out utxo-proof.json --json
107python3 scripts/verify-utxo-proof.py utxo-proof.json
108```
109
110See [UTXO inclusion proofs](docs/utxo-proofs.md).
111
112Bitflash also ships a deterministic fair-launch verifier:
113
114```bash
115python3 scripts/verify-fair-launch.py --max-blocks 1000 --out bitflash-fair-launch-report.json --json
116```
117
118The report reads the local chain directly, checks the genesis launch baseline,
119and produces canonical JSON whose hash can be compared by independent auditors
120or timestamped externally with OpenTimestamps. See
121[fair-launch verification](docs/fair-launch.md).
122
123For a static local block explorer, generate HTML and JSON from either a data
124directory or explicit block files:
125
126```bash
127python3 scripts/build-explorer.py --datadir ~/.bitflash ./explorer-out
128python3 scripts/build-explorer.py ~/.bitflash/blk0001.dat ~/.bitflash/blk0002.dat ./explorer-out
129```
130
131The generated explorer is static and self-contained: `index.html`,
132`style.css`, `explorer.js`, `blocks.json`, `block/*.json`, and `logo.png`. It is
133safe to host behind a strict policy such as `default-src 'none'; img-src 'self';
134style-src 'self'; script-src 'self'; connect-src 'self'; base-uri 'none';
135form-action 'none'`.
38 136
39**Keep your node current.** Consensus rules have changed since the first 137**Keep your node current.** Consensus rules have changed since the first
40releases — 1.0.0 fixed a bug that let anyone spend anyone's coins. A node on an older build will accept 138releases — 1.2.1 fixed a bug that let anyone spend anyone's coins, and 1.2.2
139added a per-block signature-operation cap. A node on an older build will accept
41blocks that current nodes reject, which puts it on a different chain without any 140blocks that current nodes reject, which puts it on a different chain without any
42warning. 141warning.
43 142
143Two more reasons, both measured rather than theorised:
144
145- **Before 1.2.13** a node closed a disconnected peer's socket twice and left the
146 closed handle in its `select()` set, where it made `select()` fail on every
147 iteration. The node then spent its socket loop in an error path instead of
148 reading its peers — the deaf-node behaviour reported since 1.2.7. Two nodes
149 side by side on one machine, same network: the one without the fix held 11
150 peers and logged 741 spurious disconnections; the one with it held 21 and
151 logged none. On 1.2.13 in production, two mining nodes hold 13 and 18 peers
152 with zero.
153- **Before 1.2.11** a long-running Windows node accumulated sockets it never
154 released — 1262 of them in 26 hours on one machine, each holding an ephemeral
155 port. Restarting returned them; upgrading stops them accumulating.
156
44Your wallet and chain data live in `%APPDATA%\Bitflash` (Windows) or 157Your wallet and chain data live in `%APPDATA%\Bitflash` (Windows) or
45`~/.bitflash` (Linux) and are shared by every version, so upgrading is just 158`~/.bitflash` (Linux) and are shared by every version, so upgrading is just
46replacing the binary. Never delete that directory to "fix" something without a 159replacing the binary. Never delete that directory to "fix" something without a
@@ -50,6 +163,19 @@ backup — it holds your keys.
50 163
51## Your wallet: the phrase and the file 164## Your wallet: the phrase and the file
52 165
166Since 1.2.12 a wallet can hold twelve words that rebuild it. Since 1.2.13 those
167words also cover the address the window shows you. **Both still matter** — the
168phrase and the file back up different things, and the difference is where people
169lose money.
170
171Since 1.2.20 the file is a single self-contained `wallet.sqlite` by default. A
172fresh data directory starts on it; an existing Berkeley DB `wallet.dat` keeps
173working and the desktop app converts it in one click on first run, never
174touching the original, which stays as a fallback. Choose a backend explicitly
175with `-walletbackend=sqlite` or `-walletbackend=bdb`, recorded in a
176`wallet-backend` marker in the data directory. See
177[wallet storage](docs/storage.md).
178
53The derivation is written down in [docs/derivation.md](docs/derivation.md), with 179The derivation is written down in [docs/derivation.md](docs/derivation.md), with
54test vectors and a script that reproduces them from scratch. It is there so the 180test vectors and a script that reproduces them from scratch. It is there so the
55twelve words keep working even if this software does not: paths, address format 181twelve words keep working even if this software does not: paths, address format
@@ -63,8 +189,11 @@ bitflash -newphrase # create it, show it once, exit
63bitflash -restorephrase="twelve words here" # rebuild a wallet from it 189bitflash -restorephrase="twelve words here" # rebuild a wallet from it
64``` 190```
65 191
66`-newphrase` installs a BIP32 seed, derives the wallet's key pool and default 192`-newphrase` installs a BIP39/BIP32 seed and derives the wallet as a BIP44 tree
67receiving address from it, and prints the words once. It refuses if a phrase 193along `m/44'/4346950'/0'/…` — coin type **4346950** is `0x425446`, the ASCII
194bytes `BTF`, registered in [SLIP-0044](https://github.com/satoshilabs/slips/blob/master/slip-0044.md).
195It builds the key pool and default receiving address from the seed, and prints
196the words once. It refuses if a phrase
68already exists: replacing one silently would strand every coin on addresses the 197already exists: replacing one silently would strand every coin on addresses the
69written-down words no longer describe. 198written-down words no longer describe.
70 199
@@ -84,8 +213,17 @@ from the words. The wallet names such an address `Your Address (created before
84the recovery phrase)` so you can tell them apart. This is why file backups still 213the recovery phrase)` so you can tell them apart. This is why file backups still
85matter. 214matter.
86 215
216> **If you created a phrase on 1.2.12, run `-restorephrase` with the same twelve
217> words.** That release installed the seed but left the visible address and the
218> key pool random, so the wallet went on handing out addresses the words cannot
219> reproduce while the window said a phrase existed. Restoring repairs it.
220
87### The file 221### The file
88 222
223Under the SQLite default the wallet is one self-contained `wallet.sqlite`, and
224`-backupwallet` writes a matching `.sqlite` copy that opens on its own — no
225sidecar directory. The Berkeley DB notes below apply to a legacy `wallet.dat`.
226
89**Copying `wallet.dat` on its own is not a backup.** Berkeley DB ties the file 227**Copying `wallet.dat` on its own is not a backup.** Berkeley DB ties the file
90to the environment in the `database/` subdirectory beside it, so a lone 228to the environment in the `database/` subdirectory beside it, so a lone
91`wallet.dat` will not open elsewhere — the keys are all still in there, and the 229`wallet.dat` will not open elsewhere — the keys are all still in there, and the
@@ -123,7 +261,7 @@ as a verdict to somebody who has just lost a wallet.
123 261
124### When wallet.dat itself will not open 262### When wallet.dat itself will not open
125 263
126Everything above still runs through Berkeley DB. If the database is the thing 264A legacy `wallet.dat` runs on Berkeley DB. If that database is the thing
127that is broken — a build that will not read it, a file truncated by a bad copy, 265that is broken — a build that will not read it, a file truncated by a bad copy,
128an environment beyond recovery — the keys are usually still fine, and you can 266an environment beyond recovery — the keys are usually still fine, and you can
129take them out as text: 267take them out as text:
@@ -157,15 +295,48 @@ Open **Options** from the menu bar. Under Mining Mode:
157 295
158Pool announcements are published on Nostr with live status fields, so external tools can query the latest pool state by `.btf` address. 296Pool announcements are published on Nostr with live status fields, so external tools can query the latest pool state by `.btf` address.
159 297
298Pool operators also write a local `pool_status.json` every ten seconds and a
299`pool_rounds.json` proof ledger whenever they find blocks or pay miners. By
300default both are created in the data directory; use `-poolstatusfile=PATH` and
301`-poolroundsfile=PATH` to write them somewhere a dashboard or web sync can read.
302The files are informational only: nodes still discover pools through Nostr and
303`.btf`, not through any web domain.
304See [public pool directory](docs/pool-directory.md) for the website/API shape.
305
160**Participant** — mine to someone else's pool. Enter or select the pool's `.btf` address and enable Start Mining. 306**Participant** — mine to someone else's pool. Enter or select the pool's `.btf` address and enable Start Mining.
161 307
162SRBMiner and XMRig connect to operator pools through the `.btf` path: 308The built-in participant miner connects to operator pools through the `.btf`
309path. Use it — **third-party RandomX miners such as XMRig and SRBMiner cannot
310mine Bitflash pools**, and no amount of configuration changes that. In RandomX
311mode they speak the Monero-style JSON-RPC protocol (`login`/`job`/`submit`) and
312assume a Monero-style job: the nonce at byte 39 of the blob, and a 32-byte seed
313hash given as 64 hex characters. Bitflash pools speak Bitcoin-style Stratum
314(`mining.subscribe`/`mining.notify`/`mining.submit`) over an 80-byte header
315whose nonce is at byte 76 — byte 39 falls inside the merkle root — and key
316RandomX from a fixed 36-byte string that is not a hash at all.
317
318`-stratumbridge` carries that same Bitcoin-style Stratum over the `.btf` path,
319so a miner on this machine can reach a pool it otherwise could not address. It
320is a byte relay, not a protocol translator, so it helps only a miner that
321already speaks the pool's dialect, and it does not make the miners above work:
322
323```bash
324./bitflash -nogui -stratumbridge=POOL_BTF_ADDRESS -stratumbridgeport=3333
325```
326
327Estimate rewards and electricity cost locally:
163 328
164```bash 329```bash
165SRBMiner-MULTI --algorithm randomx --pool POOL_BTF_ADDRESS --wallet YOUR_BTF_ADDRESS --password x 330python3 scripts/bitflash-mining-calculator.py \
166xmrig -a rx/0 -o POOL_BTF_ADDRESS -u YOUR_BTF_ADDRESS -p x 331 --hashrate 21 --hashrate-unit kh/s \
332 --network-hashrate 1.56 --network-hashrate-unit mh/s \
333 --watts 140 --kwh-cost 0.10 \
334 --price 0.001 --pool-fee 1
167``` 335```
168 336
337See [mining calculator](docs/mining-calculator.md). Price is manual until
338Bitflash has a reliable public market.
339
169--- 340---
170 341
171## Headless / server mode 342## Headless / server mode
@@ -174,7 +345,11 @@ xmrig -a rx/0 -o POOL_BTF_ADDRESS -u YOUR_BTF_ADDRESS -p x
174./bitflash -nogui # node only 345./bitflash -nogui # node only
175./bitflash -nogui -gen # node + solo mining 346./bitflash -nogui -gen # node + solo mining
176./bitflash -nogui -gen -operator # pool operator 347./bitflash -nogui -gen -operator # pool operator
348./bitflash -nogui -gen -operator \
349 -poolstatusfile=/var/www/pool_status.json \
350 -poolroundsfile=/var/www/pool_rounds.json
177./bitflash -nogui -gen -participant=POOL_BTF_ADDRESS # mine to pool 351./bitflash -nogui -gen -participant=POOL_BTF_ADDRESS # mine to pool
352./bitflash -nogui -stratumbridge=POOL_BTF_ADDRESS # Stratum over .btf (see Mining)
178``` 353```
179 354
180Every option takes `-` or `/`. **Under MSYS2 use the `-` form** — the shell 355Every option takes `-` or `/`. **Under MSYS2 use the `-` form** — the shell
@@ -190,7 +365,13 @@ Other options worth knowing:
190 365
191```bash 366```bash
192-datadir=PATH # wallet and chain data elsewhere 367-datadir=PATH # wallet and chain data elsewhere
193-port=N # P2P listen port, default 8433 368-testnet # isolated test network genesis, datadir, port 18433, and magic
369-port=N # P2P listen port, default 8433; testnet default 18433
370-socks=HOST:PORT # SOCKS5 for outbound Nostr, .btf relay, and onion peer dials
371-tor[=HOST:PORT] # Tor mode; default local Tor SOCKS5 proxy is 127.0.0.1:9050
372-managedtor[=PATH] # start Tor, create a hidden service, advertise its onion
373-nomanagedtor # disable the automatic bundled-Tor startup
374-onionservice=HOST.onion:PORT # advertise this node's Tor hidden service
194-debug # verbose log; without it debug.log is nearly silent 375-debug # verbose log; without it debug.log is nearly silent
195-help # full list 376-help # full list
196``` 377```
@@ -199,10 +380,32 @@ Other options worth knowing:
199needed — the data directory takes an exclusive lock, so a second node pointed at 380needed — the data directory takes an exclusive lock, so a second node pointed at
200the same one will refuse to start. 381the same one will refuse to start.
201 382
383`-socks=127.0.0.1:9050` routes outbound Nostr discovery, `.btf` rendezvous
384dials, and direct `.onion` peer dials through a local SOCKS5 proxy such as Tor.
385When it is set, the node skips
386plain HTTP external-IP probes instead of leaking a direct request outside the
387proxy. IPv6 proxy endpoints use brackets, for example `-socks=[::1]:9050`.
388
389`-tor` is a privacy shorthand for the usual local Tor SOCKS5 listener at
390`127.0.0.1:9050`. It routes outbound Nostr discovery, `.btf` rendezvous dials,
391and signed direct `.onion` peer dials through Tor, and keeps external-IP probes
392disabled. Use `-tor=HOST:PORT` when Tor listens somewhere else.
393
394The desktop app starts a managed Tor automatically when no other Tor option is
395set, so onion transport works out of the box; `-nomanagedtor` turns that off.
396For a headless node, ask for it explicitly:
397
398`-managedtor[=PATH]` starts a Tor process for this node, writes a local `torrc`,
399creates a v3 hidden service for port `8433`, routes outbound discovery through
400that Tor instance, and signs the generated `.onion:8433` endpoint into the
401node's `.btf` descriptor. Without `PATH`, Bitflash looks for `tor/tor.exe`,
402`tor.exe`, or `tor` beside the binary and then on `PATH`. The hidden-service key
403is stored under the Bitflash data directory in `managed-tor/onion-service/`.
404
202### When something looks wrong 405### When something looks wrong
203 406
204**Menu > Diagnostics**, and the same report in `debug.log` every ten minutes: 407**Menu > Diagnostics**, and the same report in `debug.log` every ten minutes:
205peers held against peers `select()` is actually watching, blocks received and how 408peers held against peers the socket loop is actually watching, blocks received and how
206many arrived without a parent, the proof-of-work mode with the live miner thread 409many arrived without a parent, the proof-of-work mode with the live miner thread
207count, sockets by the part of the program that opened them, and per peer how long 410count, sockets by the part of the program that opened them, and per peer how long
208since the last message each way. There is a copy button — if you open an issue, 411since the last message each way. There is a copy button — if you open an issue,
@@ -284,6 +487,19 @@ make windows
284``` 487```
285Installs deps via pacman, produces `Bitflash-*-windows.zip`. 488Installs deps via pacman, produces `Bitflash-*-windows.zip`.
286 489
490To build the Windows package that also carries the Tor Expert Bundle:
491
492```bash
493make windows-tor
494```
495
496That produces `Bitflash-*-windows-with-tor.zip`. The release script downloads
497the Tor Expert Bundle from the official Tor archive, verifies its pinned SHA256,
498optionally verifies the Tor Project GPG signature when `gpg` is available, and
499places `tor/tor.exe` beside `Bitflash.exe` so `-managedtor` works without a
500separate Tor install. For release builds, use `TOR_VERIFY_GPG=required make
501windows-tor` to require the extra signature check.
502
287--- 503---
288 504
289## At a glance 505## At a glance
@@ -303,7 +519,8 @@ Installs deps via pacman, produces `Bitflash-*-windows.zip`.
303| Addressing | `.btf` rendezvous — see the caveats above | 519| Addressing | `.btf` rendezvous — see the caveats above |
304| Premine | None | 520| Premine | None |
305| Pool server | Built-in — `.btf` rendezvous only | 521| Pool server | Built-in — `.btf` rendezvous only |
306| Wallet recovery | Twelve-word phrase (BIP39 + BIP32), plus file backup | 522| Wallet recovery | Twelve-word phrase (BIP39 + BIP32 + BIP44, coin type 4346950), plus file backup |
523| Wallet storage | SQLite `wallet.sqlite` by default, or Berkeley DB `wallet.dat` |
307 524
308The halving interval is the number most people get wrong coming from Bitcoin. 525The halving interval is the number most people get wrong coming from Bitcoin.
309Same 210,000 blocks, but at two minutes instead of ten, so it arrives in about 526Same 210,000 blocks, but at two minutes instead of ten, so it arrives in about
@@ -311,4 +528,6 @@ ten months rather than four years.
311 528
312--- 529---
313 530
531Young network. Keep your node current and don't put in more than you are willing to lose.
532
314MIT. Built on Bitcoin 0.1.0 (Satoshi Nakamoto, 2009). 533MIT. Built on Bitcoin 0.1.0 (Satoshi Nakamoto, 2009).