Update transaction.id_from_pos response for API compliance
What changed, and why it matters
This commit renames a field in the server's JSON response from 'tx_id' to 'tx_hash' to match the official Electrum protocol specification. It is a compatibility/API compliance fix, not a security patch. There is no indication it fixes a vulnerability.
No security action required. Treat as a routine API compatibility update. Verify downstream clients expect the new 'tx_hash' field name.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change affects the blockchain.transaction.id_from_pos RPC response in src/electrum.rs. It changes the returned JSON key from ‘tx_id’ to ‘tx_hash’ to align with the ElectrumX/Electrum protocol documentation. The underlying data (the transaction hash/ID) is unchanged; only the response key name is corrected.
Changed components
src/electrum.rs: blockchain.transaction.id_from_pos RPC responseInspect captured patch +2 / −2
diff --git a/src/electrum.rs b/src/electrum.rs
index a4df772..fa67b1d 100644
--- a/src/electrum.rs
+++ b/src/electrum.rs
@@ -481,9 +481,9 @@ impl Rpc {
let txid: Txid = txids[tx_pos];
if merkle {
let proof = Proof::create(&txids, tx_pos);
- Ok(json!({"tx_id": txid, "merkle": proof.to_hex()}))
+ Ok(json!({"tx_hash": txid, "merkle": proof.to_hex()}))
} else {
- Ok(json!({ "tx_id": txid }))
+ Ok(json!({ "tx_hash": txid }))
}
}
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.