<p>The transaction does not know the block in which it was integrated.</p>

<p><a href="https://en.bitcoin.it/wiki/Protocol_specification#tx" rel="nofollow">https://en.bitcoin.it/wiki/Protocol_specification#tx</a></p>

<p>There are many services around like blockchain.info or blockexplorer.com which stores the blockchain and have indexed all transactions, which you can search. </p>

CC BY-SA 3.0
2014-06-10T19:10:14.600Z
Some transactions are in multiple blocks, for instance: https://blockchain.info/tx/392655224c035f4ace1dfb3d95f86406bfc82e646b27b731faeab052209e0b0a
Willem Hengeveld
CC BY-SA 3.0
2014-06-10T19:24:22.843Z
The link only shows one transaction, and what you are suggesting is a double-spend. You cannot spend the same transaction outputs twice or more.
T9b
CC BY-SA 3.0
2014-06-10T19:53:43.697Z
@T9b the link shows that it was included in the following blocks (one's an orphan, the other made it onto the main chain, both height 297359): https://blockchain.info/block-index/401024 https://blockchain.info/block-index/401025 So orphaned blocks are an exception to the rule, and probably not the point of the question.
Tim S.
CC BY-SA 3.0
2014-06-11T08:28:38.847Z
Maybe not the point of the question, but i am showing that there is not always a unique answer. ... Another one, this time in 2 very early mainchain blocks (height 91722 and 91880):  https://blockchain.info/tx/e3bf3d07d4b0375638d5f1db5255fe07ba2c4cb067cd81b84ee974b6585fb468
Willem Hengeveld
CC BY-SA 3.0
2014-06-11T08:34:25.090Z
@WillemHengeveld how is that possible?
Dennis Kriechel
CC BY-SA 3.0
2014-06-11T09:22:23.530Z
looking at http://blockexplorer.com/b/91880  there is a remark about a bug in the miner that mined that block.
Willem Hengeveld
CC BY-SA 3.0
2018-01-10T15:11:45.410Z
Does the p2p protocol support this?
Jus12
CC BY-SA 3.0
2014-06-10T18:05:31.877Z
2014-06-10T18:05:31.877Z
Dennis Kriechel
<p>Well, the title says it all.
I have  a transaction hash and I want to find this transaction in the blockchain.
I am working with bitcoinj.</p>

<p>I am probably missing something very obvious here, but I cannot find how to do it. </p>

<transactions><blockchain><block><bitcoinj><transaction-id>
How to find a block containing a transaction using transaction hash only?
Flot2011
# How to find a block containing a transaction using transaction hash only?

(Asked by: username_0 on 2014-06-10)

Well, the title says it all.
I have a transaction hash and I want to find this transaction in the blockchain.
I am working with bitcoinj.

I am probably missing something very obvious here, but I cannot find how to do it.

**Tags:** transactions, blockchain, block, bitcoinj, transaction-id


---

## 1 answers

### Answer by username_1 on 2014-06-10. Score: 1

The transaction does not know the block in which it was integrated.

<https://en.bitcoin.it/wiki/Protocol_specification#tx>

There are many services around like blockchain.info or blockexplorer.com which stores the blockchain and have indexed all transactions, which you can search.

> **Comments:**
> **username_2**: Some transactions are in multiple blocks, for instance: https://blockchain.info/tx/392655224c035f4ace1dfb3d95f86406bfc82e646b27b731faeab052209e0b0a  
> **username_3**: The link only shows one transaction, and what you are suggesting is a double-spend. You cannot spend the same transaction outputs twice or more.  
> **username_4**: @username_3 the link shows that it was included in the following blocks (one's an orphan, the other made it onto the main chain, both height 297359): https://blockchain.info/block-index/401024 https://blockchain.info/block-index/401025 So orphaned blocks are an exception to the rule, and probably not the point of the question.  
> **username_2**: Maybe not the point of the question, but i am showing that there is not always a unique answer. ... Another one, this time in 2 very early mainchain blocks (height 91722 and 91880):  https://blockchain.info/tx/e3bf3d07d4b0375638d5f1db5255fe07ba2c4cb067cd81b84ee974b6585fb468  
> **username_1**: @WillemHengeveld how is that possible?  
> **username_2**: looking at http://blockexplorer.com/b/91880  there is a remark about a bug in the miner that mined that block.  
> **username_5**: Does the p2p protocol support this?  

---

