From 47dd83e3c5a5e56bf600a488a8d564e063648286 Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Mon, 10 Dec 2018 15:32:50 -0800 Subject: [PATCH] Revise hash prefixes table --- .../api-conventions/basic-data-types.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/content/references/rippled-api/api-conventions/basic-data-types.md b/content/references/rippled-api/api-conventions/basic-data-types.md index 4e582b0a02..493b3e8905 100644 --- a/content/references/rippled-api/api-conventions/basic-data-types.md +++ b/content/references/rippled-api/api-conventions/basic-data-types.md @@ -26,18 +26,17 @@ Each closed [Ledger](ledger-data-formats.html) has a [Ledger Index][] and a [Has In many cases, the XRP Ledger prefixes an object's binary data with a 4-byte code before calculating its hash, so that objects of different types have different hashes even if their binary formats are the same. The 4-byte codes are structured as three bytes of ASCII followed by a zero byte. -The following table shows the hash prefixes for some common types of data: +The following table shows the prefixes for some hash types that appear in API requests and responses: -| Object Type | Hash Prefix (Hex) | Hash Prefix (Text) | -|:----------------------------------------------------|:------------------|:---| -| Transaction (Signed) | `0x54584E00` | `TXN\0` | -| Ledger Version (`ledger_hash`) | `0x4C575200` | `LWR\0` | -| [Ledger state tree information](ledger-header.html) | `0x4D4C4E00` | `MLN\0` | -| Transaction (Unsigned, for single-signing) | `0x53545800` | `STX\0` | -| Transaction (Unsigned, for multi-signing) | `0x534D5400` | `SMT\0` | -| Validation vote | `0x56414C00` | `VAL\0` | +| Object Type | Hash Prefix (Hex) | Hash Prefix (Text) | +|:----------------------------------------------------------------------------|:------------------|:--| +| Signed Transaction (`hash` field of transactions) | `0x54584E00` | `TXN\0` | +| Ledger Version (`ledger_hash` fields) | `0x4C575200` | `LWR\0` | +| [Ledger state tree information (`account_state` field)](ledger-header.html) | `0x4D4C4E00` | `MLN\0` | -[Ledger objects IDs](ledger-object-ids.html) are calculated in a similar way, with 16-bit "space key" prefixes for each object type. +**Note:** There are several other hash prefixes which are only used when calculating the hash as the first step of signing a specific type of data. For the complete list, see [the source code](https://github.com/ripple/rippled/blob/master/src/ripple/protocol/impl/HashPrefix.cpp). + +[Ledger objects IDs](ledger-object-ids.html) are calculated in a similar way, but they use a 2-byte prefix called a "space key" instead of a prefix in the form described here. ## Account Sequence