Skip to content

Serve lean: txid.body identity, SH join fks, mempool UTXO overlay - #168

Merged
reardencode merged 12 commits into
masterfrom
api/serve-lean
Aug 20, 2026
Merged

Serve lean: txid.body identity, SH join fks, mempool UTXO overlay#168
reardencode merged 12 commits into
masterfrom
api/serve-lean

Conversation

@rearden-grok

@rearden-grok rearden-grok Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Serve paths that only need create identity (block txids, merkle, getblock verbosity 1, outspend spend txid) read txid.body / tx_fk_by_txid instead of packed txout or full reconstruct.
  • Esplora /txs keeps SH join fks; history to_height skips Class A expand for later creates; parent prevouts are outs-only; merkleblock is header + txid leaves.
  • Esplora /utxo and mempool_stats match Electrum listunspent (shared helper). Electrum scripthash subscribe restatuses on confirming tip. scantxoutset coinbase is first header_txs fk.

Test plan

  • cargo test -p rbitcoin-query --lib scripthash_history
  • cargo test -p rbitcoin-esplora --lib
  • cargo test -p rbitcoin-electrum --lib scripthash_subscribe / listunspent
  • cargo test -p rbitcoin-rpc gettxout / scantxoutset / getblock
  • Required Actions: fmt, deny, clippy, test, multinode, coverage

Made with Cursor

rearden-grok Bot and others added 12 commits August 20, 2026 10:21
Merkle proofs, Esplora /txids, and Electrum id_from_pos only need create
identity. TxTable::get decoded every output. Consecutive header_txs use
body_txid_range.

Co-authored-by: Cursor <cursoragent@cursor.com>
Esplora /txs and WS block-transactions already have create/spender fks
from the SH join. Re-probing tx.head per page item was the leftover
megakey gap after /utxo.

Co-authored-by: Cursor <cursoragent@cursor.com>
scripthash_history_filtered already documented this. Spend height is at
least create height, so future creates cannot contribute to the window.

Co-authored-by: Cursor <cursoragent@cursor.com>
Esplora tx JSON and RPC gettxout only need the parent output. TxTable::get_full
zipped inwit on every prevout. Stored txid comes from txid.body.

Co-authored-by: Cursor <cursoragent@cursor.com>
The prevout commit staged an empty workspace lock via git add -A.

Co-authored-by: Cursor <cursoragent@cursor.com>
/txs, /tx/*, merkle, outspends, and block tx lists share spawn_join with
/utxo. Tip, hash, and fee-estimates stay on the worker.

Co-authored-by: Cursor <cursoragent@cursor.com>
v0/v2 share the archived prev_txid cache. getblockstats parent
prevouts use create_fk outs, not per-input tx.head.

Co-authored-by: Cursor <cursoragent@cursor.com>
Status, merkle, and outspend existence use tx_fk_by_txid. Spend txid
is txid.body; vin is the annotated index. Merkleblock is header +
txid.body leaves, not reconstruct_archived_block.

Co-authored-by: Cursor <cursoragent@cursor.com>
SH listunspent already has the create fk. Coinbase is whether that fk
is first in the block's header_txs range — no packed inwit zip.

Co-authored-by: Cursor <cursoragent@cursor.com>
Shared helper funds from mempool SH index and drops mempool-spent
confirmed coins. Esplora mempool_stats uses the same loops. JSON for
NULL-fk rows is unconfirmed with no block_*.

Co-authored-by: Cursor <cursoragent@cursor.com>
Header push already ran on TipNotify. Clients that only subscribe to
hashes missed confirmed history until a mempool announce. Window the
new height, then send full status.

Co-authored-by: Cursor <cursoragent@cursor.com>
COMPAT/OPERATOR match txid.body listings, SH join fks on /txs, and
Electrum subscribe restatus on confirming tip.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread crates/rbitcoin-electrum/src/server.rs Dismissed
Comment thread crates/rbitcoin-esplora/src/tx_json.rs Dismissed
Comment thread crates/rbitcoin-esplora/src/tx_json.rs Dismissed
@reardencode
reardencode merged commit 7b6f07c into master Aug 20, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants