Bitcointalk · removing bitcoin addresses

中本聪,2010 年 5 月 16 日

SN-0495 已核对来源,附原文与上下文。

阅读语言
中文译文

SheriffWoody: 你生成的比特币地址会永久保留。必须保留一个比特币地址,才能证明发往它的东西归你所有。如果你能删除一个比特币地址而有人向它发了款,钱就丢了。它们每个只有大约 500 字节。

sirius-m: 上千个自有地址完全不成问题。如果你已经生成了 50000 BTC,那你其实已经有 1000 个自有地址了,每生成 50 个就有一个。它们是隐藏的,不在 UI 里显示。

加一小段代码、给同一个 IP 持续返回同一个地址,是个好主意。我是这样用 C++ 做的:在对方使用之前,一直给同一个 IP 返回同一个密钥(即比特币地址):

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

……之后……

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

如果不方便知道何时收到过款,就每 20 分钟清一次缓存的密钥。

我想给 getnewaddress 加一个参数:若该地址在多少天内无收款就过期。

ORIGINAL · 英文原文
SheriffWoody:
Bitcoin addresses you generate are kept forever.  A bitcoin address must be kept to show ownership of anything sent to it.  If you were able to delete a bitcoin address and someone sent to it, the money would be lost.  They're only about 500 bytes.

sirius-m:
Thousands of own addresses should not be any problem at all.  If you've generated 50000 BTC, then you already have 1000 own addresses, one for each 50 generated.  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.  Here's what I did in C++ to keep giving the same key (aka bitcoin address) until they use it:

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

...later...

    // Received something with this key
    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.
上下文
← 上一条 SN-0495 · 当前 下一条 → 在档案中查看完整主题串 →
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-0495