explorer: Misleading transaction time when in micro block
Describe the bug A time in the past is shown for transactions in micro blocks
The time does not makes sense as it looks like that the tx is executed at the already confirmed block, more precisely, that the clarity variable block_height is the height of the confirmed block. This is not true.
To Reproduce Steps to reproduce the behavior:
- Go to https://explorer.stacks.co/transactions?chain=testnet
- See timestamp on microblock
Expected behavior Do not show a transaction time until the block with the block_height used during processing the transaction is confirmed on Bitcoin.
Screenshots

About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 5
- Comments: 17 (2 by maintainers)
Follow up. I see that in the API code, is unanchored is being set to !dbTx.block_hash in db-controller.ts. But as we see in the response, the block_hash is not null, rather, it is
"block_hash": "0x",@JackNapolitano you’re right, thanks for digging! I’ll get on it ASAP
@rafaelcr I believe it is an API issue: take a look at the response of:
https://stacks-node-api.stacks.co/extended/v1/tx/0x2e61434f2bfa98dd4aba504836b13f3329be46a5244c1d8db0e6f5a7cf51acd2?event_offset=0&event_limit=100&unanchored=true
vs
https://stacks-node-api.mainnet.stacks.co/extended/v1/tx/0x2e61434f2bfa98dd4aba504836b13f3329be46a5244c1d8db0e6f5a7cf51acd2
It seems that when setting “unanchored=true” in the API calls, the api is returning
"is_unanchored": false,", and the check that is happening on the explorer side of things for microblock tx’s is the following:Shouldn’t a microblock “is_unanchored” be set to true?
In this case the blockhash is shown as
0xIt would be good to show something more user friendly.
🎉 This issue has been resolved in version 1.68.0 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀
The API fix has been deployed: https://stacks-node-api.testnet.stacks.co/extended/v1/tx/0x1abc7363e913cf735bafba2ce498e1b8437163773f92999aa179e88c966cc38f?unanchored
@markmhx @Hero-Gamer so far I don’t believe this is an API issue.
I just reproduced the error (saw a tx “confirmed in anchor block” in Explorer) but also checked that same tx ID in the API, and it returns it as still in the mempool:
@He1DAr this was taken from https://stacks-node-api.mainnet.stacks.co/extended/v1/tx/0x87dd4830d5e99991a3d98cb32de005a3751059b1bb0d2af908fd42f3de0ea875
Do you use any other endpoint for populating the tx landing page? I tried https://stacks-node-api.mainnet.stacks.co/extended/v1/address/SP2EAJ6Y0STA70HBJF4V2DVRHEZZ50RXYHB2HP73K/0x87dd4830d5e99991a3d98cb32de005a3751059b1bb0d2af908fd42f3de0ea875/with_transfers but it returns blank of course given that the tx is not yet confirmed
I also see txs in micro-blocks that are shown as “anchor block” but the anchor block hash is 0x. This is so confusing.
This is a huge issue for us too, it creates a lot of confusion around blockchain state. Why does it show as “in anchor block” when it is in microblock? We’re getting a lot of issues and complaints from users, and since microblocks are often not actually final, people are (rightly) concerned when a transaction confirms “in anchor” and then gets reorged and their transaction fails / get a different NFT ID than they initially expected.
Understood this can happen with an actual anchor block too, but it’s exacerbated here. Until the APIs actually treat microblocks as first-class blocks and dapps can easily index microblock state, easily call read-only contracts at microblock state, and we have some better finality, this is a poor UX decision.
So if one sends a transaction and gets caught in a microblock it can show on the explorer as confirmed 15 minutes ago even when it was send 1 minute ago. very strange indeed. A bit more context.
Describe the solution you’d like
Describe alternatives you’ve considered Alternatively it could be left as it is. However users will rightly find it strange. jnapp18 says: “…the explorer should be showing information that makes sense to the end user.”
Why do microblocks not have timestamp, could they be made to have them? probably a question for the stacks-blockchain team.
Additional context