mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 03:35:51 +00:00
Revise hash prefixes table
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user