Bitcoin Forum
May 12, 2024, 12:53:54 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Best Way to send bitcoin using Privatekey [PHP or SHELL]  (Read 293 times)
bitcoinfuck (OP)
Full Member
***
Offline Offline

Activity: 634
Merit: 106


Europe Belongs To Christians


View Profile
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

[/url]
1715475234
Hero Member
*
Offline Offline

Posts: 1715475234

View Profile Personal Message (Offline)

Ignore
1715475234
Reply with quote  #2

1715475234
Report to moderator
The network tries to produce one block per 10 minutes. It does this by automatically adjusting how difficult it is to produce blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715475234
Hero Member
*
Offline Offline

Posts: 1715475234

View Profile Personal Message (Offline)

Ignore
1715475234
Reply with quote  #2

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

Activity: 1554
Merit: 759


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

----------------------------------
Web Developer. PM for details.
----------------------------------
bitcoinfuck (OP)
Full Member
***
Offline Offline

Activity: 634
Merit: 106


Europe Belongs To Christians


View Profile
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

[/url]
Initscri
Hero Member
*****
Offline Offline

Activity: 1554
Merit: 759


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.

----------------------------------
Web Developer. PM for details.
----------------------------------
darosior
Sr. Member
****
Offline Offline

Activity: 279
Merit: 435


View Profile
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: 3304
Merit: 16637


Thick-Skinned Gang Leader and Golden Feather 2021


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 (OP)
Full Member
***
Offline Offline

Activity: 634
Merit: 106


Europe Belongs To Christians


View Profile
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

[/url]
bitcoinfuck (OP)
Full Member
***
Offline Offline

Activity: 634
Merit: 106


Europe Belongs To Christians


View Profile
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

[/url]
darosior
Sr. Member
****
Offline Offline

Activity: 279
Merit: 435


View Profile
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: 1554
Merit: 759


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

----------------------------------
Web Developer. PM for details.
----------------------------------
bitcoinfuck (OP)
Full Member
***
Offline Offline

Activity: 634
Merit: 106


Europe Belongs To Christians


View Profile
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.

[/url]
Initscri
Hero Member
*****
Offline Offline

Activity: 1554
Merit: 759


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/

----------------------------------
Web Developer. PM for details.
----------------------------------
bitcoinfuck (OP)
Full Member
***
Offline Offline

Activity: 634
Merit: 106


Europe Belongs To Christians


View Profile
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

[/url]
Initscri
Hero Member
*****
Offline Offline

Activity: 1554
Merit: 759


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,

----------------------------------
Web Developer. PM for details.
----------------------------------
bitcoinfuck (OP)
Full Member
***
Offline Offline

Activity: 634
Merit: 106


Europe Belongs To Christians


View Profile
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

[/url]
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!