5

I am developing simple Bitcoin application using the bitcoinj library: The user enters the hash of a transaction and my application should return detailed information about that transaction.

How can I load that transaction? Is there a function like peer.getBlock() for transactions?

1 Answer 1

2

BitCoinJ is a Simplified Payment Verification (SPV) client library

This means that it only downloads the headers for transactions, and only those that are relevant to the private keys contained in its wallet only. This greatly reduces the blockchain download (very quick to get started), but at the cost of not seeing all the other transactions (reduced overall network security).

So, in short, you can't download an arbitrary transaction through BitCoinJ.

However, to answer your requirement have you considered just using the Blockchain.info API?

2
  • Well how does then bitcoinj downloads relevant transaction from it's peers ? Isn't it possible to ask peers to get particular transaction ? Commented Feb 21, 2016 at 14:03
  • @PavelNiedoba Here's a link to more details on how SPV works: multibit.org/en/help/hd0.2/how-spv-works.html
    – Gary
    Commented Feb 21, 2016 at 21:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.