Skip to content

Conversation

@jharveyb
Copy link
Contributor

While building a basic electrum api CLI and testing against my personal electrs node, I noticed an issue with blockchain.transaction.id_from_pos:

/target/debug/electrum-cli ssl://$SERVER_URL get-txid-from-pos 932452 1
Error: Made one or multiple attempts, all errored:
	- missing field `tx_hash`

I'm using the rust-electrum-client crate, which expects the JSON key for the TXID to be tx_hash, not tx_id as it is now:

https://docs.rs/electrum-client/latest/electrum_client/struct.TxidFromPosRes.html

So the deserialization of the response fails. According to the Electrum spec, the key should be tx_hash, not tx_id:

https://electrumx.readthedocs.io/en/latest/protocol-methods.html#blockchain-transaction-id-from-pos

So the electrs implementation is the issue here IMO.

No test added since AFAICT this API isn't exposed via the electrum CLI tool, and I didn't see another suitable place to add one.

Great project btw - excited for the bindex work to get merged!

Copy link
Owner

@romanz romanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@romanz romanz merged commit 66b1de6 into romanz:master Jan 19, 2026
4 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