In a previous blog (see also here), I discussed the hash function in more detail. Through the hash function, a transaction is converted into a hash value. Input is converted into output, so to speak. The hash function only works one way. Namely, from input to output. The output is a series of letters and numbers and says nothing about the transaction. You can't trace the output back to the input.
What does TXID stand for?
A TXID is an identification number of a transaction, for example a bitcoin transaction.
What are TXID used for?
Bitcoin and Ethereum, for example, have their own blockchain and the transactions are publicly visible for everyone. The blockchain of bitcoin can be found at blockchain.com and the Ethereum blockchain at Etherscan.com. On these websites, you can see every transactions that took place. Therefore, the blockchain is transparent. But you cannot see the people behind the transaction. In short: you can find the transactions with a TXID. If you send some bitcoin to another person, you can find that specific transaction on the blockchain by means of a TXID.
How are TXIDs created?
The transaction data (input) is hashed twice using the SHA-256. SHA256 is an algorithm to secure the transaction data. The SHA256 basically hashes the transaction data into a string of letters and numbers. To create a transaction ID, you do that twice. Check this website to hash text (input) to a string of numbers and letters (output) yourself!
Note that you cannot go back to the original transaction data (the input) via the hash value. It works one way, namely from input to output. Even if you manage to go back to the transaction data, you actually have to crack two hashes. This is possible in theory, but in practice it takes a lot of time and resources because you have to change all the hashes in between. If you want to crack hash number 200, you have to change all the next hashes too. That is very difficult to achieve in practice.
Why do you have to hash twice for a TXID?
To hash a transaction data twice you provide an extra layer of security.
SHA-256(SHA-256(x)) was proposed by Ferguson and Schneier in their excellent book “Practical Cryptography” (later updated by Ferguson, Schneier, and Kohno and renamed “Cryptography Engineering”) as a way to make SHA-256 invulnerable to “length-extension” attack. They called it “SHA-256d”.
Example of a TXID
a1075db55d416d3ca199f55b6084e2115b9345e16c5cf302fc80e9d5fbf5d48d - a pizza transaction for 10,000 BTC in 2010.
Find another transaction on the bitcoin blockchain here:
https://www.blockchain.com/btc/tx/7821603383d93f5b50e2c952d64852f0bd3ac5e5a9664226d8d3b48630c531a9 Can you find the hash of this transaction?
Reactie plaatsen
Reacties