TransactionId in Blockchain and Bitcoin

537 Views Asked by At

Hello dear all friends,

I am very newbie about Blockchain and Bitcoin. I am struggling to learn from book and example sources.

Do I have to fill in the transactionId value before sending the coin? If so, why? I think transactionId should appear at the end of successful transaction (Maybe I am wrong, I do not know). If I have to declare a transactionId on process time, how do I find the appropriate and correct value?

In specifically for following example, Where did the author who gave the example find this value e44587cf08b4f03b0e8b4ae7562217796ec47b8c91666681d71329b764add2e3 ?

var bitcoinPrivateKey = new BitcoinSecret("cSZjE4aJNPpBtU6xvJ6J4iBzDgTmzTjbq8w2kqnYvAprBCyTsG4x");
var network = bitcoinPrivateKey.Network;


var address = bitcoinPrivateKey.GetAddress();

Console.WriteLine(bitcoinPrivateKey); // cSZjE4aJNPpBtU6xvJ6J4iBzDgTmzTjbq8w2kqnYvAprBCyTsG4x
Console.WriteLine(address); // mzK6Jy5mer3ABBxfHdcxXEChsn3mkv8qJv
Console.WriteLine();

var client = new QBitNinjaClient(network);
var transactionId = uint256.Parse("e44587cf08b4f03b0e8b4ae7562217796ec47b8c91666681d71329b764add2e3");
var transactionResponse = client.GetTransaction(transactionId).Result;

Console.WriteLine(transactionResponse.TransactionId); // e44587cf08b4f03b0e8b4ae7562217796ec47b8c91666681d71329b764add2e3
Console.WriteLine(transactionResponse.Block.Confirmations);
Console.WriteLine();

Thank you very much. Best Regards,

1

There are 1 best solutions below

0
On

The transactionId comes from sending the coin. So sending the coin from Address1 to Address2 will generate a transactionId.

Looking on a testnet block explorer you can see this transaction: https://www.blocktrail.com/tBTC/tx/e44587cf08b4f03b0e8b4ae7562217796ec47b8c91666681d71329b764add2e3 sent coins from muxdaneQGxjcvdX5TMpw3vtAYbb7rmjhZz to mzERr7ZPXC1vThsJ74odTn1fuGvASGpQjz and mzK6Jy5mer3ABBxfHdcxXEChsn3mkv8qJv (this is actually a change address, the main transaction was to mzER...).

I guess this is just a tutorial to demo sending coins and checking transactions.

Might get more help on https://bitcoin.stackexchange.com/.