On 12/20/2016 01:58 AM, Ali Akhtar wrote:
> When I load a block, and go thru its transactions, how can I determine
> the sender, and recipient of the transaction?
> 
> Each transaction has an inputs and outputs list. How can the receiver
> and sender addresses be inferred through them?

If by sender/receiver you mean an identity of them, you can't. Bitcoin
is pseudonomous.

> There's also a scripts section which only returns an array of bytes.
> When I try to create a string of these bytes, its unreadable.

The byte array is a binary format. You an parse it into a script using
the org.bitcoinj.script.Script constructor.

> Do the scripts need to be used in determining the sender / receiver? Is
> there a parser for the scripts included in bitcoinJ (or in another library)?

If the script is a pay to pubkey hash, you can get the recipient address
from the script. See the .isSentToAddress() and .getToAddress() methods.


-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to