发送和接收比特币交易

问题描述:

如何使用比特币地址发送和接收交易。
我正在使用this url
我只有发送和接收比特币地址。
另外我没有我的电子钱包帐户。

我已经使用了下面的代码。
发送和接收比特币交易

$to = // Bitcoin address1 
$from = // Bitcoin address2 
$json_url = "https://blockchain.info/merchant/d15dea6639d24b81e5caefad8aa4b0c6831cdccf1c21f8c234fd568d40e4238d/payment?to=$to&amount=5000&from=$from"; 


我得到了下面的错误。

"You must provide a recipient address" 

谢谢大家。

+0

我认为你需要在API调用中使用密码。 – 2013-05-30 16:07:04

+1

注意依靠https安全性,因为它已被nsa破解。 http://www.theguardian.com/world/2013/sep/05/nsa-gchq-encryption-code-security – mulllhausen 2013-09-13 06:17:16

只需填写以下信息...您需要一个BlockChain账户才能发送付款。但是,您不需要帐户即可接收。这只是发送,而不是回调。如果你正在寻找一个回调文件进一步阅读。

https://blockchain.info/merchant/ $ GUID /支付?密码= $ main_password & second_password = $ second_password &到= $地址&金额= $金额&从= $从&共享= $共享&费= $fee¬e= $注意

<?php 

$guid="GUID_HERE"; 
$firstpassword="PASSWORD_HERE"; 
$secondpassword="PASSWORD_HERE"; 
$amounta = "10000000"; 
$amountb = "400000"; 
$addressa = "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq"; 
$addressb = "1ExD2je6UNxL5oSu6iPUhn9Ta7UrN8bjBy"; 
$recipients = urlencode('{ 
       "'.$addressa.'": '.$amounta.', 
       "'.$addressb.'": '.$amountb.' 
      }'); 

$json_url = "http://blockchain.info/merchant/$guid/sendmany?password=$firstpassword&second_password=$secondpassword&recipients=$recipients"; 

$json_data = file_get_contents($json_url); 

$json_feed = json_decode($json_data); 

$message = $json_feed->message; 
$txid = $json_feed->tx_hash; 

?> 
+0

我喜欢这个简单但应该指出,应该是https而不是http,因为它暴露了pws。 – sradforth 2013-09-06 10:24:48

您需要在blockchain.info钱包,以发送/接收使用“我的钱包API”基金:https://blockchain.info/api/blockchain_wallet_api

如果你要使用这个API我有我使用的PHP类一世与我的区块链钱包互动:https://github.com/lukesims/Blockchain-API-PHP-Class您可能会觉得它很有用。

如果您只想接收付款,则使用不同的“接收付款API”。我不能发布超过2个链接,但区块链开发人员部分对这两者进行了明显的区分。