<p>The <code>ledger_index</code> 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.</p>

<p>The <code>ledger_hash</code> is the 256-bit hash of the ledger header, which effectively acts as a hash of the entire ledger.</p>

CC BY-SA 3.0
2013-10-29T01:42:31.243Z
2013-10-29T01:42:31.243Z
David Schwartz
<p>In rippled's API, for example in <a href="https://ripple.com/wiki/JSON_Messages#account_info" rel="nofollow"><code>account_info</code></a>, we can see that <code>ledger_hash</code> and <code>ledger_index</code> are different from one another. <a href="https://ripple.com/wiki/JSON_API#ledger" rel="nofollow"><code>ledger_hash</code></a> is just a hash of the ledger. However, <a href="https://ripple.com/wiki/File%3aLedger_entry.png" rel="nofollow">in this graphic</a> we can see that <code>ledger_index</code> also looks like a hash of the ledger. There doesn't appear to be <a href="https://ripple.com/wiki/JSON_API#ledger_index" rel="nofollow">an entry for <code>ledger_index</code></a> in the Wiki, so what is the difference between those two?</p>

<ripple><api><json-rpc><standard><ledger-hardware-wallet>
What is the difference between ledger_hash and ledger_index in Ripple?
ThePiachu
# What is the difference between ledger_hash and ledger_index in Ripple?

(Asked by: username_0 on 2013-10-28)

In rippled's API, for example in [`account_info`](https://ripple.com/wiki/JSON_Messages#account_info), we can see that `ledger_hash` and `ledger_index` are different from one another. [`ledger_hash`](https://ripple.com/wiki/JSON_API#ledger) is just a hash of the ledger. However, [in this graphic](https://ripple.com/wiki/File%3aLedger_entry.png) 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`](https://ripple.com/wiki/JSON_API#ledger_index) in the Wiki, so what is the difference between those two?

**Tags:** ripple, api, json-rpc, standard, ledger-hardware-wallet


---

## 1 answers

### Answer by username_1 on 2013-10-29. Score: 2 | Accepted answer

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.


---

