<p>TransactionOutput.getScriptPubKey.getToAddress.toString</p>

<p>Unfortunately, this gives an exception when dealing with an oldstyle pay-to-IP script, so you might have to deal with these yourself if you need them (which in your use case you probably won't). An example can be found in the Scala code from the link below (from line 120 on):</p>

<p><a href="https://github.com/stefanwouldgo/Bitcoin-Graph-Explorer/blob/master/src/main/scala/Graph.scala" rel="nofollow">https://github.com/stefanwouldgo/Bitcoin-Graph-Explorer/blob/master/src/main/scala/Graph.scala</a></p>

CC BY-SA 3.0
2012-03-24T15:34:03.873Z
2012-03-24T15:34:03.873Z
stefanwouldgo
<p>I believe <a href="http://code.google.com/p/bitcoinj/source/browse/src/com/google/bitcoin/core/TransactionOutput.java" rel="nofollow">TransactionOutput</a> represents one of the outputs of a transaction.</p>

<p>I have a list of such output objects, and a <code>String</code> that represents my own address. I would like to check that this output reached my address.</p>

<p>How do I get the destination address from the TransactionOutput object?</p>

<development><bitcoinj>
How to get destination address from bitcoinj TransactionOutput?
ripper234
# How to get destination address from bitcoinj TransactionOutput?

(Asked by: username_0 on 2011-12-31)

I believe [TransactionOutput](http://code.google.com/p/bitcoinj/source/browse/src/com/google/bitcoin/core/TransactionOutput.java) represents one of the outputs of a transaction.

I have a list of such output objects, and a `String` that represents my own address. I would like to check that this output reached my address.

How do I get the destination address from the TransactionOutput object?

**Tags:** development, bitcoinj


---

## 1 answers

### Answer by username_1 on 2012-03-24. Score: 2 | Accepted answer

TransactionOutput.getScriptPubKey.getToAddress.toString

Unfortunately, this gives an exception when dealing with an oldstyle pay-to-IP script, so you might have to deal with these yourself if you need them (which in your use case you probably won't). An example can be found in the Scala code from the link below (from line 120 on):

<https://github.com/username_1/Bitcoin-Graph-Explorer/blob/master/src/main/scala/Graph.scala>


---

