-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question on API tx order for same block & low priority suggestions #165
Comments
For For
This already exists,
This exists too, see You can find out the position of the transaction within the block using two methods:
|
I am writing to follow up. I have encountered the same uncertainty and I believe it could be beneficial to all users if this aspect was clarified in a bit more detail in the docs. For context, while working with transactions to compute the UTXOs of a scriptPubKey, I had initially assumed that the transaction order would be maintained even when they belong to the same block. See these transactions: I anticipated new transactions to be listed first based on a 'newest first' order. However, when I observed two transactions from the same block (block height: 427572), the ordering was not respected. These are the transaction IDs: be443ef0b78d98719741ce9f4811c152dc8644b9beb50b5713a257d8d2acd1ee I expected 226a267701ccf308aed00835e5c0a7121ba781a0abfddaa6f10914e841a11217 to be older than be443ef0b78d98719741ce9f4811c152dc8644b9beb50b5713a257d8d2acd1ee. However, it seems the older transaction spends from an output of the 'newer' one, which contradicts the chronological order of transactions. See: https://blockstream.info/tx/226a267701ccf308aed00835e5c0a7121ba781a0abfddaa6f10914e841a11217 While this isn't a problem per se, it introduces a level of ambiguity that could affect how developers parse responses to compute UTXOs. Thanks! EDIT: Can we assume that the responses are deterministic? This means that even if the order of transactions is wrong within the same block, it won't change when new transactions are added. |
Hi, thanks for great API and explorer.
When using
/api/address/:address/txs/chain
or/block/:hash/txs
is the order API lists tx that were in same block always based on order within that block?
Documentation does mention
sorted with newest first
but since blocks confirm its tx at same time, I wasn't sure.I would like to use some logic that depends on placement within the block for tie breaking beyond block_height, and I imagine various embedded protocols could use too.
Requesting possibly the entire block's worth of tx with
/block/:hash/txs[/:start_index]
would be a lot of redundant info just to find order or to get txid's within a block for merkle proof. Is it possible to find the order of my tx's by txid within same block another way?I just wanted to get a confirmation on the order used in API but possible suggestions:
transaction format > status
- the only missing sorting data point for checking sortingThanks!
The text was updated successfully, but these errors were encountered: