Files
2026-05-04 17:14:34 +02:00

56 lines
3.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Repository Purpose
This is a **documentation-only** repository. It contains `technical-data.md`, the authoritative technical reference for building infrastructure on top of BitcoinPurple (BTCP) — a Bitcoin fork with 1-minute blocks and 1,000,000 BTCP total supply. There is no build system, no test suite, and no source code.
## Document Structure
`technical-data.md` covers nine sections:
1. **Quick Reference** — port/address/magic byte lookup table across all four networks (mainnet, testnet, signet, regtest)
2. **Mainnet Parameters** — ports, address encoding, HD key bytes, genesis block, consensus rules, difficulty adjustment, soft-fork activation, chain validation, DNS seeds
3. **Testnet Parameters** — mirror of §2 for testnet
4. **Signet Parameters** — signet-specific values
5. **Regtest Parameters** — regtest-specific values
6. **ElectrumX Server**`coins_btcp.py` coin class, Docker patch snippet, environment variables, ZMQ ports
7. **Electrum Wallet (`constants.py`)**`BitcoinPurple` and `BitcoinPurpleTestnet` class definitions, derivation paths, checkpoints format, servers.json format, dust thresholds, header verification logic, build checklist
8. **Lightning Network** — chain_hash (wire byte order), BOLT11 HRP, block-time-scaled timeout parameters (×10 vs Bitcoin), channel parameters, feature bits, fork notes for CLN and LND
9. **`bitcoinpurple.conf` Reference** — default values, full annotated config, operational notes
## Key Facts to Keep in Mind
**Ports**
- Mainnet P2P `13496`, RPC `13495`; Testnet P2P `23496`, RPC `23495`; Signet `33496`/`33495`; Regtest `18444`/`18443`
- ElectrumX TCP/SSL: mainnet `50001`/`50002`, testnet `60001`/`60002`
**Block cadence and LN scaling**
- BTCP has 1-minute blocks (Bitcoin has 10-minute blocks)
- All Lightning timeout values expressed in blocks must be multiplied by **×10** vs Bitcoin defaults
- e.g. `to_self_delay`: 144 → 1440 blocks; `cltv_expiry_delta`: 40 → 400 blocks
**Address encoding**
- P2PKH prefix 56 (`0x38`) and P2SH prefix 55 (`0x37`) — both produce addresses starting with `P`
- Bech32 HRP: `btcp` (mainnet), `tbtcp` (testnet/signet), `rbtcp` (regtest)
- WIF prefix 183 (`0xb7`) is the same on all networks
- Mainnet BIP32 bytes (`0488B21E`/`0488ADE4`) are identical to Bitcoin mainnet → same xpub/xprv prefixes
**Lightning chain_hash** (genesis hash in wire byte order, used in all BOLT messages):
- Mainnet: `15c04ef0bc1856d6b1ec199ca25d0aa7e77c6114e2cb0649ea82bf3f82030000`
- Testnet: `98d9f92e8867ee945d5aab422bd49896497f58cc6f8168d31a1c92c3fd020000`
**BIP44 coin type**: not registered in SLIP-0044; provisional placeholder `13496` (matches P2P port) is used throughout; update when officially registered.
**Difficulty retarget**: every 120 blocks (not Bitcoin's 2016), 7200-second target timespan, clamped 4× in either direction. All soft-forks (SegWit, Taproot, etc.) active from genesis (height 0).
**Emission**: 500,000 halving interval, initial reward 1 BTCP/block, ~1,000,000 BTCP total.
## Editing Guidelines
- All values in `technical-data.md` are sourced from the BTCP codebase. When updating a value, note the source file and line in the same format already used (e.g. `src/kernel/chainparams.cpp:116`).
- Keep the Quick Reference table (§1) in sync whenever a canonical value changes elsewhere in the document.
- Chain stats (`TX_COUNT`, `TX_COUNT_HEIGHT`) in the ElectrumX coin class are sync-estimation hints — refresh them from a fully synced node before release.
- Do not add SLIP-0044 coin type entries unless BTCP has been officially registered.