<p>The transaction ID is calculated by prepending the bytes 0x54, 0x58, 0x4e, 0x00 to the signed transaction and then taking the SHA512Half of this input.</p>
<p>Example for a signed transaction, bytes are represented as hex strings:</p>
<pre><code>txBlob = &quot;120000228000000024000000026140000000017d64b86840000000000013887321032c03bf7001689bebbb90e79c42deb99bf71be31f7460c1ce66a244635417b35a7446304402205ec87865bb0da66d71d0700ee2dfb901b458da4d32f43a51cf22f331273022d9022013dcb672d61eb53d28cd0c4069a0d12c03c70efc304d65b3665d8ba76c3477288114985d8d3734809d8be363675897ae4a711f1be06483144a3031789de7672be61cb3a5d200ecee0b8e462f&quot;
</code></pre>
<p>inserting the prefix yields</p>
<pre><code>txid = SHA512Half(&quot;54584E00120000228000000024000000026140000000017d64b86840000000000013887321032c03bf7001689bebbb90e79c42deb99bf71be31f7460c1ce66a244635417b35a7446304402205ec87865bb0da66d71d0700ee2dfb901b458da4d32f43a51cf22f331273022d9022013dcb672d61eb53d28cd0c4069a0d12c03c70efc304d65b3665d8ba76c3477288114985d8d3734809d8be363675897ae4a711f1be06483144a3031789de7672be61cb3a5d200ecee0b8e462f&quot;)

txid = &quot;7ca5f7064a4054f0f0687431f5bac32798e06e51b51539687140ac6b5e82f9c7&quot;
</code></pre>
<p>SHA512Half is the first 32 bytes of the SHA512 output.</p>
<p>The example transaction above can be found <a href="https://xrpcharts.ripple.com/#/transactions/7CA5F7064A4054F0F0687431F5BAC32798E06E51B51539687140AC6B5E82F9C7" rel="nofollow noreferrer">here</a>:</p>

CC BY-SA 4.0
2018-11-26T09:42:58.200Z
2018-11-26T09:42:58.200Z
2020-06-16T11:10:03.350Z
Thorkil Værge
<p>Given a signed Ripple transaction, how do I calculate the txid?</p>

<ripple><transaction-id>
Ripple: How to calculate transaction ID (TXID)
Thorkil Værge
# Ripple: How to calculate transaction ID (TXID)

(Asked by: username_0 on 2018-11-26)

Given a signed Ripple transaction, how do I calculate the txid?

**Tags:** ripple, transaction-id


---

## 1 answers

### Answer by username_0 on 2018-11-26. Score: 3 | Accepted answer

The transaction ID is calculated by prepending the bytes 0x54, 0x58, 0x4e, 0x00 to the signed transaction and then taking the SHA512Half of this input.
Example for a signed transaction, bytes are represented as hex strings:
txBlob = "120000228000000024000000026140000000017d64b86840000000000013887321032c03bf7001689bebbb90e79c42deb99bf71be31f7460c1ce66a244635417b35a7446304402205ec87865bb0da66d71d0700ee2dfb901b458da4d32f43a51cf22f331273022d9022013dcb672d61eb53d28cd0c4069a0d12c03c70efc304d65b3665d8ba76c3477288114985d8d3734809d8be363675897ae4a711f1be06483144a3031789de7672be61cb3a5d200ecee0b8e462f"

inserting the prefix yields
txid = SHA512Half("54584E00120000228000000024000000026140000000017d64b86840000000000013887321032c03bf7001689bebbb90e79c42deb99bf71be31f7460c1ce66a244635417b35a7446304402205ec87865bb0da66d71d0700ee2dfb901b458da4d32f43a51cf22f331273022d9022013dcb672d61eb53d28cd0c4069a0d12c03c70efc304d65b3665d8ba76c3477288114985d8d3734809d8be363675897ae4a711f1be06483144a3031789de7672be61cb3a5d200ecee0b8e462f")

txid = "7ca5f7064a4054f0f0687431f5bac32798e06e51b51539687140ac6b5e82f9c7"

SHA512Half is the first 32 bytes of the SHA512 output.
The example transaction above can be found here:


---

