CryptoURANUS Economics: Transaction [TX-ID]: Defined in CryptoCurrency


Saturday, August 11, 2018

Transaction [TX-ID]: Defined in CryptoCurrency

Transaction [TX-ID]: Defined in CryptoCurrency

A Transaction ID, or TX ID is defined as a unique string of letters and numbers used to identify an exchange of cryptocurrency between two people.

Because blockchains are public data, many websites have been built to let you explore the data. These are known as blockchain explorers. Using a blockchain explorer, you can copy/paste your transaction ID and easily find the status of your transaction.

Just make sure you’re using a blockchain explorer that has access to your blockchain. Some blockchain explorers only have access to one blockchain, like bitcoin.

Is TXID the hash of a transaction's data? Yes!

A TXID (Transaction ID) is basically an identification number for a bitcoin transaction.


f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16 - First ever Bitcoin transaction to Hal Finney in 2010.

a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d - Pizza transaction for 10,000 BTC in 2010.

4ce18f49ba153a51bcda9bb80d7f978e3de6e81b5fc326f00465464530c052f4 - The transaction containing the first donation I received for making this website.

SO, A TXID is always 32 bytes (64 characters) and hexadecimal.

NOW, this hiw how we create a TXID below:

AND... you get a TXID by hashing transaction data via SHA256 twice.


169e1e83e930853391bc6f35f605c6754cfead57cf8387639d3b4096c54f18f4   (Note: reverse the byte order first if you want to find this transaction in the blockchain...)

What about searching for TXIDs in the blockchain?

If you have just hashed a transaction data and want to search for a TXID in the blockchain, you have to search for it in reverse byte order.

The TXID (original):  169e1e83e930853391bc6f35f605c6754cfead57cf8387639d3b4096c54f18f4

The TXID (searching): f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16

Because, this is cryptocurrency, welcome to Bitcoin.
The tx and block hashes that bitcoin core uses are byte-reversed.

Where are TXIDs used?

1. Searching the blockchain.
If you've just made a transaction, you can use the TXID to find it in the blockchain. For example:

bitcoin-cli getrawtransaction 0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098

The console window in the Bitcoin Core Wallet

The console window in the Bitcoin Core Wallet

If you have been given a TXID by your bitcoin wallet, it's probably already in its "searchable" format (reverse byte order).

2. Spending outputs.
You use a TXID when you want to use an existing output as an input in a new transaction.
To refer to an existing output, you use the txid it was created in, along with the vout number for that transaction.

To refer to an existing output, you use the txid it was created in, along with the vout number for that transaction.

Because after all, a TXID is a unique identifier1 for a transaction.

Why hash twice? Why not once?

Things often get hashed twice in bitcoin for extra security.

Hash functions, like SHA256, for creating identification numbers are fast and secure.

Coinbase transactions having the same TXID.
There has been a situation where two "different" coinbase transactions had the same TXID, because the other is a backup and user-friendly.

Reason is the transaction data is the same along with the TXIDs. Here are the transactions and the blocks they were included in:

block 91,722: 00000000000271a2dc26e7667f8419f2e15416dc6955e5a6c6cdf3f2574dd08e
block 91,880: 00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721

block 91,812: 00000000000af0aed4792b1acee3d966af36cf5def14935db8de83d6f9306f2f
block 91,842: 00000000000a4d0a398161ffc163c503763b1f4360639393e0e4c8e300e0caec

The Bitcoin Administrators made a BiP-34 Fix

BIP 30 introduced a rule preventing blocks from containing a TXID that already exists. BIP 34 requires coinbase transactions to include block height  of mining into the transaction data. Hence, coinbase transactions now are different...

No comments: