# Re: removing bitcoin addresses

Post by: satoshi on May 16, 2010, 11:34:40 PM<br>
Last edit: May 17, 2010, 12:26:28 AM by satoshi

SheriffWoody:<br>
Bitcoin addresses you generate are kept forever. &nbsp;A bitcoin address must be kept to show ownership of anything sent to it. &nbsp;If you were able to delete a bitcoin address and someone sent to it, the money would be lost. &nbsp;They're only about 500 bytes.

sirius-m:<br>
Thousands of own addresses should not be any problem at all. &nbsp;If you've generated 50000 BTC, then you already have 1000 own addresses, one for each 50 generated. &nbsp;Those are hidden, they're not shown in the UI.

It would be a good idea to add a little code that keeps giving the same address to the same IP. &nbsp;Here's what I did in C++ to keep giving the same key (aka bitcoin address) until they use it:

&nbsp;&nbsp;&nbsp;&nbsp;// Keep giving the same key to the same ip until they use it
&nbsp;&nbsp;&nbsp;&nbsp;if (!mapReuseKey.count(pfrom->addr.ip))
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mapReuseKey\[pfrom->addr.ip\] = GenerateNewKey();

&nbsp;&nbsp;&nbsp;&nbsp;...sends the key mapReuseKey\[pfrom->addr.ip\]

...later...

&nbsp;&nbsp;&nbsp;&nbsp;// Received something with this key
&nbsp;&nbsp;&nbsp;&nbsp;mapReuseKey.erase(pfrom->addr.ip);

If it's not convenient to know when you've received, just clear the cached keys every 20 minutes.

I want to add a parameter to getnewaddress for number of days to expire if nothing is received with the address.

---

Source file: bitcoin-forum-satoshi-nakamoto.tgz

External link: https://bitcointalk.org/index.php?topic=101.msg1134#msg1134
