What is the difference between ledger_hash and ledger_index in Ripple?

0

In rippled's API, for example in account_info, we can see that ledger_hash and ledger_index are different from one another. ledger_hash is just a hash of the ledger. However, in this graphic we can see that ledger_index also looks like a hash of the ledger. There doesn't appear to be an entry for ledger_index in the Wiki, so what is the difference between those two?

ThePiachu

Posted 2013-10-28T11:24:35.277

Reputation: 41 594

Answers

2

The ledger_index is the 256-bit index of a particular entry in the ledger. The ledger's state tree is a hash tree of index/value pairs. Each index is a 256-bit hash of some kind of locator. If the entry is, say, an account root node, the index is a hash of the 160-bit account ID. If the entry is, say, a ripple balance node, the index is a hash of the two accounts the balance is between and the currency identifier.

The ledger_hash is the 256-bit hash of the ledger header, which effectively acts as a hash of the entire ledger.

David Schwartz

Posted 2013-10-28T11:24:35.277

Reputation: 46 931