Trying Represent Bitcoin Transactions

23 views
Skip to first unread message

leelaba...@ensoftcorp.com

unread,
Jan 23, 2017, 4:13:48 PM1/23/17
to bitcoinj
Hello,

Is there a way to find the amount of bitcoins each TransactionInput sent to the Transaction object? I also want to know if it is possible to find the amount that is sent to the TransactionObject and the address associated with the Transaction Object. 

Thanks

Andreas Schildbach

unread,
Jan 24, 2017, 6:00:46 PM1/24/17
to bitc...@googlegroups.com
Sounds like TransactionInput.getValue() is your friend. However if the
input isn't connected to an output of a previous transaction then that
value isn't known.

Transactions can send to any number of addresses (and other script
types) at the same time. Loop through all the outputs and use the
getAddressFrom* methods.

Leelabari Fulbel

unread,
Jan 27, 2017, 2:45:05 PM1/27/17
to bitc...@googlegroups.com
Thanks for the reply. I think that is the right thing to due. However when I try it out on the first 5000 blocks of the block chain (from the genesis block) all of the Transactioninputs have a null value for the .getValue() because none of them are "connected" to an TransactionOutput. Is this a limitation of bitcoinJ? Do TransactionsInputs only have values if they come from a wallet application that is running? I am more interested in this for research purposes.

Thanks.



--
You received this message because you are subscribed to a topic in the Google Groups "bitcoinj" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bitcoinj/Zl6MzdP6NqM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bitcoinj+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Leelabari Fulbel
Software Engineering Intern

Andreas Schildbach

unread,
Jan 28, 2017, 11:45:33 AM1/28/17
to bitc...@googlegroups.com
The Wallet class keeps only transactions that are relevant to the
wallet. This means that the inputs of incoming transactions are
typically not connected and this the input value isn't known.


On 01/27/2017 08:44 PM, Leelabari Fulbel wrote:
> Thanks for the reply. I think that is the right thing to due. However
> when I try it out on the first 5000 blocks of the block chain (from the
> genesis block) all of the Transactioninputs have a null value for the
> .getValue() because none of them are "connected" to an
> TransactionOutput. Is this a limitation of bitcoinJ? Do
> TransactionsInputs only have values if they come from a wallet
> application that is running? I am more interested in this for research
> purposes.
>
> Thanks.
>
> On Tue, Jan 24, 2017 at 4:59 PM, Andreas Schildbach
> <and...@schildbach.de <mailto:and...@schildbach.de>> wrote:
>
> Sounds like TransactionInput.getValue() is your friend. However if the
> input isn't connected to an output of a previous transaction then that
> value isn't known.
>
> Transactions can send to any number of addresses (and other script
> types) at the same time. Loop through all the outputs and use the
> getAddressFrom* methods.
>
>
> On 01/23/2017 10:13 PM, leelaba...@ensoftcorp.com
> <mailto:leelaba...@ensoftcorp.com> wrote:
> > Hello,
> >
> > Is there a way to find the amount of bitcoins each
> TransactionInput sent to
> > the Transaction object? I also want to know if it is possible to
> find the
> > amount that is sent to the TransactionObject and the address
> associated
> > with the Transaction Object.
> >
> > Thanks
> >
>
>
> --
> You received this message because you are subscribed to a topic in
> the Google Groups "bitcoinj" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/bitcoinj/Zl6MzdP6NqM/unsubscribe
> <https://groups.google.com/d/topic/bitcoinj/Zl6MzdP6NqM/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to
> bitcoinj+u...@googlegroups.com
> <mailto:bitcoinj%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
>
>
> --
> Leelabari Fulbel
> Software Engineering Intern
>
> --
> 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 bitcoinj+u...@googlegroups.com
> <mailto:bitcoinj+u...@googlegroups.com>.

Leelabari Fulbel

unread,
Feb 1, 2017, 11:45:47 AM2/1/17
to bitc...@googlegroups.com
Do you know if there is a way to get the hash of the transaction from where the transaction input from for a particular transaction. I don't mean the transaction hash of the transaction where you get the list of transaction inputs of a particular TransactionInput object but the hash of the Transaction from where the Transaction Output that corresponds to the given TransActionInput.

Thanks. I hope that makes sense.

On Sat, Jan 28, 2017 at 10:44 AM, Andreas Schildbach <and...@schildbach.de> wrote:
The Wallet class keeps only transactions that are relevant to the
wallet. This means that the inputs of incoming transactions are
typically not connected and this the input value isn't known.


On 01/27/2017 08:44 PM, Leelabari Fulbel wrote:
> Thanks for the reply. I think that is the right thing to due. However
> when I try it out on the first 5000 blocks of the block chain (from the
> genesis block) all of the Transactioninputs have a null value for the
> .getValue() because none of them are "connected" to an
> TransactionOutput. Is this a limitation of bitcoinJ? Do
> TransactionsInputs only have values if they come from a wallet
> application that is running? I am more interested in this for research
> purposes.
>
> Thanks.
>
> On Tue, Jan 24, 2017 at 4:59 PM, Andreas Schildbach
> <and...@schildbach.de <mailto:and...@schildbach.de>> wrote:
>
>     Sounds like TransactionInput.getValue() is your friend. However if the
>     input isn't connected to an output of a previous transaction then that
>     value isn't known.
>
>     Transactions can send to any number of addresses (and other script
>     types) at the same time. Loop through all the outputs and use the
>     getAddressFrom* methods.
>
>
>     On 01/23/2017 10:13 PM, leelaba...@ensoftcorp.com
>     <mailto:leelabarifulbel@ensoftcorp.com> wrote:
>     > Hello,
>     >
>     > Is there a way to find the amount of bitcoins each
>     TransactionInput sent to
>     > the Transaction object? I also want to know if it is possible to
>     find the
>     > amount that is sent to the TransactionObject and the address
>     associated
>     > with the Transaction Object.
>     >
>     > Thanks
>     >
>
>
>     --
>     You received this message because you are subscribed to a topic in
>     the Google Groups "bitcoinj" group.
>     To unsubscribe from this topic, visit
>     https://groups.google.com/d/topic/bitcoinj/Zl6MzdP6NqM/unsubscribe
>     <https://groups.google.com/d/topic/bitcoinj/Zl6MzdP6NqM/unsubscribe>.
>     To unsubscribe from this group and all its topics, send an email to
>     <mailto:bitcoinj%2Bunsu...@googlegroups.com>.
>     For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>
>
>
>
> --
> Leelabari Fulbel
> Software Engineering Intern
>
> --
> 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
> For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to a topic in the Google Groups "bitcoinj" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bitcoinj/Zl6MzdP6NqM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bitcoinj+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages