Question

I've been testing/learning the rpc interface for Bitcoind daemon, and using the php library successfully up until now. I am trying to create a new raw transaction, i got a lot of example over internet but i don't know function's params where should be comes from.

example :

$bitcoin = new Bitcoin('myuser','mypwd','127.0.0.1','8332');

 $bitcoin->createrawtransaction(
     array(
        array(
            "txid"=>"aed23bb3ec7e93d69450d7e5ea49d52fcfbef9d380108f2be8fe14ef705fcea5", /where this string comes from or how i have to generate it??
            "vout"=>2 //what is this vout, in this case what means the number 2??
        ),
    ),
    array(
        "1GTDT3hYk4x4wzaa9k38pRsHy9SPJ7qPzT"=>0.006,//destination wallet address and required amount
    ));
  1. where "txid" comes from, or how is it genarated
  2. where vout value have to be comes from.
Was it helpful?

Solution

Look at this description. It's excellent.

(Very) Short version:

  • The input of every transaction is output of an older transaction.
  • txid Is the Transaction ID of a transaction you received (containing at least the value, you want to spend). vout is the index of your address in the original txid.

You can look at some actual transactions here: https://blockchain.info/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top