BitCoinDream (OP)
Legendary
Offline
Activity: 2394
Merit: 1216
The revolution will be digital
|
|
July 15, 2014, 03:23:45 PM |
|
1. Generate a random bitcoin address.
2. Will check it's own address balance and confirmation at some of the existing block explorer service at a certain time interval using API call.
3. When a balance is found on the address with n+ confirmation, it pushes a Tx in network forwarding the balance to a certain address.
4. Make a call to a function amountSent with amount in satoshi and Tx ID as input, i.e. amountSent(amount, txid).
|
|
|
|
grue
Legendary
Offline
Activity: 2058
Merit: 1446
|
|
July 15, 2014, 03:46:04 PM |
|
As in, a script that you can copy paste? probably not. but there's scripts for doing each of the steps you mentioned.
|
|
|
|
AuroraHF
|
|
July 15, 2014, 03:48:44 PM |
|
This would be really simple to create, I'm sure someone with a few months of coding can whip this up quickly using Blockchain's JSON-RPC API.
|
lmao
|
|
|
BitCoinDream (OP)
Legendary
Offline
Activity: 2394
Merit: 1216
The revolution will be digital
|
|
July 15, 2014, 04:10:17 PM |
|
As in, a script that you can copy paste? probably not. but there's scripts for doing each of the steps you mentioned.
Can u please at least point me to the address generation and Tx creation PHP script ? For Tx creation function, the i/p will be address and private key.
|
|
|
|
BitCoinDream (OP)
Legendary
Offline
Activity: 2394
Merit: 1216
The revolution will be digital
|
|
July 15, 2014, 04:16:06 PM |
|
This would be really simple to create, I'm sure someone with a few months of coding can whip this up quickly using Blockchain's JSON-RPC API.
The whole thing can be done using blockchain.info receive API in a single call. But, there are associated problems. Sometimes, when it takes more than 20 minutes to find a block, blockchain.info API takes looooooong time to forward the balance and does not make the callback at all !!! Hence, I'm trying to get rid of the blockchain.info dependency for receival purpose. If the code can be found or I can make it up by adding multiple snippets, it would probably help the community in general to partly move out of blockchain.info dependency for payment receival.
|
|
|
|
ThomasCrowne
Full Member
Offline
Activity: 210
Merit: 100
★☆★ 777Coin - The Exciting Bitco
|
|
July 16, 2014, 06:21:41 AM |
|
As in, a script that you can copy paste? probably not. but there's scripts for doing each of the steps you mentioned.
Can u please at least point me to the address generation and Tx creation PHP script ? For Tx creation function, the i/p will be address and private key. Here ya go https://github.com/mikegogulski/bitcoin-php/blob/master/src/bitcoin.inc#L567
|
|
|
|
deathmare
Newbie
Offline
Activity: 14
Merit: 0
|
|
July 16, 2014, 06:32:35 AM |
|
Yeah, this can be done quickly by daemon's JSON-RPC API nor with command-line interface. Also I prepared something like you want with nodejs and blockchain.info before, not so hard to do in my opinion.
|
|
|
|
BitCoinDream (OP)
Legendary
Offline
Activity: 2394
Merit: 1216
The revolution will be digital
|
|
July 16, 2014, 02:19:53 PM |
|
Thank u for the link. From a quick look, what I understand that it relies on JSON-RPC call to a BitcoinD to generate a new address. I'm not looking for that. I am looking for a PHP code that can generate a Bitcoin address & Private key combination without relying on any external call.
|
|
|
|
deathmare
Newbie
Offline
Activity: 14
Merit: 0
|
|
July 17, 2014, 07:40:22 AM |
|
|
|
|
|
fbueller
|
|
July 17, 2014, 08:01:02 AM |
|
My library borrows some stuff from Mikes (Or else Mikes borrows from an upstream one). https://github.com/Bit-Wasp/bitcoin-lib-php/blob/master/src/BitcoinLib.php#313-328 This function generates a key pair + address. The library doesn't use RPC calls, it's up to you to know what to use it for! You'd need either blockchains API or else some sort of transaction scraper to identify payments your addresses. A scraper gets complicated, since you need to be prepared for reorgs.
|
Bitwasp Developer.
|
|
|
BitCoinDream (OP)
Legendary
Offline
Activity: 2394
Merit: 1216
The revolution will be digital
|
|
July 17, 2014, 10:23:48 AM |
|
Before, I have seen a code by Theymos in Python that can independently generate an address. Moreover, given the fact that Bitcoin-QT is written in C++ and generating address independently, PHP should also be able to do the same. It is about taking a big random no. and doing some cryptographic transformation on it to generate private key and address.
|
|
|
|
BitCoinDream (OP)
Legendary
Offline
Activity: 2394
Merit: 1216
The revolution will be digital
|
|
July 17, 2014, 10:24:27 AM |
|
My library borrows some stuff from Mikes (Or else Mikes borrows from an upstream one). https://github.com/Bit-Wasp/bitcoin-lib-php/blob/master/src/BitcoinLib.php#313-328 This function generates a key pair + address. The library doesn't use RPC calls, it's up to you to know what to use it for! You'd need either blockchains API or else some sort of transaction scraper to identify payments your addresses. A scraper gets complicated, since you need to be prepared for reorgs. In your code, as I can see, to get new private key, the following are being used... \SECcurve::generator_secp256k1() openssl_random_pseudo_bytes(32)
The second is in PHP lib, but is the first one ? If not, then how the first one is invoked ? I'm a little confused !!! And, I'm not relying on a scraper to identify payment. Now, we have, multiple block explorers for bitcoin. We can check any address balance using their API and verify from multiple explorers.
|
|
|
|
|
fbueller
|
|
July 17, 2014, 02:05:28 PM |
|
My library borrows some stuff from Mikes (Or else Mikes borrows from an upstream one). https://github.com/Bit-Wasp/bitcoin-lib-php/blob/master/src/BitcoinLib.php#313-328 This function generates a key pair + address. The library doesn't use RPC calls, it's up to you to know what to use it for! You'd need either blockchains API or else some sort of transaction scraper to identify payments your addresses. A scraper gets complicated, since you need to be prepared for reorgs. In your code, as I can see, to get new private key, the following are being used... \SECcurve::generator_secp256k1() openssl_random_pseudo_bytes(32)
The second is in PHP lib, but is the first one ? If not, then how the first one is invoked ? I'm a little confused !!! And, I'm not relying on a scraper to identify payment. Now, we have, multiple block explorers for bitcoin. We can check any address balance using their API and verify from multiple explorers. Clone the project from Github, or download the zip file: https://github.com/Bit-Wasp/bitcoin-lib-phpYou can use composer ( https://github.com/Bit-Wasp/bitcoin-lib-php/blob/master/README.md#installation) to manage all this. Install, and then include "./vendor/autoload.php" Check the examples folder on how to use it then!
|
Bitwasp Developer.
|
|
|
|