简体   繁体   English

如何在没有钱包中的私钥的情况下检查0确认的比特币交易?

[英]How can I check a 0-confirmation Bitcoin transaction without having the private key in my wallet?

I am programming a site that accepts Bitcoin payments, but I do not want to hold any private keys on the server. 我正在编写一个接受比特币支付的网站,但我不想在服务器上保留任何私钥。 I am using the so-called "lazy API" method where I create private keys and addresses ahead of time off-line, and then get customers to send to them, and I want to be notified when the transaction happens, as fast as possible, with 0 confirmations. 我正在使用所谓的“懒惰API”方法,我提前创建私钥和地址离线,然后让客户发送给他们,我希望在事务发生时尽快得到通知,尽快,有0个确认。

I can't figure out how to do this programmatically, unless I add the private key to bitcoind's wallet, which I don't want to do for security reasons. 我无法弄清楚如何以编程方式执行此操作,除非我将私钥添加到bitcoind的钱包,出于安全原因我不想这样做。 I'd prefer to do it in PHP, but I'll settle for whatever. 我宁愿用PHP来做,但我会满足于此。

On the Lazy API page, it suggests using blockexplorer.com to check for confirmations. 在Lazy API页面上,它建议使用blockexplorer.com检查确认。

https://en.bitcoin.it/wiki/Lazy_API#Solution_for_receiving_bitcoins https://en.bitcoin.it/wiki/Lazy_API#Solution_for_receiving_bitcoins

#4 under Solution for Receiving Bitcoins: 接收比特币的解决方案中的#4:

Check blockexplorer to see if they sent the right amount (ie http://blockexplorer.com/q/getreceivedbyaddress/19hMEAaRMbEhfSkeU4GT8mgSuyR4t4M6TH/1 ) - the /1 is the number of confirmations you require 检查blockexplorer以查看它们是否发送了正确的数量(即http://blockexplorer.com/q/getreceivedbyaddress/19hMEAaRMbEhfSkeU4GT8mgSuyR4t4M6TH/1 ) - / 1是您需要的确认数量

You don't need to check your own bitcoin client for a transaction to a specific address. 您无需检查自己的比特币客户端以获取特定地址的交易。 You can use https://blockchain.info/api . 您可以使用https://blockchain.info/api

Also, since version .10.0 the bitcoin client supports watch only addresses which allows you to add the public key without the private key and observe transactions this way. 此外,从版本.10.0开始,比特币客户端支持仅限监视地址,允许您在没有私钥的情况下添加公钥,并以这种方式观察事务。

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

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