Can I find (always, without fault) the specific set of blocks from which the Bitcoins that I hold originated?
If yes, would such a trace-back be computationally costly?
Bitcoin Stack Exchange is a question and answer site for Bitcoin users, developers, and enthusiasts. It only takes a minute to sign up.
Sign up to join this communityCan I find (always, without fault) the specific set of blocks from which the Bitcoins that I hold originated?
If yes, would such a trace-back be computationally costly?
Yes you can do this but I wonder what to do with the outcome. If you receive 1 BTC today you can assume that the path back ends up often in ten thousands of mined bitcoin addresses. Assume the transaction used 3 input addresses and each of the 3 had 3 inputs one step back in history. Then this exponentially grows. This is similar like going back in your personal origin. You have 2 parents, 4 grandparents, 8 grand-grandparents, 16 grand-grand-grandparents ... . After 10 steps back you're above 1000 and after 20 steps above 1 million. There is of course double counting however the total number gets quickly high. I think it's not too computationally costly if you do it only for one address. If you do it for all 600+ million you need a powerful machine or a lot of time.
Yes, you can, every transaction in the bitcoin network is registered in a public ledger called blockchain. You can query this ledger via HTTP interface like https://blockchain.info/api/blockchain_api
I don't think will be costly but it depends on how many hands your bitcoin passed. When you find a transaction without a sender, you have to stop, these are mined (generated) blocks
UPDATE 2022:
HTTP API has 2 major problems:
It is better to query your local copy of the blockchain, using Bitcoin Core with tx index allows you to query the previous outputs of transactions until you find the generating blocks. Note I used plural for blocks because transactions could have multiple inputs, possibly generated by different blocks.
Can I find (always, without fault) the specific set of blocks from which the Bitcoins that I hold originated?
Short answer: No.
Yes in the completely trivial sense that your Bitcoins were created in the transaction in which they appeared as outputs. But this isn't the sort of origin you had in mind.
But no in any real sense because a Bitcoin is an unspent transaction output (UTXO). A UTXO has no continuity through transactions and so neither does a Bitcoin. You cannot meaningfully or reliably trace a Bitcoin back through multiple transactions to one or more specific mining rewards.
This is mainly because the public journal of transactions we call the blockchain does not associate transaction outputs with specific transaction inputs. Often you can make an inference if there are few inputs but certainly not "always, without fault".
If a transaction takes three of Alice's coins worth 3, 1.5 and 3.5 and pays Bob 4 and Carol 4 there is no way for Eve or Judy to say where Bob's 4 came from.