Bitcoin transaction “"You must provide a recipient address" ” error.

0 votes

I have written a code to send and receive transaction using bitcoin address. I have only Bitcoin addresses for send and receive. Also I do not have a My Wallet account.

$to = // Bitcoin address1

$from = // Bitcoin address2

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

I got below error.

"You must provide a recipient address"
Aug 20, 2018 in Blockchain by slayer
• 29,040 points
16 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

You need an account with BlockChain to send payments. You don't need an account to receive.

I use the following code and it works:


<?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;


?>

To know more, visit: https://www.blockchain.com/api/blockchain_wallet_api

answered Aug 20, 2018 by digger
• 27,620 points

Related Questions In Blockchain

0 votes
1 answer

Truffle tutorials "Error:recipient address is not a contract address"

It appears like you have already migrated ...READ MORE

answered Aug 8, 2018 in Blockchain by slayer
• 29,040 points
157 views
0 votes
1 answer
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
65 views
+1 vote
3 answers

Removing double quotes from a string from JSON response in PHP

Just remove the json_encode call, and it should work: $resp ...READ MORE

answered Sep 12, 2018 in Blockchain by digger
• 27,620 points
1,556 views
0 votes
1 answer
0 votes
1 answer

Solidity mocha : address is not a contract error

Try the following: // Initialize contract variable with ...READ MORE

answered Oct 1, 2018 in Blockchain by digger
• 27,620 points
25 views
0 votes
1 answer

How to extract h160 address of bitcoin blockchain?

You can extract the data using the ...READ MORE

answered Jul 16, 2018 in Blockchain by digger
• 27,620 points
50 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.