Last updated

Ledger Header

[Source]

Every ledger version has a unique header that describes the contents. You can look up a ledger's header information with the ledger method. The contents of the ledger header are as follows:

FieldJSON TypeInternal TypeDescription
ledger_indexStringUInt32The ledger index of the ledger. Some API methods display this as a quoted integer; some display it as a native JSON number.
ledger_hashStringHash256The SHA-512Half of this ledger version. This serves as a unique identifier for this ledger and all its contents.
account_hashStringHash256The SHA-512Half of this ledger's state tree information.
close_flagsNumberUInt8A bit-map of flags relating to the closing of this ledger.
close_timeNumberUInt32The approximate time this ledger version closed, as the number of seconds since the Ripple Epoch of 2000-01-01 00:00:00 UTC. This value is rounded based on the close_time_resolution.
close_time_resolutionNumberUint8An integer in the range [2,120] indicating the maximum number of seconds by which the close_time could be rounded.
closedBooleanBooleanIf true, this ledger version is no longer accepting new transactions. (However, unless this ledger version is validated, it might be replaced by a different ledger version with a different set of transactions.)
parent_hashStringHash256The ledger_hash value of the previous ledger version that is the direct predecessor of this one. If there are different versions of the previous ledger index, this indicates from which one the ledger was derived.
total_coinsStringUInt64The total number of drops of XRP owned by accounts in the ledger. This omits XRP that has been destroyed by transaction fees. The actual amount of XRP in circulation is lower because some accounts are "black holes" whose keys are not known by anyone.
transaction_hashStringHash256The SHA-512Half of the transactions included in this ledger.

Ledger Index

A ledger index is a 32-bit unsigned integer used to identify a ledger. The ledger index is sometimes known as the ledger's sequence number. (This is different from an account sequence.) The very first ledger was ledger index 1, and each new ledger has a ledger index that is 1 higher than the ledger index of the ledger immediately before it.

The ledger index indicates the order of the ledgers; the [Hash][] value identifies the exact contents of the ledger. Two ledgers with the same hash are always the same. For validated ledgers, hash values and ledger indexes are equally valid and correlate 1:1. However, this is not true for in-progress ledgers:

  • Two different rippled servers may have different contents for a current ledger with the same ledger index, due to latency in propagating transactions throughout the network.
  • There may be multiple closed ledger versions competing to be validated by consensus. These ledger versions have the same ledger index but different contents (and different hashes). Only one of these closed ledgers can become validated.
  • The current open ledger's hash is not calculated. This is because a current ledger's contents change over time, which would cause its hash to change, even though its ledger index stays the same. The hash of a ledger is only calculated when the ledger is closed.

Close Flags

The ledger has only one flag defined for closeFlags: sLCF_NoConsensusTime (value 1). If this flag is enabled, it means that validators had different close times for the ledger, but built otherwise the same ledger, so they declared consensus while "agreeing to disagree" on the close time. In this case, official close_time value of the ledger is 1 second after that of the parent ledger.

See Also

For ledger basics, see Ledgers.