Author

Topic: Traversing Bitcoin by bitcoin-cli (Read 174 times)

newbie
Activity: 16
Merit: 1
December 07, 2019, 05:56:07 AM
#5
I see. So my problem is, that I would like to get the flow of transactions somehow from the Bitcoin blockchain. I tried some blockexplorer APIs, but they seemed to be pretty unstable sometimes. What would be the good way to do it?
staff
Activity: 3458
Merit: 6793
Just writing some code
December 06, 2019, 07:20:35 PM
#4
OK. How do blockexplorers work then? Because I found one API, which has this feature. Do they have any backend on the server, that tries to connect every input of a new transaction to its previous output?
They don't  use Bitcoin Core, or at the very least, not stock Bitcoin Core. Instead they have their own custom  software and databases which parse and index the blockchain data so that lookups are fast. They also do other things which link together things that aren't actually linked in the blockchain, such as "input addresses".
newbie
Activity: 16
Merit: 1
December 06, 2019, 02:47:13 PM
#3
OK. How do blockexplorers work then? Because I found one API, which has this feature. Do they have any backend on the server, that tries to connect every input of a new transaction to its previous output?
staff
Activity: 3458
Merit: 6793
Just writing some code
December 06, 2019, 11:45:44 AM
#2
If you can  create  a transaction spending the output, then  you can create a transaction and use testmempoolaccept.

Otherwise, there is no way to check whether an output was spent. It wouldn't be terribly hard to add an RPC for that, but I'm not sure of the  usefulness of this.

With a spent output, you definitely cannot find the transaction it was spent in. Bitcoin Core does not store this information because it is not useful to it. To extract that information, you would have to go through every transaction in the blockchain and store  which outpoints are spent in which transaction.
newbie
Activity: 16
Merit: 1
December 06, 2019, 11:03:42 AM
#1
Hello.

I would like to ask, if it is possible with the help of bitcoin-cli to discover, if output of some transaction is spent, and if it is, which transaction it was. If it is not possible directly with bitcoin-cli, is there any other way, how to extract this information from Bitcoin blockchain?

Edit: Noticed I am maybe in a wrong category. Bitcoin Technical Support might be better place to put this question.
Jump to: