Files
brk/docs/mempool-api-status.md
2025-12-13 16:26:29 +01:00

5.3 KiB

Mempool.space API Compatibility - Implementation Status

Plan file: /Users/k/.claude/plans/smooth-weaving-crayon.md

Completed Endpoints

Endpoint Path Notes
GET Block /api/block/{hash}
GET Block Height /api/block-height/{height} Returns plain text hash
GET Block Status /api/block/{hash}/status
GET Block Txids /api/block/{hash}/txids
GET Blocks /api/blocks[/:start_height] Last 10 blocks
GET Transaction /api/tx/{txid}
GET Tx Status /api/tx/{txid}/status
GET Tx Hex /api/tx/{txid}/hex Returns plain text
GET Address /api/address/{address}
GET Address Txs /api/address/{address}/txs
GET Address UTXOs /api/address/{address}/utxo
GET Mempool Info /api/mempool/info
GET Mempool Txids /api/mempool/txids
GET Recommended Fees /api/v1/fees/recommended Basic impl, needs optimization

Remaining Endpoints

Mempool/Fees (4)

# Endpoint Path Dependencies Priority
1 Optimize projected blocks - CPFP/ancestor scores HIGH
2 GET Mempool Blocks /api/v1/fees/mempool-blocks #1 HIGH
3 GET Mempool Recent /api/mempool/recent MED
4 GET RBF Replacements /api/v1/replacements RBF tracking in brk_monitor LOW

Blocks (4)

# Endpoint Path Dependencies Priority
5 GET Block Txs /api/block/{hash}/txs[/:start_index] MED
6 GET Block Txid at Index /api/block/{hash}/txid/{index} LOW
7 GET Block Raw /api/block/{hash}/raw brk_reader LOW
8 GET Block by Timestamp /api/v1/mining/blocks/timestamp/{timestamp} Binary search LOW

Addresses (3)

# Endpoint Path Dependencies Priority
9 GET Address Txs Chain /api/address/{address}/txs/chain[/:after_txid] MED
10 GET Address Txs Mempool /api/address/{address}/txs/mempool brk_monitor MED
11 GET Validate Address /api/v1/validate-address/{address} LOW

Transactions (4)

# Endpoint Path Dependencies Priority
12 GET Tx Outspend /api/tx/{txid}/outspend/{vout} #27 txoutindex_to_txinindex HIGH
13 GET Tx Outspends /api/tx/{txid}/outspends #27 HIGH
14 GET Tx Merkle Proof /api/tx/{txid}/merkle-proof LOW
15 POST Tx Broadcast /api/tx brk_rpc MED

General (1)

# Endpoint Path Dependencies Priority
16 GET Difficulty Adjustment /api/v1/difficulty-adjustment MED

Mining (9)

# Endpoint Path Dependencies Priority
17 GET Mining Pools /api/v1/mining/pools[/:timePeriod] #28 pool identification LOW
18 GET Mining Pool /api/v1/mining/pool/{slug} #28 LOW
19 GET Hashrate /api/v1/mining/hashrate[/:timePeriod] MED
20 GET Difficulty Adjustments /api/v1/mining/difficulty-adjustments[/:interval] LOW
21 GET Reward Stats /api/v1/mining/reward-stats/{blockCount} LOW
22 GET Block Fees /api/v1/mining/blocks/fees/{timePeriod} LOW
23 GET Block Rewards /api/v1/mining/blocks/rewards/{timePeriod} LOW
24 GET Block Fee Rates /api/v1/mining/blocks/fee-rates/{timePeriod} LOW
25 GET Block Sizes/Weights /api/v1/mining/blocks/sizes-weights/{timePeriod} LOW

Infrastructure (3)

# Task Location Priority
26 Index txindex_to_sigop_cost brk_indexer MED
27 Add txoutindex_to_txinindex mapping brk_computer/stateful HIGH
28 Pool identification from coinbase brk_computer LOW

Priority Order

Phase 1: Core Functionality (HIGH)

  1. #27 Add txoutindex_to_txinindex mapping (enables outspend lookups)
  2. #12 GET Tx Outspend
  3. #13 GET Tx Outspends
  4. #1 Optimize projected blocks (CPFP/ancestor scores)
  5. #2 GET Mempool Blocks

Phase 2: Essential Features (MED)

  1. #15 POST Tx Broadcast
  2. #16 GET Difficulty Adjustment
  3. #5 GET Block Txs (paginated)
  4. #9 GET Address Txs Chain
  5. #10 GET Address Txs Mempool
  6. #19 GET Hashrate
  7. #26 Index txindex_to_sigop_cost
  8. #3 GET Mempool Recent

Phase 3: Nice to Have (LOW)

  1. #6 GET Block Txid at Index
  2. #7 GET Block Raw
  3. #8 GET Block by Timestamp
  4. #11 GET Validate Address
  5. #14 GET Tx Merkle Proof
  6. #4 GET RBF Replacements
  7. #20 GET Difficulty Adjustments
  8. #21 GET Reward Stats
  9. #22-25 Mining block statistics
  10. #17-18 Mining pools (requires #28)
  11. #28 Pool identification

Design Documents

  • Mempool projected blocks: crates/brk_monitor/src/mempool/DESIGN.md

Skipped Endpoints

Endpoint Reason
GET Price /api/v1/prices
GET Historical Price /api/v1/historical-price
GET Full-RBF Replacements /api/v1/fullrbf/replacements
Lightning endpoints Requires separate Lightning indexing
Accelerator endpoints mempool.space-specific paid service