0

Reading BIP152 I see that the Short Transaction ID is used in the cmpctblock message. Depending on whether the transaction is segwit or non-segwit, WTXID or TXID will be used to calculate its Short Transaction ID. What is not clear to me is whether getblocktxn meesage uses the index of the transaction or this Short Transaction ID?

In the BIP it is written that the getblocktxn message uses the following structure:

enter image description here

Based on that structure, indexes are sent.

However, the note for version 2 says the following:

Short transaction IDs sent to us in cmpctblock messages, and sent by us in getblocktxn messages, are computed using the same process as in version 1, but using the wtxid as defined in BIP 141 instead of the txid.

It is clear to me about cmpctmessages, but it says that the Short Transaction ID is also used in getblocktxn messages?

1 Answer 1

1

This seems to be an erratum in that note in BIP152.

The getblocktxn message contains a BlockTransactionRequests, which contains a list of differentially encoded transaction indices (i.e., the difference between the position a given requested transaction has in the block minus the previous requested transaction's position, minus 1).

3
  • Thanks. About that differentially encoding. Does it mean that if I am sending indexes in cmpctblock or getblocktxn message for 0, 1, 34, 65, 137 and 258 transaction, I will encode it like 0, 0, 32, 34, 71 and 120?
    – Cosmos
    Commented Dec 22, 2023 at 16:09
  • No, as 0, 0, 32, 30, 71, 120. Commented Dec 22, 2023 at 16:16
  • Thanks. I made a mistake while calculating.
    – Cosmos
    Commented Dec 22, 2023 at 16:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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