<p>You cannot do this for a number of reasons.</p>

<ol>
<li><p>Bitcoin is mined - There are many bitcoin around that have never passed through an exchange (all of Satoshi's, for instance). Since they've never been traded, you can't find any trade data for them</p></li>
<li><p>Exchanges operate offchain - You cannot link an onchain transaction to an offchain trade and its price easily. Many people only withdraw when moving between exchanges, or to cold storage. This could mean that they traded BTC months/years ago, but an onchain transaction only appeared yesterday</p></li>
<li><p>Onchain transactions don't have to be from exchanges - Transactions could simply be moving money between the user's own wallets, or exchanging for other goods/coins. Once again, you can't look at a transaction and know what it's for.</p></li>
</ol>

<p>Exchange wallets are usually identifiable for most major exchanges. However, it's going to be nearly impossible to link individual transactions on the chain to individual trades without extensive raw data from the exchanges itself. Even after that, you will be missing data on OTC and other non-exchange trades.</p>

CC BY-SA 3.0
2018-04-05T01:50:35.063Z
Raghav, thanks. A few follow-up questions. 1) If I understand correctly, mined bitcoin doesn't immediately show up in the transaction history? It only shows up after it's been used in a transaction with another private key? 2) When you buy bitcoin from an exchange, they do not make an on-chain transaction? So this means they have not actually purchased bitcoin for you - all of the accounting is done internally within the exchange? If I buy 1 bitcoin from CoinBase today, when does this transaction actually show up in the Bitcoin transaction history?
adn bps
CC BY-SA 3.0
2018-04-05T02:03:53.180Z
1. Mined bitcoin shows up in the block it is mined as the first transaction. Here's an example of newly created BTC: https://blockchain.info/tx/d1a2408cecfacdbb50c99200fee5820fecae6bfaa091596c576fd71e3fa982a5
Raghav Sood
CC BY-SA 3.0
2018-04-05T02:04:54.780Z
1. That's correct. Exchanges use internal accounting systems. No transaction on the Bitcoin network is made until you deposit or withdraw coins. Until you withdraw coins from an exchange to your own wallet (where you control the private keys), you are trusting the exchange to not default on their promise that you own X bitcoin.
Raghav Sood
CC BY-SA 3.0
2018-04-05T01:41:46.780Z
2018-04-05T01:41:46.780Z
Raghav Sood
<p>Since the full Bitcoin transaction history is public, is it possible to calculate the values that all currently held Bitcoins were acquired at (in USD). For example, if a Bitcoin has been held since Jan 11, 2011, then it was acquired when the exchange rate was $0.32. But if a bitcoin was acquired today, then its acquisition price was ~$7000 (today is a bad example because it was so volatile).</p>

<p>If so, I was wondering if anyone could point me in the right direction? I know I would need to parse the full transaction log, but I'm not sure:</p>

<p>1) Are there timestamps on the individual transactions? If not, what is the best way to infer the transaction date? Just using the block number?</p>

<p>2) Is it easy to identify transactions for the various exchanges (Coinbase, etc)? How would I do this?</p>

<p>3) I am assuming I can find the historical exchange rates somewhere, but if anyone can point me to this, it would also be helpful!</p>

<p>Any other advice? Thanks! I am new to Bitcoin, but very interested in learning more.</p>

<transactions><bitcoin-core><bitcoind>
Finding the purchase values of all currently held bitcoin
adn bps
# Finding the purchase values of all currently held bitcoin

(Asked by: username_0 on 2018-04-05)

Since the full Bitcoin transaction history is public, is it possible to calculate the values that all currently held Bitcoins were acquired at (in USD). For example, if a Bitcoin has been held since Jan 11, 2011, then it was acquired when the exchange rate was $0.32. But if a bitcoin was acquired today, then its acquisition price was ~$7000 (today is a bad example because it was so volatile).

If so, I was wondering if anyone could point me in the right direction? I know I would need to parse the full transaction log, but I'm not sure:

1) Are there timestamps on the individual transactions? If not, what is the best way to infer the transaction date? Just using the block number?

2) Is it easy to identify transactions for the various exchanges (Coinbase, etc)? How would I do this?

3) I am assuming I can find the historical exchange rates somewhere, but if anyone can point me to this, it would also be helpful!

Any other advice? Thanks! I am new to Bitcoin, but very interested in learning more.

**Tags:** transactions, bitcoin-core, bitcoind


---

## 1 answers

### Answer by username_1 on 2018-04-05. Score: 0 | Accepted answer

You cannot do this for a number of reasons.

1. Bitcoin is mined - There are many bitcoin around that have never passed through an exchange (all of Satoshi's, for instance). Since they've never been traded, you can't find any trade data for them
2. Exchanges operate offchain - You cannot link an onchain transaction to an offchain trade and its price easily. Many people only withdraw when moving between exchanges, or to cold storage. This could mean that they traded BTC months/years ago, but an onchain transaction only appeared yesterday
3. Onchain transactions don't have to be from exchanges - Transactions could simply be moving money between the user's own wallets, or exchanging for other goods/coins. Once again, you can't look at a transaction and know what it's for.

Exchange wallets are usually identifiable for most major exchanges. However, it's going to be nearly impossible to link individual transactions on the chain to individual trades without extensive raw data from the exchanges itself. Even after that, you will be missing data on OTC and other non-exchange trades.

> **Comments:**
> **username_0**: username_1, thanks. A few follow-up questions. 1) If I understand correctly, mined bitcoin doesn't immediately show up in the transaction history? It only shows up after it's been used in a transaction with another private key? 2) When you buy bitcoin from an exchange, they do not make an on-chain transaction? So this means they have not actually purchased bitcoin for you - all of the accounting is done internally within the exchange? If I buy 1 bitcoin from CoinBase today, when does this transaction actually show up in the Bitcoin transaction history?  
> **username_1**: 1. Mined bitcoin shows up in the block it is mined as the first transaction. Here's an example of newly created BTC: https://blockchain.info/tx/d1a2408cecfacdbb50c99200fee5820fecae6bfaa091596c576fd71e3fa982a5  
> **username_1**: 1. That's correct. Exchanges use internal accounting systems. No transaction on the Bitcoin network is made until you deposit or withdraw coins. Until you withdraw coins from an exchange to your own wallet (where you control the private keys), you are trusting the exchange to not default on their promise that you own X bitcoin.  

---

