From 3a6c7098cae9cf15ac8ec5b192b694b05da49ed0 Mon Sep 17 00:00:00 2001 From: Rome Reginelli Date: Mon, 31 Jan 2022 10:24:08 -0800 Subject: [PATCH] Add source link for ledger object IDs (#1304) --- .../protocol-reference/ledger-data/ledger-object-ids.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/references/protocol-reference/ledger-data/ledger-object-ids.md b/content/references/protocol-reference/ledger-data/ledger-object-ids.md index 0ca9822b44..aafd8b19b5 100644 --- a/content/references/protocol-reference/ledger-data/ledger-object-ids.md +++ b/content/references/protocol-reference/ledger-data/ledger-object-ids.md @@ -6,6 +6,7 @@ labels: - Data Retention --- # Ledger Object IDs +[[Source]](https://github.com/ripple/rippled/blob/master/src/ripple/protocol/impl/Indexes.cpp) Each [object in a ledger's state data](ledger-object-types.html) has a unique ID. The ID is derived by hashing important contents of the object, along with a [namespace identifier](https://github.com/ripple/rippled/blob/master/src/ripple/protocol/LedgerFormats.h#L99). The [ledger object type](ledger-object-types.html) determines which namespace identifier to use and which contents to include in the hash. This ensures every ID is unique. To calculate the hash, `rippled` uses SHA-512 and then truncates the result to the first 256 bits. This algorithm, informally called **SHA-512Half**, provides an output that has comparable security to SHA-256, but runs faster on 64-bit processors.