Bitcoin Forum
September 23, 2019, 10:24:33 AM *
News: If you like a topic and you see an orange "bump" link, click it. More info.
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Best Way to send bitcoin using Privatekey [PHP or SHELL]  (Read 237 times)
bitcoinfuck
Full Member
***
Offline Offline

Activity: 629
Merit: 106


Europe Belongs To Christians


View Profile WWW
December 23, 2018, 04:43:01 PM
 #1

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

Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1569234273
Hero Member
*
Offline Offline

Posts: 1569234273

View Profile Personal Message (Offline)

Ignore
1569234273
Reply with quote  #2

1569234273
Report to moderator
1569234273
Hero Member
*
Offline Offline

Posts: 1569234273

View Profile Personal Message (Offline)

Ignore
1569234273
Reply with quote  #2

1569234273
Report to moderator
Initscri
Hero Member
*****
Offline Offline

Activity: 1106
Merit: 638


KnowNoBorders.io


View Profile WWW
December 24, 2018, 03:31:49 AM
Last edit: December 24, 2018, 01:31:16 PM by Initscri
Merited by OmegaStarScream (3), LoyceV (1)
 #2

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:
<?php
$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:
<?php

$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");

   ▄▄██████▄▄
  ████████████
███▄▄
 ██████████████▀▀▀██▄
████████████████   ▀██▄
████████████████     ▀██
██████████████       ██▌
██████████████        ▐██
██▌▀▀██████▀▀         ▐██
▐██                   ██▌
 ██▄                 ▄██
  ▀██▄             ▄██▀
    ▀██▄▄▄     ▄▄▄██▀
      ▀▀█████████▀▀
MAIN CLUB
PARTNER of
W A T F O R D  FC
Industry Leading Crypto Sportsbook
|
SPECIAL
WATFORD FC
PROMOTIONS
|
UNIQUE
CONTENT &
GIVEAWAYS
|
▄▄█████████▄▄
▄█████████████████▄
▄██████████▀▀▀▀███████▄
▄█████████▀     ████████▄
▄██████████   ████████████▄
█████████        ██████████
█████████▄▄   ▄▄███████████
███████████   █████████████
▀██████████   ████████████▀
▀█████████   ███████████▀
▀████████▄▄▄██████████▀
▀█████████████████▀
▀▀█████████▀▀
.PLAY  HERE.
[/t
bitcoinfuck
Full Member
***
Offline Offline

Activity: 629
Merit: 106


Europe Belongs To Christians


View Profile WWW
December 24, 2018, 12:04:11 PM
 #3

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:
<?php
$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:
<?php

$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

Initscri
Hero Member
*****
Offline Offline

Activity: 1106
Merit: 638


KnowNoBorders.io


View Profile WWW
December 24, 2018, 12:11:25 PM
 #4

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:
<?php
$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:
<?php

$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.

   ▄▄██████▄▄
  ████████████
███▄▄
 ██████████████▀▀▀██▄
████████████████   ▀██▄
████████████████     ▀██
██████████████       ██▌
██████████████        ▐██
██▌▀▀██████▀▀         ▐██
▐██                   ██▌
 ██▄                 ▄██
  ▀██▄             ▄██▀
    ▀██▄▄▄     ▄▄▄██▀
      ▀▀█████████▀▀
MAIN CLUB
PARTNER of
W A T F O R D  FC
Industry Leading Crypto Sportsbook
|
SPECIAL
WATFORD FC
PROMOTIONS
|
UNIQUE
CONTENT &
GIVEAWAYS
|
▄▄█████████▄▄
▄█████████████████▄
▄██████████▀▀▀▀███████▄
▄█████████▀     ████████▄
▄██████████   ████████████▄
█████████        ██████████
█████████▄▄   ▄▄███████████
███████████   █████████████
▀██████████   ████████████▀
▀█████████   ███████████▀
▀████████▄▄▄██████████▀
▀█████████████████▀
▀▀█████████▀▀
.PLAY  HERE.
[/t
darosior
Full Member
***
Offline Offline

Activity: 185
Merit: 209



View Profile WWW
December 24, 2018, 12:16:54 PM
 #5

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 .

LoyceV
Legendary
*
Offline Offline

Activity: 1610
Merit: 4646


Largest Merit Circle on BPIP!


View Profile WWW
December 24, 2018, 01:29:17 PM
 #6

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.

bitcoinfuck
Full Member
***
Offline Offline

Activity: 629
Merit: 106


Europe Belongs To Christians


View Profile WWW
December 25, 2018, 01:49:33 PM
 #7

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

bitcoinfuck
Full Member
***
Offline Offline

Activity: 629
Merit: 106


Europe Belongs To Christians


View Profile WWW
December 25, 2018, 01:51:13 PM
 #8

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:
<?php
$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:
<?php

$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

darosior
Full Member
***
Offline Offline

Activity: 185
Merit: 209



View Profile WWW
December 25, 2018, 07:58:55 PM
 #9

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.

Initscri
Hero Member
*****
Offline Offline

Activity: 1106
Merit: 638


KnowNoBorders.io


View Profile WWW
December 26, 2018, 03:26:26 AM
 #10


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

   ▄▄██████▄▄
  ████████████
███▄▄
 ██████████████▀▀▀██▄
████████████████   ▀██▄
████████████████     ▀██
██████████████       ██▌
██████████████        ▐██
██▌▀▀██████▀▀         ▐██
▐██                   ██▌
 ██▄                 ▄██
  ▀██▄             ▄██▀
    ▀██▄▄▄     ▄▄▄██▀
      ▀▀█████████▀▀
MAIN CLUB
PARTNER of
W A T F O R D  FC
Industry Leading Crypto Sportsbook
|
SPECIAL
WATFORD FC
PROMOTIONS
|
UNIQUE
CONTENT &
GIVEAWAYS
|
▄▄█████████▄▄
▄█████████████████▄
▄██████████▀▀▀▀███████▄
▄█████████▀     ████████▄
▄██████████   ████████████▄
█████████        ██████████
█████████▄▄   ▄▄███████████
███████████   █████████████
▀██████████   ████████████▀
▀█████████   ███████████▀
▀████████▄▄▄██████████▀
▀█████████████████▀
▀▀█████████▀▀
.PLAY  HERE.
[/t
bitcoinfuck
Full Member
***
Offline Offline

Activity: 629
Merit: 106


Europe Belongs To Christians


View Profile WWW
December 26, 2018, 06:04:45 AM
 #11

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.

Initscri
Hero Member
*****
Offline Offline

Activity: 1106
Merit: 638


KnowNoBorders.io


View Profile WWW
December 26, 2018, 07:13:41 PM
 #12

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/

   ▄▄██████▄▄
  ████████████
███▄▄
 ██████████████▀▀▀██▄
████████████████   ▀██▄
████████████████     ▀██
██████████████       ██▌
██████████████        ▐██
██▌▀▀██████▀▀         ▐██
▐██                   ██▌
 ██▄                 ▄██
  ▀██▄             ▄██▀
    ▀██▄▄▄     ▄▄▄██▀
      ▀▀█████████▀▀
MAIN CLUB
PARTNER of
W A T F O R D  FC
Industry Leading Crypto Sportsbook
|
SPECIAL
WATFORD FC
PROMOTIONS
|
UNIQUE
CONTENT &
GIVEAWAYS
|
▄▄█████████▄▄
▄█████████████████▄
▄██████████▀▀▀▀███████▄
▄█████████▀     ████████▄
▄██████████   ████████████▄
█████████        ██████████
█████████▄▄   ▄▄███████████
███████████   █████████████
▀██████████   ████████████▀
▀█████████   ███████████▀
▀████████▄▄▄██████████▀
▀█████████████████▀
▀▀█████████▀▀
.PLAY  HERE.
[/t
bitcoinfuck
Full Member
***
Offline Offline

Activity: 629
Merit: 106


Europe Belongs To Christians


View Profile WWW
December 27, 2018, 07:54:19 AM
 #13

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

Initscri
Hero Member
*****
Offline Offline

Activity: 1106
Merit: 638


KnowNoBorders.io


View Profile WWW
December 28, 2018, 01:22:05 AM
 #14

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,

   ▄▄██████▄▄
  ████████████
███▄▄
 ██████████████▀▀▀██▄
████████████████   ▀██▄
████████████████     ▀██
██████████████       ██▌
██████████████        ▐██
██▌▀▀██████▀▀         ▐██
▐██                   ██▌
 ██▄                 ▄██
  ▀██▄             ▄██▀
    ▀██▄▄▄     ▄▄▄██▀
      ▀▀█████████▀▀
MAIN CLUB
PARTNER of
W A T F O R D  FC
Industry Leading Crypto Sportsbook
|
SPECIAL
WATFORD FC
PROMOTIONS
|
UNIQUE
CONTENT &
GIVEAWAYS
|
▄▄█████████▄▄
▄█████████████████▄
▄██████████▀▀▀▀███████▄
▄█████████▀     ████████▄
▄██████████   ████████████▄
█████████        ██████████
█████████▄▄   ▄▄███████████
███████████   █████████████
▀██████████   ████████████▀
▀█████████   ███████████▀
▀████████▄▄▄██████████▀
▀█████████████████▀
▀▀█████████▀▀
.PLAY  HERE.
[/t
bitcoinfuck
Full Member
***
Offline Offline

Activity: 629
Merit: 106


Europe Belongs To Christians


View Profile WWW
December 28, 2018, 04:18:26 PM
 #15

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

Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!