You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/learn/fundamentals/stellar-data-structures/ledgers/entries.mdx
+18-12Lines changed: 18 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,76 +6,82 @@ description: "Ledger entries are the durable data structures that make up the St
6
6
---
7
7
8
8
9
-
Data is stored on the ledger as ledger entries, akin to key-value stores. Each key is a `LedgerKey` instance defined in [protocol XDR](https://github.com/stellar/stellar-xdr/blob/v27.0/Stellar-ledger-entries.x#L588). Keys state which object we reference, pointing to `LedgerEntry` values defined in [protocol XDR](https://github.com/stellar/stellar-xdr/blob/v27.0/Stellar-ledger-entries.x#L548). Thus entry instances contain the data stored at that key.
9
+
Data is stored on the ledger as ledger entries, akin to key-value stores. Each key is a `LedgerKey` instance. Keys state which object we reference, pointing to `LedgerEntry` values. Thus entry instances contain the data stored at that key.
10
+
11
+
:::note Internal Design
10
12
11
13
Each `LedgerKey` contains only the fields needed to identify its entry. Those identifying fields also appear in the full entry. For example, an `OfferKey`[contains](https://github.com/stellar/stellar-xdr/blob/v27.0/Stellar-ledger-entries.x#L603-L608) its `sellerID` and `offerID`, while the corresponding `OfferEntry`[contains](https://github.com/stellar/stellar-xdr/blob/v27.0/Stellar-ledger-entries.x#L326-L349) those fields along with the full record of ledger data: `amount`, `price`, [assets](https://github.com/stellar/stellar-xdr/blob/v27.0/Stellar-ledger-entries.x#L55-L67), and more.
12
14
13
-
## 10 Ledger Key Cases
15
+
:::
16
+
17
+
## Entry Types
18
+
19
+
The descriptions below summarize the linked conceptual documentation. The protocol XDR definitions of [`LedgerKey`](https://github.com/stellar/stellar-xdr/blob/v27.0/Stellar-ledger-entries.x#L588-L651) and [`LedgerEntry`](https://github.com/stellar/stellar-xdr/blob/v27.0/Stellar-ledger-entries.x#L548-L586) are the source of truth for the exact fields and types.
14
20
15
-
### Account
21
+
### 1. Account{#account}
16
22
17
23
The `AccountEntry` holistically defines a Stellar account, including its balance, sequence number, thresholds, signers, and flags. Learn more in the [Accounts section](../accounts.mdx).
18
24
19
25
-**Key:** Identified by `AccountID`
20
26
-**Entry:** Full account record including balance, sequence number, thresholds, flags, home domain, and list of signers. Tracks [subentries](../accounts.mdx#subentries) that drive the minimum balance requirement.
21
27
22
-
### Trustline
28
+
### 2. Trustline{#trustline}
23
29
24
30
The `TrustLineEntry` defines a balance line to a non-native asset issued on the network. It is created and updated via [`changeTrustOp`](../../transactions/list-of-operations.mdx#change-trust). Learn more in the [Trustlines section](../accounts.mdx#trustlines).
25
31
26
32
-**Key:**`(AccountID, asset)`
27
33
-**Entry:** Trustline state for a non-native asset. Stores the asset balance, limit, authorization flags, and trading liability counters.
28
34
29
-
### Offer
35
+
### 3. Offer{#offer}
30
36
31
37
The `OfferEntry` represents an offer made on the SDEX order book. Learn more in the [orderbooks DEX section](../../liquidity-on-stellar-sdex-liquidity-pools.mdx#orderbook).
32
38
33
39
-**Key:**`(sellerID, offerID)`
34
40
-**Entry:** A single offer on the DEX. Contains the selling and buying assets, amount, price, and [passive](../../liquidity-on-stellar-sdex-liquidity-pools.mdx#passive-offer) flags.
35
41
36
-
### Account Data
42
+
### 4. Account Data{#account-data}
37
43
38
44
A `DataEntry` stores key-value data entries attached to an account. It is used through the [`manageDataOp`](../../transactions/list-of-operations.mdx#manage-data).
39
45
40
46
-**Key:**`(accountID, dataName)`
41
47
-**Entry:** Arbitrary key-value pair (`DataValue`) attached to an account.
42
48
43
-
### Claimable Balance
49
+
### 5. Claimable Balance{#claimable-balance}
44
50
45
51
The `ClaimableBalanceEntry` tracks a balance that may or may not actively be claimable. Learn more in the [Claimable Balances section](../../../../build/guides/transactions/claimable-balances.mdx).
46
52
47
53
-**Key:**`balanceID`
48
54
-**Entry:** Tracks the asset, amount, claimants, [predicates](../../../../build/guides/transactions/claimable-balances.mdx#other-parameters), and optional flags.
49
55
50
-
### Liquidity Pool
56
+
### 6. Liquidity Pool{#liquidity-pool}
51
57
52
58
The `LiquidityPoolEntry` defines the configuration of a constant-product liquidity pool between two assets. Learn more in the [liquidity pools section](../../liquidity-on-stellar-sdex-liquidity-pools.mdx#liquidity-pools).
53
59
54
60
-**Key:**`liquidityPoolID`
55
61
-**Entry:** Holds pool parameters (two assets, fee rate), reserves, total pool shares, and a pool's trustline count (to prevent entry scanning).
56
62
57
-
### Contract Data
63
+
### 7. Contract Data{#contract-data}
58
64
59
65
`ContractDataEntry` stores a piece of data under a contract-defined key. Learn more in the [Persisting Contract Data section](../../contract-development/storage/persisting-data.mdx#ledger-entries).
60
66
61
67
-**Key:**`(contract, key, durability)`
62
68
-**Entry:** Stores the `SCVal` value associated with that key under the contract. Used for Soroban data storage alongside keys.
63
69
64
-
### Contract Code
70
+
### 8. Contract Code{#contract-code}
65
71
66
72
The `ContractCodeEntry` contains the Wasm bytecode of a Soroban contract. Learn more in the [Smart Contracts Overview section](../../../../build/smart-contracts/overview.mdx).
67
73
68
74
-**Key:**`hash` of the Wasm module.
69
75
-**Entry:** Contains the Wasm bytecode and associated cost inputs to deploy or invoke contracts. [Fee metadata](../../fees-resource-limits-metering.mdx#resource-fee) takes into account component factors like number of instructions, functions, and variables.
70
76
71
-
### Config Setting
77
+
### 9. Config Setting{#config-setting}
72
78
73
79
The `ConfigSettingEntry` holds governed network configuration values for over a dozen rules. Learn more in the [Soroban Settings section](../../../../validators/admin-guide/soroban-settings.mdx).
74
80
75
81
-**Key:**`configSettingID` (index of setting [in list](https://github.com/stellar/stellar-xdr/blob/v27.0/Stellar-contract-config-setting.x#L373-L396))
76
82
-**Entry:** Active value of a network-level parameter (e.g., protocol limits, compute fees, state archival). The whole validator quorum set has to agree on these values.
77
83
78
-
### TTL
84
+
### 10. TTL{#ttl}
79
85
80
86
The `TTLEntry` defines the time-to-live of an associated contract data or code entry. Learn more in the [State archival section](../../contract-development/storage/state-archival.mdx#ttl).
0 commit comments