Skip to content

Esplora /address/:a/txs/summary: no tx_position, and a 25-row page where mempool.space returns the whole history #856

Closed

Description

@nullcount

Version: observed on aa6de36c (0.7.99), mainnet. The code is unchanged on origin/master 1aece752.

Related: #547 (added the route), #549 ("/txs/summary is a mempool.space dialect"), #814.

What happens

COMPAT.md documents /txs/summary as a mempool.space dialect: "Compact {txid, value, height, time} like mempool.space /address/:addr/txs/summary". The current mempool.space route differs in two ways:

  1. Every mempool.space row also carries tx_position, the tx's index in its block. rbitcoin rows have no such field.
  2. mempool.space returns the whole confirmed history in one response (268 rows for the address below). rbitcoin returns 25 rows per page with a cursor. The 25-row page is documented in COMPAT.md, but it means a mempool-frontend chart built from this route shows only the newest 25 txs.
$ A=1uv9cJLPtJZswvwzYV4Q78NsfwoEMRMsW
$ curl -s https://mempool.space/api/address/$A/txs/summary | jq 'length, .[0]'
268
{"txid":"6d2a0f0eb72eb8f87946b6f7344f70197ee0a5b78743b4c9f26c882301d8e944","height":969500,"value":-171370299,"time":1790895623,"tx_position":12}

$ curl -s --unix-socket /run/rbitcoin/esplora.sock http://x/address/$A/txs/summary | jq 'length, .[0]'
25
{"height":969500,"time":1790895623,"txid":"6d2a0f0eb72eb8f87946b6f7344f70197ee0a5b78743b4c9f26c882301d8e944","value":-171370299}

txid, height, value and time agree.

Expected

The same row shape as mempool.space, including tx_position. Ideally also a way to get the full summary in one call (mempool.space's page size) for clients that expect it. The 503 cap from --max-sh-creates would still apply.

Source (1aece752)

  • ScriptHashTxSummary { txid, value, height } (crates/rbitcoin-query/src/scripthash.rs:44-48) does not carry the position.
  • summaries_from_joined (scripthash.rs:220-244) builds it.
  • summaries_json (crates/rbitcoin-esplora/src/handlers.rs:1088) adds time only.
  • HistoryFilter::esplora_chain_page fixes limit: Some(25) (scripthash.rs:108-116).

The tx's index in its block is already known to the store: the block_tx_fks(height) order is what /block/:h/txids serves.

Also observed (dialect feature)

COMPAT.md lists ?asof= as supported on /txs/summary. On our node it answered 404 Not Found in under 1 ms (both addresses tried), even for a small address where /txs/chain?asof=<same hash> and /address/:a?asof=<same hash> return 200:

/address/1uv9…MsW?asof=<hash of 969500>                200
/address/1uv9…MsW/txs/chain?asof=<hash of 969500>      200
/address/1uv9…MsW/txs/summary?asof=<hash of 969500>    404 Not Found

I have not traced the cause.

Suggested fix

  • Add tx_position: u32 to ScriptHashTxSummary and emit it.
  • Optionally accept a larger page (or no limit, under the cap) on the summary route, to match mempool.space.
  • Look at the asof 404.

Workaround

For each txid, read the position from /tx/:txid and /block/:hash/txids, and page through /txs/summary/:last_seen_txid.

Activity

  1. rearden-grok commented on Oct 4, 2026

    @rearden-grok
    Contributor

    The missing fields are fixed in #861 (merge 549e42737), which is on master. The unpaged body is a dialect choice, not a leftover bug.

    /txs/summary rows include tx_position (that tx's index in its block). ?asof= is accepted on /txs/summary and /txs/summary/:last; the 404 was the route not taking the parameter COMPAT.md already documented.

    The page stays 25 rows, newest first, with the existing /:last_seen_txid and ?after_txid= cursors. COMPAT.md still says 25/page, and the #861 note says the same ("The page stays 25 rows."). mempool.space's single unpaged history is not what this route serves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions