Is there a way to get the address of associated with a transaction input with bitcoinj?

0

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?

Aqqqq

Posted 2017-03-29T07:29:59.030

Reputation: 277

Answers

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.

Andreas Schildbach

Posted 2017-03-29T07:29:59.030

Reputation: 499