Skip to content

Commit 1c5757d

Browse files
authoredAug 9, 2025
Fix encoding problems
1 parent 6359d23 commit 1c5757d

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed
 

‎README.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Betanet Version 1.0 – Official Implementation Specification
1+
# Betanet Version 1.0 Official Implementation Specification
22

33
> **Normative document.** All requirements marked **MUST**, **MUST NOT**, or **SHALL** are mandatory for compliance.
44
@@ -14,7 +14,7 @@ The design eliminates single points of failure, disguises itself as ordinary HTT
1414
## 1 General Encoding Rules
1515

1616
* Multi-byte integers: **unsigned big-endian**.
17-
* `varint`: QUIC variable-length integer (RFC 9000 §16).
17+
* `varint`: QUIC variable-length integer (RFC 9000 §16).
1818
* Unless stated, all sizes are in bytes.
1919
* Binary examples use hexadecimal.
2020

@@ -28,10 +28,10 @@ The design eliminates single points of failure, disguises itself as ordinary HTT
2828
| AEAD | **ChaCha20-Poly1305** (IETF, 12-B nonce, 16-B tag) |
2929
| KDF | **HKDF-SHA256** |
3030
| Signatures | **Ed25519** |
31-
| Diffie–Hellman | **X25519** |
32-
| Post-quantum hybrid<sup>†</sup> | **X25519-Kyber768** (draft-ietf-pqtls-00) |
31+
| Diffie–Hellman | **X25519** |
32+
| Post-quantum hybrid<sup></sup> | **X25519-Kyber768** (draft-ietf-pqtls-00) |
3333

34-
> †Offering the hybrid ciphersuite is **MUST** after *2027-01-01*.
34+
> Offering the hybrid ciphersuite is **MUST** after *2027-01-01*.
3535
3636
---
3737

@@ -63,7 +63,7 @@ The design eliminates single points of failure, disguises itself as ordinary HTT
6363
+-------------------------------+
6464
| Payload Length |
6565
+-------------------------------+
66-
| Path Segment 0 … |
66+
| Path Segment 0 |
6767
+-------------------------------+
6868
```
6969

@@ -77,19 +77,19 @@ For links without native SCION support, prepend:
7777

7878
```
7979
+-------+-------------------------------------------------+
80-
| ID=0xF1 | 64-B Ed25519 sig over (prev-AS ‖ next-AS) |
80+
| ID=0xF1 | 64-B Ed25519 sig over (prev-AS next-AS) |
8181
+-------+-------------------------------------------------+
8282
```
8383

8484
Gateways **MUST** verify and strip this header when re-entering a SCION-capable segment.
8585

8686
### 4.3 Path Maintenance
8787

88-
End hosts **MUST** maintain **≥ 3** disjoint validated paths to every peer and switch within **300 ms** of failure detection.
88+
End hosts **MUST** maintain ** 3** disjoint validated paths to every peer and switch within **300 ms** of failure detection.
8989

9090
---
9191

92-
## 5 Cover Transport (L2) — HTX
92+
## 5 Cover Transport (L2) HTX
9393

9494
### 5.1 Outer TLS 1.3 Handshake
9595

@@ -100,7 +100,7 @@ End hosts **MUST** maintain **≥ 3** disjoint validated paths to every peer
100100

101101
### 5.2 Access-Ticket Bootstrap
102102

103-
1. The server’s decoy site embeds `ticketPub` (32-B X25519 public key, Base64URL).
103+
1. The server’s decoy site embeds `ticketPub` (32-B X25519 public key, Base64URL).
104104
2. Client generates `ticketPriv`, computes `sharedSecret = X25519(ticketPriv, ticketPub)`.
105105
3. Client picks 32-B random `nonce32`.
106106
4. `accessTicket = HKDF(sharedSecret, "betanet-ticket", nonce32, 32)`.
@@ -115,8 +115,8 @@ End hosts **MUST** maintain **≥ 3** disjoint validated paths to every peer
115115

116116
### 5.3 Noise *XK* Handshake & Inner Keys
117117

118-
Unchanged from §2 .3 of prior draft: derive `K_inner = HKDF-Expand-Label(TLS-Exporter, "htx inner", "", 32)`.
119-
AEAD nonce: **96-bit little-endian counter** (wrap ≈2⁹⁶-1 frames).
118+
Unchanged from §2 .3 of prior draft: derive `K_inner = HKDF-Expand-Label(TLS-Exporter, "htx inner", "", 32)`.
119+
AEAD nonce: **96-bit little-endian counter** (wrap ≈2⁹⁶-1 frames).
120120

121121
### 5.4 Inner Frame Format
122122

@@ -137,11 +137,11 @@ struct Frame {
137137
| Frame | Requirement |
138138
| -------------- | ----------------------------- |
139139
| SETTINGS | Within 30 ms of stream 0 open |
140-
| WINDOW\_UPDATE | When ≥ 50 % of window used |
141-
| PING | Every 15 s ± 3 s |
142-
| PRIORITY | On ≈1 % of connections |
140+
| WINDOW\_UPDATE | When 50 % of window used |
141+
| PING | Every 15 s ± 3 s |
142+
| PRIORITY | On ≈1 % of connections |
143143

144-
Idle padding: if no DATA for 512 ± 128 ms, send dummy 1 KiB encrypted DATA.
144+
Idle padding: if no DATA for 512 ± 128 ms, send dummy 1 KiB encrypted DATA.
145145

146146
### 5.6 UDP Variant
147147

@@ -166,7 +166,7 @@ Idle padding: if no DATA for 512 ± 128 ms, send dummy 1 KiB encrypted DATA.
166166

167167
### 6.3 Bootstrap Discovery
168168

169-
The client **MUST** keep trying methods **a → e** until ≥ 5 peers respond:
169+
The client **MUST** keep trying methods **a e** until 5 peers respond:
170170

171171
| Order | Method | Central infra? |
172172
| ----- | ------------------------------------------------------------------ | ------------------- |
@@ -180,7 +180,7 @@ The client **MUST** keep trying methods **a → e** until ≥ 5 peers r
180180

181181
* CID =`multihash(SHA-256(content))`.
182182
* Bitswap-v2 on `/betanet/bitswap/2.1.0`.
183-
* Requester **SHOULD** open ≥ 3 parallel streams on distinct SCION paths.
183+
* Requester **SHOULD** open 3 parallel streams on distinct SCION paths.
184184

185185
---
186186

@@ -190,14 +190,14 @@ The client **MUST** keep trying methods **a → e** until ≥ 5 peers r
190190

191191
| Mode | Requirement |
192192
| ---------------------- | ------------------------------------- |
193-
| **strict** | Every stream through ≥ 3 Nym hops |
194-
| **balanced** (default) | ≥ 1 hop until peer-trust ≥ 0.8 |
193+
| **strict** | Every stream through 3 Nym hops |
194+
| **balanced** (default) | 1 hop until peer-trust 0.8 |
195195
| **performance** | No mixnet unless dest label `.mixreq` |
196196

197197
### 7.2 Mixnode Selection
198198

199199
`seed = SHA256(srcPeerID || dstPeerID || unixHour)`
200-
— used as VRF input to pick hops.
200+
used as VRF input to pick hops.
201201

202202
---
203203

@@ -209,15 +209,15 @@ The client **MUST** keep trying methods **a → e** until ≥ 5 peers r
209209
betanet://<hex SHA-256(service-pubkey)>[/resource]
210210
```
211211

212-
Verify that the peer’s presented pubkey hashes to the ID.
212+
Verify that the peer’s presented pubkey hashes to the ID.
213213

214214
### 8.2 Human-Readable Alias Ledger
215215

216216
A record is valid **only if** identical payload appears at the same height on at least **2 of 3** chains:
217217

218218
* **Handshake** Layer-1
219219
* **Filecoin FVM**
220-
* **Ethereum L2 “Raven-Names”**
220+
* **Ethereum L2 “Raven-Names”**
221221

222222
Re-orgs deeper than 12 blocks are ignored.
223223

@@ -233,15 +233,15 @@ betanet1 pk=<hex32> sig=<base64sig> exp=<unixSec>
233233

234234
### 9.1 Federated Cashu Mints
235235

236-
* Each mint = FROST-Ed25519 **(n ≥ 5, t = 3)** group.
236+
* Each mint = FROST-Ed25519 **(n 5, t = 3)** group.
237237
* Keyset ID =`SHA-256(sorted pubkeys)`.
238238
* Relays **MUST** accept vouchers from any announced keyset (topic `betanet.mints`).
239239

240240
Voucher (64 B): `secret32 || aggregatedSig32`.
241241

242242
### 9.2 Settlement
243243

244-
Relays **MAY** redeem ≥ 10 000 sat via their own Lightning node or swap with peers.
244+
Relays **MAY** redeem 10 000 sat via their own Lightning node or swap with peers.
245245
Vouchers never leave encrypted streams.
246246

247247
---
@@ -263,12 +263,12 @@ vote_weight = uptime_score + log10(total_ecash_staked / 1 000 sat + 1)
263263
A version proposal passes when
264264

265265
```
266-
Σ weight(ACK) ≥ 0.67 × Σ weight(all_reachable_nodes)
266+
Σ weight(ACK) 0.67 × Σ weight(all_reachable_nodes)
267267
```
268268

269269
### 10.3 Upgrade Delay
270270

271-
After threshold reached, activation waits **≥ 30 days**.
271+
After threshold reached, activation waits ** 30 days**.
272272
Raven Development Team publishes a time-lock hash of the final spec text.
273273

274274
---
@@ -278,9 +278,9 @@ Raven Development Team publishes a time-lock hash of the final spec text.
278278
An implementation is **compliant** if it:
279279

280280
1. Implements HTX over TCP-443 **and** QUIC-443 with TLS 1.3 mimic + ECH.
281-
2. Uses rotating access tickets (§5.2).
281+
2. Uses rotating access tickets (§5.2).
282282
3. Encrypts inner frames with ChaCha20-Poly1305, 24-bit length, 96-bit nonce.
283-
4. Maintains ≥ 3 signed SCION paths **or** attaches a valid IP-transition header.
283+
4. Maintains 3 signed SCION paths **or** attaches a valid IP-transition header.
284284
5. Offers `/betanet/htx/1.0.0` **and** `/betanet/htxquic/1.0.0` transports.
285285
6. Implements deterministic DHT seed bootstrap.
286286
7. Verifies alias ledger with 2-of-3 chain consensus.

0 commit comments

Comments
 (0)
Please sign in to comment.