Author

Topic: Can RawTx be created using PHP ? (Read 827 times)

legendary
Activity: 3388
Merit: 4615
July 25, 2014, 06:07:24 PM
#2
If I have the bitcoin address,

This is not useful.  Bitcoin transactions do not spend from addresses, they spend specific previously unspent outputs.  To identify the previously unspent outputs, you need the transaction ID and the offset (vout) of the particular outputs you are trying to spend. To provide the necessary information to authorize spending the output, you also need to know what the scriptPubKey is for each output.

private key, amount to be sent & the destination address, can i create the raw tx code to be used in https://blockchain.info/pushtx or similar services using PHP ?

If yes, can someone plz point to any sample code ?

Once you have the list of specific outputs and the scriptPubKey of each, then you should be able to use the private keys to generate an appropriate scriptSig for each input.  With the amount sent, and destination address, you should be able to create the necessary outputs.

I'm not sure how to go about this in PHP, but for an example of how it can be accomplished with javascript you can take a look at this page:

https://brainwallet.github.io/#tx
legendary
Activity: 2282
Merit: 1204
The revolution will be digital
July 25, 2014, 01:58:28 PM
#1
If I have the bitcoin address, private key, amount to be sent & the destination address, can i create the raw tx code to be used in https://blockchain.info/pushtx or similar services using PHP ?

If yes, can someone plz point to any sample code ?
Jump to: