3

What is the tx id used for and why have it when there is already a payment id or even an integrated_address to identify a specific transaction?

Also how is it calculated? (guessing its a hash of the transaction or sumthin) ....well the tags just answered that lol

4

The 'tx id' is also known as the transaction hash. It is a keccak hash of the transaction data.

This hash is used to uniquely identify the transaction, which is why it's also referred to as the 'tx id'.

The tx id is actually a hash of 3 hashes:

  1. A hash of the 'transaction prefix', which contains information such as the inputs, outputs, and the 'extra' field which contains any payment id associated with the transaction.

  2. A hash of the 'base ringct' data, which includes the encrypted output amounts and the output Pedersen commitments.

  3. A hash of the 'prunable ringct' data, which includes the output amount range proofs and ring signatures for the inputs.

The payment id that you can specify for a transaction is known in advance of creating the transaction. This means you can tell someone to use a certain payment id when sending you a transaction. If a payment is being sent to an integrated address, the payment id is also encrypted so that only the recipient can decrypt it.

The tx id, in contrast, is only determined after you create the transaction. By "create the transaction", I mean select the specific outputs that are going to be spent, choose decoy outputs, and construct the entire transaction payload that is ready to be submitted for mining. You do not have to actually publish or submit your transaction to be mined to determine the tx id.

Since the tx id is simply a hash of the transaction, anyone observing the public blockchain will be aware of the tx id of any transaction on the blockchain.

  • the reason i ask this is because in the cli wallet when inputting 'show_transfers' all your transactions are identified by the tx id and amount instead of something like the payment id or the address/integrated address the monero was sent to. – Studnt Jul 26 '17 at 16:08
  • Note that transactions can have no payment id, and the same payment id can be used for many transactions. Therefore a payment id cannot be relied upon to uniquely identify a transaction. – knaccc Jul 27 '17 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.