Author

Topic: Best Way to send bitcoin using Privatekey [PHP or SHELL] (Read 308 times)

full member
Activity: 634
Merit: 106
Europe Belongs To Christians
for anyone looking for updates to this thread the best i found for general public is dev.btc.com

it has fees adjustments, fast and realiable
hero member
Activity: 1582
Merit: 759
You could use the Block.IO Api; they have an example for sweeping here: https://github.com/BlockIo/block_io-php/blob/master/examples/sweeper.php

There's more information on their API page here as well (although, I couldn't find anything regarding sweeping):
https://block.io/api/

block io api is known for cold techniques stealing and manipluating funds, i would advise everyone to be carefull

Do you have links/references for this? I'd like to take a look.

Cheers,
full member
Activity: 634
Merit: 106
Europe Belongs To Christians
You could use the Block.IO Api; they have an example for sweeping here: https://github.com/BlockIo/block_io-php/blob/master/examples/sweeper.php

There's more information on their API page here as well (although, I couldn't find anything regarding sweeping):
https://block.io/api/

block io api is known for cold techniques stealing and manipluating funds, i would advise everyone to be carefull
hero member
Activity: 1582
Merit: 759
You could use the Block.IO Api; they have an example for sweeping here: https://github.com/BlockIo/block_io-php/blob/master/examples/sweeper.php

There's more information on their API page here as well (although, I couldn't find anything regarding sweeping):
https://block.io/api/
full member
Activity: 634
Merit: 106
Europe Belongs To Christians
Quote
can you link me to a single webapge, its full search and none of them offer solution i am trying to get
You could search by yourself instead of asking and waiting for the ready answer, it was just an example. However, the first result of the search points to a PHP Bitcoin library providing a transaction builder.

i practicly looked to all repo, none of them seems to work as i intended

+ who told i am waiting here ? i am already working on project why would i keep my hopes on you guys, i am just here for suggestion.
hero member
Activity: 1582
Merit: 759

Ah ok, I see, I missed that.

If you're not up for RPC, you can use PHP along with LoyveV's reco. Or, you can try another API
sr. member
Activity: 279
Merit: 435
Quote
can you link me to a single webapge, its full search and none of them offer solution i am trying to get
You could search by yourself instead of asking and waiting for the ready answer, it was just an example. However, the first result of the search points to a PHP Bitcoin library providing a transaction builder.
full member
Activity: 634
Merit: 106
Europe Belongs To Christians
If you want to use PHP, you're either going to have to run a Bitcoind server, or leverage an existing API (for example, Blockchain.info's)

Bitcoind

Using PHP-bitcoinrpc class (https://github.com/denpamusic/php-bitcoinrpc)

Code:
$bitcoind = new BitcoinClient('http://rpcuser:rpcpassword@localhost:8332/');

//add the private key (label, key)
$import bitcoind->importprivkey("SOME_PRIVATE_KEY");

$result $bitcoind->sendToAddress('YOUR_ADDRESS'0.1); // 0.1=amount
$txid $result->get();
?>

Note: I haven't tested this code, so please test

Using an API (Blockchain.com)

Code:

$Blockchain 
= new \Blockchain\Blockchain($api_code);
$Blockchain->setServiceUrl("http://localhost:3000"); // Set to service URL (for example: https://blockchain.info/merchant/$guid/)
$wallet $Blockchain->Create->createWithKey($password$privKey$email=null$label=null);

// Example: Send 0.005 BTC to YOUR_ADDRESS (replace), with a 0.0001 BTC fee
$response $wallet->send("YOUR_ADDRESS""0.005"null"0.0001");

p.s: you should probably move this to development & technical (https://bitcointalk.org/index.php?board=6.0), you'd get more programming related responses/assistance there.

thanks for reply, but Blockchain.com api is not good small Payout as they take 0.001 from every payout

You can change the fee by switching the last parameter in $wallet->send. That was just for an example.

this is what i am trying to say



https://www.blockchain.com/api/blockchain_wallet_api
full member
Activity: 634
Merit: 106
Europe Belongs To Christians
Quote
Send BTC from private key to a address
You don't have to use only RPC, you can also make transactions and send them to the network thanks to a library .


can you link me to a single webapge, its full search and none of them offer solution i am trying to get
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
simple small script

Electrum like solution to send
I haven't tested it, but have you lookd at Electrum command line options? I was amazed with this feature a while ago. It may be worth checking if it can do what you need.
sr. member
Activity: 279
Merit: 435
Quote
Send BTC from private key to a address
You don't have to use only RPC, you can also make transactions and send them to the network thanks to a library .
hero member
Activity: 1582
Merit: 759
If you want to use PHP, you're either going to have to run a Bitcoind server, or leverage an existing API (for example, Blockchain.info's)

Bitcoind

Using PHP-bitcoinrpc class (https://github.com/denpamusic/php-bitcoinrpc)

Code:
$bitcoind = new BitcoinClient('http://rpcuser:rpcpassword@localhost:8332/');

//add the private key (label, key)
$import bitcoind->importprivkey("SOME_PRIVATE_KEY");

$result $bitcoind->sendToAddress('YOUR_ADDRESS'0.1); // 0.1=amount
$txid $result->get();
?>

Note: I haven't tested this code, so please test

Using an API (Blockchain.com)

Code:

$Blockchain 
= new \Blockchain\Blockchain($api_code);
$Blockchain->setServiceUrl("http://localhost:3000"); // Set to service URL (for example: https://blockchain.info/merchant/$guid/)
$wallet $Blockchain->Create->createWithKey($password$privKey$email=null$label=null);

// Example: Send 0.005 BTC to YOUR_ADDRESS (replace), with a 0.0001 BTC fee
$response $wallet->send("YOUR_ADDRESS""0.005"null"0.0001");

p.s: you should probably move this to development & technical (https://bitcointalk.org/index.php?board=6.0), you'd get more programming related responses/assistance there.

thanks for reply, but Blockchain.com api is not good small Payout as they take 0.001 from every payout

You can change the fee by switching the last parameter in $wallet->send. That was just for an example.
full member
Activity: 634
Merit: 106
Europe Belongs To Christians
If you want to use PHP, you're either going to have to run a Bitcoind server, or leverage an existing API (for example, Blockchain.info's)

Bitcoind

Using PHP-bitcoinrpc class (https://github.com/denpamusic/php-bitcoinrpc)

Code:
$bitcoind = new BitcoinClient('http://rpcuser:rpcpassword@localhost:8332/');

//add the private key (label, key)
$import bitcoind->importprivkey("SOME_PRIVATE_KEY");

$result $bitcoind->sendToAddress('YOUR_ADDRESS'0.1); // 0.1=amount
$txid $result->get();
?>

Note: I haven't tested this code, so please test

Using an API (Blockchain.com)

Code:

$Blockchain 
= new \Blockchain\Blockchain($api_code);
$Blockchain->setServiceUrl("http://localhost:3000"); // Set to service URL (for example: https://blockchain.info/merchant/$guid/)
$wallet $Blockchain->Create->createWithKey($password$privKey$email=null$label=null);

// Example: Send 0.005 BTC to YOUR_ADDRESS (replace), with a 0.0001 BTC fee
$response $wallet->send("YOUR_ADDRESS""0.005"null"0.0001");

p.s: you should probably move this to development & technical (https://bitcointalk.org/index.php?board=6.0), you'd get more programming related responses/assistance there.

thanks for reply, but Blockchain.com api is not good small Payout as they take 0.001 from every payout
hero member
Activity: 1582
Merit: 759
If you want to use PHP, you're either going to have to run a Bitcoind server, or leverage an existing API (for example, Blockchain.info's)

Bitcoind

Using PHP-bitcoinrpc class (https://github.com/denpamusic/php-bitcoinrpc)

Code:
$bitcoind = new BitcoinClient('http://rpcuser:rpcpassword@localhost:8332/');

//add the private key (label, key)
$import bitcoind->importprivkey("SOME_PRIVATE_KEY");

$result $bitcoind->sendToAddress('YOUR_ADDRESS'0.1); // 0.1=amount
$txid $result->get();
?>

Note: I haven't tested this code, so please test

Using an API (Blockchain.com)

Code:

$Blockchain 
= new \Blockchain\Blockchain($api_code);
$Blockchain->setServiceUrl("http://localhost:3000"); // Set to service URL (for example: https://blockchain.info/merchant/$guid/)
$wallet $Blockchain->Create->createWithKey($password$privKey$email=null$label=null);

// Example: Send 0.005 BTC to YOUR_ADDRESS (replace), with a 0.0001 BTC fee
$response $wallet->send("YOUR_ADDRESS""0.005"null"0.0001");
full member
Activity: 634
Merit: 106
Europe Belongs To Christians
hey i want to try a new approach to my project


What i want to do ?
Send BTC from private key to a address

USING PHP or any simple small script

Electrum like solution to send
Jump to: