Skip to content

docs: fix the transaction store prefix and the output rows in the schema - #263

Open
artofbitcoin wants to merge 2 commits into
Blockstream:new-indexfrom
artofbitcoin:docs/storage-schema
Open

artofbitcoin wants to merge 2 commits into
Blockstream:new-indexfrom
artofbitcoin:docs/storage-schema

Conversation

@artofbitcoin

Copy link
Copy Markdown

Two places in the docs describe the storage layout differently from what the indexer writes.

README.md: the transaction store is documented under the prefix t, but raw transactions are keyed by T (TxRowKey { code: b'T', txid }, src/new_index/schema.rs). Lowercase t is the synced tip hash (txstore_db.put_sync(b"t", ...)), so the README pointed readers at the wrong row. doc/schema.md already uses T{txid}.

doc/schema.md: it says each output produces "O{txid}{vout}" → "{scriptpubkey}{value}". In add_transaction:

  • the O row is only written when is_spendable(txo), which skips OP_RETURN outputs, and on Elements fee outputs and provably unspendable outputs too (src/util/transaction.rs);
  • its value is serialize(txout), the consensus-encoded TxOut (value first, then script), as the comment above add_transaction already says (O{txid}{index} → {txout});
  • the a row is written for every output that has an address, only when --address-search is enabled.

Docs only, no code change.

artofbitcoin and others added 2 commits September 29, 2026 18:04
The transaction store uses the `T` key (TxRowKey, src/new_index/schema.rs);
lowercase `t` holds the synced tip hash.

Co-authored-by: Claude <noreply@anthropic.com>
add_transaction only writes the O row for spendable outputs (is_spendable skips
OP_RETURN, and fee / provably unspendable outputs on Elements), and its value is
the serialized TxOut, not {scriptpubkey}{value}. The a row is only written with
--address-search, for outputs that have an address.

Co-authored-by: Claude <noreply@anthropic.com>
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.

1 participant