<p>If you write software yourself, with a custom implementation of the P2P protocol, this is certainly possible. Just send <code>getdata</code> messages for just the blocks in the range you want.</p>
<p>No such feature exists in Bitcoin Core however, as its purpose is fully verifying the state of the chain, it will always start at the very beginning. If you want blocks somewhere from 2015 you can of course just stop the software once it has passed that point.</p>
<p>Note that Bitcoin Core does support a pruned mode, in which only the last N blocks are kept on disk (but they're still all downloaded and verified, just discarded after verification). If you want access to the last 3000000 transactions, and lack diskspace for the full chain, it would be an option to synchronize in pruned mode.</p>

CC BY-SA 4.0
2023-11-19T13:06:23.713Z
I will investigate those getdata messages. I am new in the bitcoin technology so I did not know you could just send messages for specific blocks. Could I do that also to ask for some transactions? I think the idea could be to start from a random transaction and ask for the previous and the previous and so on.

A problem I have with using Bitcoin Core is that my PC is not very powerful, so I guess it could take too much time to download and verify the blockchain, even if I use pruned mode.
Kareit
CC BY-SA 4.0
2023-11-19T13:10:26.210Z
The P2P protocol does allow *asking* for specific transactions, but it's only for transactions the peer has recently announced to you. Nodes do not generally keep a database of all transactions ever that you can just query, as it's not needed for general operation, so even nodes which do have such an index do not expose it through P2P commands.
Pieter Wuille
CC BY-SA 4.0
2023-11-19T12:25:55.310Z
2023-11-19T12:25:55.310Z
Pieter Wuille
<p>I am doing some investigation related to the bitcoin transactions graph and I don't need the whole blockchain, because it would be too much data (and I don't have much space). I just need a part of the blockchain to construct a graph with the transactions and then do some analysis on it. Is it possible to download only a part of the blockchain? Let's say I want only up to 3 million transactions. Or something like the transactions from 2015 and 2016, or the most recent 3 million transactions (these are not requirements I have on the data, it's just to exemplify).</p>

<bitcoin-core><transactions><development>
Is it possible to download only a part of the blockchain?
Kareit
# Is it possible to download only a part of the blockchain?

(Asked by: username_0 on 2023-11-19)

I am doing some investigation related to the bitcoin transactions graph and I don't need the whole blockchain, because it would be too much data (and I don't have much space). I just need a part of the blockchain to construct a graph with the transactions and then do some analysis on it. Is it possible to download only a part of the blockchain? Let's say I want only up to 3 million transactions. Or something like the transactions from 2015 and 2016, or the most recent 3 million transactions (these are not requirements I have on the data, it's just to exemplify).

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


---

## 1 answers

### Answer by username_1 on 2023-11-19. Score: 2

If you write software yourself, with a custom implementation of the P2P protocol, this is certainly possible. Just send `getdata` messages for just the blocks in the range you want.

No such feature exists in Bitcoin Core however, as its purpose is fully verifying the state of the chain, it will always start at the very beginning. If you want blocks somewhere from 2015 you can of course just stop the software once it has passed that point.

Note that Bitcoin Core does support a pruned mode, in which only the last N blocks are kept on disk (but they're still all downloaded and verified, just discarded after verification). If you want access to the last 3000000 transactions, and lack diskspace for the full chain, it would be an option to synchronize in pruned mode.

> **Comments:**
> **username_0**: I will investigate those getdata messages. I am new in the bitcoin technology so I did not know you could just send messages for specific blocks. Could I do that also to ask for some transactions? I think the idea could be to start from a random transaction and ask for the previous and the previous and so on.  A problem I have with using Bitcoin Core is that my PC is not very powerful, so I guess it could take too much time to download and verify the blockchain, even if I use pruned mode.  
> **username_1**: The P2P protocol does allow *asking* for specific transactions, but it's only for transactions the peer has recently announced to you. Nodes do not generally keep a database of all transactions ever that you can just query, as it's not needed for general operation, so even nodes which do have such an index do not expose it through P2P commands.  

---

