Skip to content

Commit 858bf4a

Browse files
docs(chains): wave 6 deep research — Litecoin / Dogecoin / Bitcoin Cash (3 BTC forks DIFF-ONLY)
延续 P1-2 28 链 method-level 调研。本 wave 实施护栏 2 最激进 diff-only 模式, 3 BTC fork 链 zh+en 合计 ~1200 行(对比 wave 1-4 平均 460 行/链,本 wave 平均 200 行,**降 56%**)。 ## 调研产出 | 链 | zh 行 | en 行 | call | family | 关键发现 | |---|---|---|---|---|---| | 19-litecoin | 199 | 199 | 9 | utxo-btc (复用) | RPC 公链几乎不存在(publicnode 404/ankr 403),仅 Esplora REST;100% method 兼容;0 新 DSL 字段 | | 20-dogecoin | 176 | 176 | 10 | utxo-btc (复用) | RPC 公链彻底没有(全 403/422);scantxoutset 不支持;3 新 DSL ASK | | 21-bch | 218 | 218 | 19 | utxo-btc (复用) | **context bch.publicnode.com 404**(修正);**CashAddr 新枚举**;无 SegWit/weight;SLP 排除 | ## H8 实证证据(每链) **Litecoin** (litecoinspace.org Esplora REST + blockchair + blockcypher): - 真实 height 3,112,566 + hash c72dd1d0... ✅ - 真实 weight 959,787,929 tx/block ✅ - 真实 24h block count 601(实证 ≈ 144s/块 ≈ 2.5min target)✅ - **publicnode.com 不托管 LTC RPC**(404)→ 公链 JSON-RPC 不可用结论,文档真实标注 - 无 ankr 公链(403 paid only) - 8/8 监控 method schema 与 BTC 完全一致(0 method diff) - mWEB optional 字段非 breaking(BTC adapter 现有 unknown_type 分支处理) **Dogecoin** (BlockCypher + Blockchair REST,JSON-RPC 全无): - 真实 height 6,218,871 + hash 14e0...3018(2 REST 源交叉验证)✅ - 真实 ver=6422788 (0x620104) AuxPoW 版本 flag ✅ - 真实 nonce=0(AuxPoW 期望) - publicnode 空 / Ankr 403 / NowNodes 422 key-only → JSON-RPC 公链彻底无 - 7/8 method 与 BTC 完全一致;scantxoutset 唯一不支持 - getblock 多 auxpow 子对象;tx 缺 vsize/weight/wtxid(无 SegWit) - Doge 专属 getauxblock 存在但 benchmark 无关 - 两层 fork(BTC→LTC→DOGE)文档化 **Bitcoin Cash** (rest1.biggestfan.net/v2 + blockchair): - **context 死端点修正**:bch.publicnode.com 404 Cloudflare → 用 rest1.biggestfan.net/v2 (BCHN 29.0.0 EB32.0 backend) - 真实 height 952,310 ✅ - 真实 NetworkInfo EB32.0 signature(32MB excessive block size)✅ - 真实 MempoolInfo maxmempool=2GB(BTC 默认 300MB,BCH 大块设计) - 真实 getBlock 不返 weight 字段(确证无 SegWit) - 8/10 method byte-identical BTC - BCHN-specific getexcessiveblock RPC(benchmark 可选) - BCH genesis hash 与 BTC **完全相同**(fork 至 height 478559) - SLP token 正确排除 benchmark(OP_RETURN + 需 SLPDB 非 RPC) ## DSL ASK 增量收敛(本 wave) **Litecoin** — 0 新增(完美复用) - 仅参数化已有字段:block_time_target_s=150, default_rpc_port=9332, magic_bytes, address_prefixes.bech32_hrp="ltc", genesis_hash, public_rest=[litecoinspace.org], public_rpc=[] - 无 LitecoinAdapter 类,无 mock 新分支 **Dogecoin** — 3 ASK(关键新需求) 1. **auxpow_enabled** boolean(或 chain_specific 子表) — wave 6 只 Doge 用,可能 Namecoin/RSK 也需 2. **unsupported_methods** 提到 _template.md 标准字段(Doge scantxoutset / BCH 可能 / LTC mWEB) 3. **requires_self_hosted: true** flag — runner 跳过公链 endpoint 发现(Doge 真实零公链 JSON-RPC) **BCH** — 1 ASK(预测命中) - **address_format 枚举扩 cashaddr**(03-bitcoin.md L402:[base58check, bech32, bech32m] → BCH:[cashaddr, base58check]) - CashAddr polymod generator 与 Bech32 不同,不可互换,需 ~150 LOC tools/cashaddr_codec.py 实现 - 无其他新字段 ## 累计 DSL ASK 状态(wave 1+2+3+4+5+6 = 19 链) 新增字段(wave 6): - **auxpow_enabled** (Doge,可能扩 Namecoin/RSK) - **unsupported_methods** array(wave 6 标准化) - **requires_self_hosted** bool(BTC fork 普遍零公链 RPC,wave 7/8 预期复用) - **address_format.cashaddr** 新枚举值(BCH) 累计 address_format 枚举:hex / near / bech32 / ss58 / base58check_tprefix / base32_checksum / tezos_4prefix / hedera_3part / evm_hex_long_zero / evm_hex_ecdsa_alias / **cashaddr** ## Adapter 决策 - LitecoinAdapter:**不新建**,BitcoinAdapter 100% 复用 - DogecoinAdapter:**不新建**,BitcoinAdapter 复用 + auxpow_enabled + unsupported_methods 配置 - BCHAdapter:**不新建**,BitcoinAdapter 复用 + CashAddr codec 工具(tools/cashaddr_codec.py) - 全部 family=utxo-btc(wave 1 Bitcoin family 命名提前预留 fork 复用空间,本 wave 验证决策正确) ## 累计进度 - 6 链 (wave 1+2):Bitcoin / Aptos / Cosmos / Cardano / Polkadot / NEAR ✅ commit 6897ecc - 3 链 (wave 3):Tron / Algorand / Tezos ✅ commit d7b39f1 - 3 链 (wave 4):Avalanche-C / Avalanche-X / Hedera ✅ commit 372e98c - 4 链 (wave 5):Arbitrum / Optimism / zkSync / Linea ✅ commit 286666b - 3 链 (wave 6):Litecoin / Dogecoin / BCH ✅ 本 commit - **累计 19 链调研完成 + 1 P2-DESIGN 设计稿(28 链总目标的 68%)** ## 护栏触发记录(① + 4 护栏) **护栏 1 commit-per-wave**:本 commit 触发 ✅ **护栏 2 diff-only 最激进版**:平均 200 行/链,wave 1-4 平均 460 → wave 5 平均 252 → wave 6 平均 200(**累计降 56%**)✅ **护栏 3 fail-fast**:无 timeout(最长 BCH 355s)✅ **护栏 4 决策反转检测**: - Doge requires_self_hosted 是新场景需求,不反转 wave 1-5 ✅ - BCH CashAddr 扩枚举与 Hedera/Avalanche-X 模式一致,不反转 ✅ - **关键证实**:wave 1 Bitcoin family 命名"utxo-btc"(不裸 utxo)的决策让 BCH/Doge/LTC 都能并列复用,wave 4 Avalanche-X 加 avalanche-utxo 同理,wave 6 实证 family 命名前瞻性正确 ## 关键运营信号(对 wave 7+8) BTC fork 公链 RPC 缺失是普遍问题: - LTC publicnode 404 / ankr 403 - Doge 全部公链 403/422/空 - BCH context 给的 publicnode 404(修正用 rest1.biggestfan.net) wave 7 Cosmos 生态 / wave 8 Substrate 应预期类似挑战。 requires_self_hosted 字段在 wave 7+8 复用预期高。 ## 已知未实证项(透明标注) **Litecoin**:mWEB 字段实际 schema 未验(需 mWEB 实际 tx) **Dogecoin**:dogechain.info Cloudflare gated,无第三 source 验证 **BCH**:SLP token 路径未深入(确认排除 benchmark 后停) ## 老测保护 无代码改动,纯文档新增。 Refs: P1-2 (28 链调研), P2-DESIGN-v2 (DSL spec)
1 parent 286666b commit 858bf4a

6 files changed

Lines changed: 1186 additions & 0 deletions

File tree

docs/en/chains/19-litecoin.md

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
# 19-Litecoin Research (DIFF-ONLY)
2+
3+
> **This document records ONLY the substantive differences between Litecoin and `03-bitcoin.md`.**
4+
> Litecoin was forked from Bitcoin Core in 2011 (founder: Charlie Lee, repo: litecoin-project/litecoin). Its protocol, JSON-RPC schema, error codes, and auth mechanism are **~99% identical to Bitcoin**.
5+
> Any field not appearing here (method signatures, error codes, Basic Auth, mock template, adapter-reuse decision logic) is **inherited verbatim from 03-bitcoin.md**. E1–E5 tags and H8 real-evidence rules apply unchanged.
6+
7+
---
8+
9+
## Metadata
10+
11+
| Field | Value |
12+
|---|---|
13+
| Chain (zh) | 莱特币 |
14+
| Chain (en) | Litecoin |
15+
| ID | 19 |
16+
| Mainnet ChainID | N/A (UTXO chain has no EIP-155 ChainID; magic bytes `0xDBB6C0FB`, genesis hash `12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2`) [E3 — litecoin-project README] |
17+
| Research date | 2026-05-23 |
18+
| Researcher | Hermes Agent |
19+
| Status | 🟢 Complete (diff-only) |
20+
21+
---
22+
23+
## 1. Sources (delta only)
24+
25+
| Type | URL | Notes |
26+
|---|---|---|
27+
| GitHub | https://github.com/litecoin-project/litecoin | Forked from Bitcoin Core 0.3.x in 2011; long-term rebases against upstream BTC; current master ~ Bitcoin Core 0.21.x [E4] |
28+
| MWEB LIP-0002/0003 | https://github.com/litecoin-project/lips/blob/master/lip-0002.mediawiki | MimbleWimble Extension Block, activated 2022-05 (block 2,257,920) [E3] |
29+
| Scrypt PoW paper | https://www.tarsnap.com/scrypt/scrypt.pdf | Colin Percival, 2009 — LTC chose this for ASIC-resistance (later defeated by ASICs) |
30+
| Public REST | https://litecoinspace.org/docs/api/rest | Esplora fork (mempool.space-style), operated by Litecoin Foundation [E2 — see §3] |
31+
| Explorer | https://blockchair.com/litecoin | Cross-check for hashes/heights cited below |
32+
33+
**Fork lineage**: Bitcoin Core 0.3.x (2011) → Litecoin Core 0.x → continual cherry-pick of upstream BTC (segwit, PSBT, descriptor wallet) → today equivalent to Bitcoin Core 0.21.x. MWEB is Litecoin-exclusive — **no equivalent codepath exists in Bitcoin upstream**.
34+
35+
---
36+
37+
## 2. Substantive Differences vs BTC (core table)
38+
39+
| Dimension | Bitcoin | Litecoin | Impact on this framework |
40+
|---|---|---|---|
41+
| PoW algorithm | SHA-256d | **Scrypt** (N=1024, r=1, p=1) [E3 — scrypt paper] | Affects only mining/`getmininginfo.networkhashps` units; **does not affect RPC schema** |
42+
| Target block time | 600 s | **150 s (2.5 min)** [E2 — measured in §8] | Sampling intervals can shrink 4×; mempool turnover faster |
43+
| Halving interval | 210,000 blocks (~4y) | 840,000 blocks (~4y, since block time is 1/4 → 4× block count) | Does not affect RPC |
44+
| Smallest unit | satoshi (1 BTC = 1e8 sat) | litoshi (1 LTC = 1e8 litoshi) | `amount` fields semantically identical, only display unit differs |
45+
| Total supply | 21,000,000 BTC | 84,000,000 LTC | Does not affect RPC |
46+
| SegWit | Activated 2017-08 (BIP-141) | **Activated 2017-05, before BTC** [E3] | weight/vsize fields 100% compatible, no diff |
47+
| Taproot (BIP-341) | Activated 2021-11 | **Not activated** (no strong community demand) | No P2TR addresses (no bech32m); `scriptPubKey.type` never returns `witness_v1_taproot` |
48+
| MWEB (MimbleWimble) | Does not exist | **Activated 2022-05** (LIP-0002/0003) | Exclusive codepath, see §5 below |
49+
| Address prefix | `bc1q` (P2WPKH) / `bc1p` (P2TR) / `1`/`3` (legacy) | `ltc1q` (P2WPKH) / `L` (P2PKH, prefix 0x30) / `M`/`3` (P2SH, prefix 0x32) / `ltcmweb1...` (MWEB) | adapter must recognize LTC prefixes (same structure as 03-bitcoin.md §4) |
50+
| Magic bytes | `0xD9B4BEF9` | `0xDBB6C0FB` | P2P-layer only, not exposed via RPC |
51+
| Default RPC port | 8332 | 9332 | self-hosted target endpoint differs |
52+
53+
**Conclusion**: For the 8 methods this framework monitors (`getbestblockhash` / `getblockcount` / `getblock` / `getblockhash` / `getrawtransaction` / `getmempoolinfo` / `getrawmempool` / `scantxoutset`), there are **0 method-schema differences** and **0 error-code differences**. MWEB only adds **optional fields** (`pegin_amount`, `pegout_amount`, etc.; see §5), which do not break BTC reader compatibility.
54+
55+
---
56+
57+
## 3. Public RPC measurements (delta)
58+
59+
| Endpoint | Auth | Result | Notes |
60+
|---|---|---|---|
61+
| `https://litecoin-rpc.publicnode.com` | none | ❌ HTTP **404** (measured 2026-05-23) | BTC has this domain, LTC does **not**; publicnode provides no Litecoin RPC |
62+
| `https://litecoinspace.org/api/*` | none | ✅ 200 (Esplora REST, **not JSON-RPC**) | **Evidence endpoint for this doc**; mempool.space-compatible schema |
63+
| `https://api.blockchair.com/litecoin/stats` | none / API key | ✅ 200 | Backup; field naming differs from Esplora |
64+
| `https://api.blockcypher.com/v1/ltc/main` | none / token | ✅ 200 | Third fallback |
65+
| `http://<self-hosted>:9332` | basic auth | not tested | True benchmark-target path |
66+
| `https://rpc.ankr.com/litecoin` | bearer | ❌ HTTP **403** (measured 2026-05-23) | Requires paid plan |
67+
68+
**Trade-off**: Unlike BTC, **no mainstream Litecoin public chain offers anonymous JSON-RPC 1.0**. Wave2 strategy:
69+
1. Use `litecoinspace.org` Esplora REST for height/block/mempool liveness (read-only path, schema captured below);
70+
2. Real benchmark must self-host `litecoind` (same fallback plan as BTC);
71+
3. Mock layer needs only magic-bytes/port swap on top of BTC, **no new branch**.
72+
73+
**curl evidence** (mandatory):
74+
```bash
75+
# E2 — 2026-05-23 litecoinspace.org tip height
76+
curl -s https://litecoinspace.org/api/blocks/tip/height
77+
# Output: 3112566
78+
79+
# E2 — 2026-05-23 litecoinspace.org tip hash
80+
curl -s https://litecoinspace.org/api/blocks/tip/hash
81+
# Output: c72dd1d0a56a183e3536f918295362b45fd46701aaa93126c4f863d519d61b4c
82+
83+
# E2 — 2026-05-23 publicnode does not exist
84+
curl -s -o /dev/null -w "%{http_code}\n" -X POST https://litecoin-rpc.publicnode.com \
85+
-H "Content-Type: application/json" \
86+
-d '{"jsonrpc":"1.0","id":1,"method":"getblockcount","params":[]}'
87+
# Output: 404
88+
```
89+
90+
---
91+
92+
## 4. Method differences (~99% same as BTC)
93+
94+
All 8 monitored methods share BTC's schema exactly. Only 2 caveats:
95+
96+
1. **`getblock` return value**: After MWEB activation, the block object **may** contain Litecoin-exclusive fields `mweb_block` (hex) and `hogex` (Hogwarts Express tx — the peg-in/out bridge between MWEB and main chain), appearing only at verbosity ≥ 2. **Readers must ignore unknown fields** (already a BTC framework convention).
97+
2. **`getrawtransaction` return value**: TXs involving MWEB pegs include `vout[i].scriptPubKey.type == "witness_mweb_pegin"` / `"witness_mweb_hogaddr"`. The BTC reader recognizes 8 scriptPubKey types; this framework's `unknown_type` branch handles these gracefully — **non-blocking**.
98+
99+
**Identical methods** (link to 03-bitcoin.md §5):
100+
`getbestblockhash` / `getblockcount` / `getblockhash` / `getrawtransaction` (non-MWEB tx) / `getmempoolinfo` / `getrawmempool` / `scantxoutset`.
101+
102+
**Litecoin-exclusive methods** (**not** monitored, recorded for completeness):
103+
- `verifychain` parameter defaults identical to BTC, no diff
104+
- No exclusive RPC method names exist; MWEB introduces no new methods, only new optional fields in existing method returns [E5 — grep over `RPCArg` in litecoin-project/litecoin reveals no methods absent from BTC]
105+
106+
---
107+
108+
## 5. Real-world Workload (mainstream tokens / use-cases)
109+
110+
| Use-case | Status | Impact on benchmark |
111+
|---|---|---|
112+
| Native LTC transfers (P2PKH/P2WPKH) | Primary workload | Identical to BTC, no diff |
113+
| Stablecoins (USDT-LTC) | **Do not exist** — Tether never issued on LTC (no token standard beyond OP_RETURN) | No token-indexer layer needed |
114+
| Ordinals / Inscriptions | Ported in 2023 (`ord-litecoin` fork) | Same large-witness-data signature as BTC; large-block mempool tests reusable |
115+
| MWEB peg in/out | Live since 2022-05; < 1% of tx volume | See §4, field-level compatible |
116+
| Lightning Network | Supported (LND/c-lightning compatible) | Out of scope for L1 monitoring |
117+
118+
**Live block (2026-05-23, height 3,112,566)**: 929 tx, size 330,405 B, weight 959,787 (< 4,000,000 cap, indicating broad segwit adoption), difficulty 103,531,654 (vs BTC ~1.36e14 same day — not directly comparable due to different Scrypt hashrate distribution).
119+
120+
---
121+
122+
## 6. DSL Decision (predicted: 0 new fields)
123+
124+
Reuse the BTC DSL under `family=utxo-btc`; only chain-level parameters differ:
125+
126+
```yaml
127+
# config/chains/litecoin.yaml (P2-DESIGN-v2 stub)
128+
chain_id: litecoin
129+
family: utxo-btc # reuse adapter defined in 03-bitcoin.md
130+
display_name: "Litecoin"
131+
units:
132+
base: litoshi
133+
display: LTC
134+
decimals: 8
135+
block_time_target_s: 150 # vs BTC 600
136+
default_rpc_port: 9332 # vs BTC 8332
137+
magic_bytes: "0xDBB6C0FB" # vs BTC 0xD9B4BEF9
138+
genesis_hash: "12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2"
139+
address_prefixes:
140+
p2pkh: 0x30 # 'L' (vs BTC 0x00 '1')
141+
p2sh: 0x32 # 'M' or '3' (vs BTC 0x05 '3')
142+
bech32_hrp: "ltc" # vs BTC "bc"
143+
public_rest:
144+
- https://litecoinspace.org/api # Esplora-style, only viable anonymous endpoint
145+
public_rpc: [] # No anonymous JSON-RPC; self-host required
146+
methods: ${family.utxo-btc.methods} # full inherit, no override
147+
```
148+
149+
**Total new DSL fields: 0**. All differences expressed within already-parameterized fields of the existing family schema.
150+
151+
---
152+
153+
## 7. H8 Evidence (curl + real data)
154+
155+
The following 5 commands were measured on 2026-05-23 and returned real mainnet data (cross-checkable at https://blockchair.com/litecoin):
156+
157+
```bash
158+
# 1. tip height
159+
$ curl -s https://litecoinspace.org/api/blocks/tip/height
160+
3112566
161+
162+
# 2. tip hash
163+
$ curl -s https://litecoinspace.org/api/blocks/tip/hash
164+
c72dd1d0a56a183e3536f918295362b45fd46701aaa93126c4f863d519d61b4c
165+
166+
# 3. block detail (proves segwit weight is in use)
167+
$ curl -s https://litecoinspace.org/api/block/c72dd1d0a56a183e3536f918295362b45fd46701aaa93126c4f863d519d61b4c
168+
{"id":"c72dd1d0...","height":3112566,"version":536870912,"timestamp":1779564023,
169+
"tx_count":929,"size":330405,"weight":959787,"merkle_root":"edd6c781...",
170+
"previousblockhash":"06def9ad...","mediantime":1779563109,"nonce":495071304,
171+
"bits":422149092,"difficulty":103531654.83378036}
172+
173+
# 4. mempool status (vs BTC's ~200-300k tx, LTC has only ~200)
174+
$ curl -s https://litecoinspace.org/api/mempool
175+
{"count":193,"vsize":66896,"total_fee":822737,"fee_histogram":[[1.01,52064],[1.00,14832]]}
176+
177+
# 5. recommended fees (LTC typically 1 litoshi/vB, vs BTC's frequent 10-100 sat/vB)
178+
$ curl -s https://litecoinspace.org/api/v1/fees/recommended
179+
{"fastestFee":1,"halfHourFee":1,"hourFee":1,"economyFee":1,"minimumFee":1}
180+
181+
# 6. block-time verification (blockchair 24h block count)
182+
$ curl -s https://api.blockchair.com/litecoin/stats | python3 -c "import json,sys; d=json.load(sys.stdin)['data']; print('blocks_24h=',d['blocks_24h'],'-> avg block time =',86400/d['blocks_24h'],'s')"
183+
blocks_24h= 601 -> avg block time = 143.76 s # ≈ 2.5 min target [E2 ✅]
184+
```
185+
186+
---
187+
188+
## 8. Decisions & Open Items
189+
190+
- **Reuse decision**: `family=utxo-btc` adapter is 100% reused; no new `LitecoinAdapter` class needed; chain-level config parameterized in yaml.
191+
- **Mock changes**: `mock_rpc_server.py`'s Bitcoin branch only needs to accept a `chain_id` arg at init and swap magic/prefix/port — **no new branch**.
192+
- **MWEB non-blocking**: Wave6 does not require MWEB field parsing; reader-layer `unknown_field` tolerance suffices. If future MWEB balance accounting is required, add a standalone `getmwebheader` parser (out of scope).
193+
- **Public-chain limitation recorded**: LTC's lack of anonymous JSON-RPC is a hard constraint for wave2's endpoint matrix; CI-mock priority bumped.
194+
195+
---
196+
197+
## Changelog
198+
199+
- 2026-05-23 — Initial revision (diff-only, based on 03-bitcoin.md); `litecoin-rpc.publicnode.com` measured 404, switched evidence endpoint to litecoinspace.org Esplora REST; 0 new DSL fields.

0 commit comments

Comments
 (0)