2

I'm doing some experiments involving bitcoin and the blockchain, and I need to access some informations about addresses, block, and transactions. The problem is that I need a lot of data, so I can't use online APIs such as blockchain.info. I know it is possible to do such things by downloading and accessing directly the blockchain, but this solution is pretty impracticable, given its size. Is it possible to access this data without downloading the full blockchain? For example by directly making some kind of request to the nodes?

  • Can you include what exactly you need from the blockchain? The answer will depend on what you need and the information that you already know. – Andrew Chow Jul 30 '17 at 4:51
  • For example, I would like to get the amount of bitcoins an address has or the addresses involved in a transaction – El3k0n Jul 30 '17 at 14:14
2

To get anything other than blocks, you will need to download the entire blockchain. The only things you can request from a node is a block if you know the block hash, and transactions, if you know the transaction id AND the transaction is still in the node's mempool. Transactions which have already been confirmed cannot be requested as the node will have removed the transaction from its memory and stored it to disk with the block. Everything else requires the full blockchain as they are mostly human abstractions of the blocks and transactions that are not relevant to the network.

The "balance" of an address (besides technically not existing) can only be found by having the entire blockchain and reading through the blockchain and scanning all transactions for any inputs and outputs that are associated with that address. Getting the transactions that an address is involved in requires doing the same thing. This is because addresses don't exist to the network as they are only abstractions for humans to more easily think about transactions. Balances don't exist either as Bitcoin does not use an accounts or balance system for tracking money. Rather it is all based on transaction outputs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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