<p>I have a use-case where I'd only need to be monitoring the mempool transactions and recently-committed blocks/transactions (the last month's worth of blocks would be sufficient). Is there a way to tell <a href="https://github.com/bitcoinjs/bitcoinjs-server" rel="nofollow">bitcoinjs</a> to not store the whole blockchain, but start from most current instead?</p>

<p>I could create my own "Storage" object for the server that doesn't write anything if the block is older than a month, but I'm pretty sure it would still <em>try</em> to download the whole blockchain every time it connected.</p>

<p>Or is there an even more lightweight bitcoin p2p node implementation that gives this sort of functionality?</p>

<p>(Usage Details: the use case for this is an ecommerce solution; the seller creates a new one-time use payment address (it's never been used before, so we don't care about the whole blockchain history) and tells the user to make a payment to it. Now the back end starts monitoring the bitcoin p2p network for an incoming (unconfirmed) transaction. At that point the site can tell the user the first step of ordering is complete, and move them to a "pending orders" page which long-polls for confirmations on those spends. Recent blocks would be used to track confirmations, and once confirmed, wouldn't be needed any more.)</p>

CC BY-SA 3.0
2013-04-29T18:24:46.623Z
If you don't have the entire blockchain, then the unconfirmed transaction could come from a double-spend, or indeed an address that has no bitcoins to send. I imagine you would be waiting for confirmation before providing whatever you are selling, but it is something to be aware of
George Pearce
CC BY-SA 3.0
2013-04-30T11:22:19.813Z
Right; as I mentioned, this would just be for a visual indicator on the site that the user did the first step correctly. The order would still wait for  confirmations before sending.
MidnightLightning
CC BY-SA 3.0
2014-03-03T19:24:27.870Z
Do you really need to use BitcoinJS? Why not just poll blockchin.info API? E.g. `https://blockchain.info/address/...?format=json` will show you if there any transactions for the address.
max taldykin
CC BY-SA 3.0
2016-12-01T10:56:48.250Z
I'm guessing you're gonna refuse using a Payment Processor. You should consider using a SPV wallet, but it is quite dangerous as you lose privacy and your users may be able to mount a doublespend attack against you quite easily. Otherwise, run a full node with prune mode, then storage will not be a problem.
rny
<server><bitcoinjs>
BitcoinJS with no storage?
MidnightLightning
# BitcoinJS with no storage?

(Asked by: username_0 on 2013-04-29)

I have a use-case where I'd only need to be monitoring the mempool transactions and recently-committed blocks/transactions (the last month's worth of blocks would be sufficient). Is there a way to tell [bitcoinjs](https://github.com/bitcoinjs/bitcoinjs-server) to not store the whole blockchain, but start from most current instead?

I could create my own "Storage" object for the server that doesn't write anything if the block is older than a month, but I'm pretty sure it would still *try* to download the whole blockchain every time it connected.

Or is there an even more lightweight bitcoin p2p node implementation that gives this sort of functionality?

(Usage Details: the use case for this is an ecommerce solution; the seller creates a new one-time use payment address (it's never been used before, so we don't care about the whole blockchain history) and tells the user to make a payment to it. Now the back end starts monitoring the bitcoin p2p network for an incoming (unconfirmed) transaction. At that point the site can tell the user the first step of ordering is complete, and move them to a "pending orders" page which long-polls for confirmations on those spends. Recent blocks would be used to track confirmations, and once confirmed, wouldn't be needed any more.)

**Tags:** server, bitcoinjs

> **Comments:**
> **username_1**: If you don't have the entire blockchain, then the unconfirmed transaction could come from a double-spend, or indeed an address that has no bitcoins to send. I imagine you would be waiting for confirmation before providing whatever you are selling, but it is something to be aware of  
> **username_0**: Right; as I mentioned, this would just be for a visual indicator on the site that the user did the first step correctly. The order would still wait for  confirmations before sending.  
> **username_2**: Do you really need to use BitcoinJS? Why not just poll blockchin.info API? E.g. `https://blockchain.info/address/...?format=json` will show you if there any transactions for the address.  
> **username_3**: I'm guessing you're gonna refuse using a Payment Processor. You should consider using a SPV wallet, but it is quite dangerous as you lose privacy and your users may be able to mount a doublespend attack against you quite easily. Otherwise, run a full node with prune mode, then storage will not be a problem.  

---

## 0 answers

