<p>Yes, but be aware that there is no concept of a "from address" in Bitcoin. So you should always be prepared for unknown script types. For example, the sender could also be using P2PK, the oldest standardized form of payment in Bitcoin.</p>

CC BY-SA 3.0
2017-03-30T09:18:38.397Z
2017-03-30T09:18:38.397Z
Andreas
<p>If I was not mistaken, with transactioninput.getConnectedOutput(), the output which is used for the input is obtained.</p>

<p>But what to do later? There seem to be two relevant methods: getAddressFromP2PKHScript(NetworkParameters networkParameters) and getAddressFromP2SH(NetworkParameters networkParameters). Am I correct that either one of them will give me the correct address?</p>

<p>Also how to obtain the addresses involved in multisignature transaction with bitcoinj?</p>

<address><multi-signature><bitcoinj><transaction-input>
Is there a way to get the address of associated with a transaction input with bitcoinj?
Aqqqq
# Is there a way to get the address of associated with a transaction input with bitcoinj?

(Asked by: username_0 on 2017-03-29)

If I was not mistaken, with transactioninput.getConnectedOutput(), the output which is used for the input is obtained.

But what to do later? There seem to be two relevant methods: getAddressFromP2PKHScript(NetworkParameters networkParameters) and getAddressFromP2SH(NetworkParameters networkParameters). Am I correct that either one of them will give me the correct address?

Also how to obtain the addresses involved in multisignature transaction with bitcoinj?

**Tags:** address, multi-signature, bitcoinj, transaction-input


---

## 1 answers

### Answer by username_1 on 2017-03-30. Score: 1

Yes, but be aware that there is no concept of a "from address" in Bitcoin. So you should always be prepared for unknown script types. For example, the sender could also be using P2PK, the oldest standardized form of payment in Bitcoin.


---

