简体   繁体   English

在比特币节点上添加手动生成的私钥

[英]Adding a manually generated private key on bitcoin node

We are hosting a bitcoin node to handle deposits on our website.我们正在托管一个比特币节点来处理我们网站上的存款。 Now, we generate new addresses on the node via RPC call.现在,我们通过 RPC 调用在节点上生成新地址。 The problem is that the client is afraid of losing the private keys in case of server failure for example.问题是客户端害怕在服务器故障的情况下丢失私钥。

So what I purposed is that we can have a master key and an increment counter to generate any number of private keys from that.所以我的目的是我们可以有一个主密钥和一个增量计数器来从中生成任意数量的私钥。 With this, we just have to back up the master key and we can re-generate all the private keys again in case we lose data on the server.有了这个,我们只需要备份主密钥,我们就可以重新生成所有的私钥,以防我们丢失服务器上的数据。

The issue here is that the bitcoin node will only notify us about new transactions when the address is generated on the node itself and we cannot modify the way the node generates new addresses.这里的问题是比特币节点只会在节点本身生成地址时通知我们新交易,我们无法修改节点生成新地址的方式。

I have 2 questions:我有两个问题:

  1. Am I on the right path?我在正确的道路上吗?
  2. How can I add the manually generated private keys on the node so that the node will notify me when a new transaction is received on those keys?如何在节点上添加手动生成的私钥,以便节点在这些密钥上收到新交易时通知我?

Thank you.谢谢你。

bitcoind's wallet already does the "generate keys from a single seed" thing for you. bitcoind 的钱包已经为你做了“从单个种子生成密钥”的事情。 So you could simply make multiple backups of the wallet (see the "backupwallet" RPC method).因此,您可以简单地对钱包进行多次备份(参见“backupwallet”RPC 方法)。

However, bitcoins should really not be stored on a website, and if you are handling withdrawls, you really need a much more secure setup in general or you will be robbed.但是,比特币真的不应该存储在网站上,如果你正在处理提款,你真的需要一个更安全的设置,否则你被抢劫。

If you are only taking payments/deposits and not doing withdrawls, it is still inadvisable to allow your website to access the private keys.如果您只接受付款/存款而不进行提款,那么让您的网站访问私钥仍然是不可取的。 Instead, maintain a wallet offline, and use the "importaddress" RPC method to maintain a watch-only copy of your "wallet" on the webserver.相反,保持钱包离线,并使用“importaddress”RPC 方法在网络服务器上维护“钱包”的仅供观看的副本。 Be sure before you ship products, that you verify payments with a full node independent of the webserver as well.确保在发货之前,您也使用独立于网络服务器的完整节点验证付款。

Note that no matter where you store your wallet, you should make at least several backups initially, and don't forget to also backup any metadata you need to properly deliver your products/services and minimise your tax liabilities.请注意,无论您将钱包存放在哪里,最初都应至少进行多次备份,并且不要忘记备份您需要的任何元数据,以正确交付您的产品/服务并最大限度地减少您的纳税义务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM