[{"data":1,"prerenderedAt":3841},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule08\u002Fledger-data-structures":3,"docs-kids-\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule08\u002Fledger-data-structures":3339,"docs-tracks":3340},{"id":4,"title":5,"body":6,"description":3331,"extension":3332,"meta":3333,"navigation":190,"path":3334,"seo":3335,"source":3336,"stem":3337,"__hash__":3338},"docs\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule08\u002Fledger-data-structures.md","Ledger Data Structures",{"type":7,"value":8,"toc":3317},"minimark",[9,13,16,21,25,28,31,34,50,54,62,82,308,313,368,373,381,385,388,393,501,504,509,579,582,587,655,658,662,671,678,961,966,1093,1098,1101,1204,1207,1213,1216,1223,1232,1579,1584,1602,1607,1613,1617,1620,1634,1884,1889,1895,1900,1910,1914,1927,2129,2134,2140,2145,2237,2241,2244,2250,2257,2261,2269,2278,2513,2518,2521,2602,2607,2613,2618,2640,2647,2651,2657,2662,2859,2872,2877,2987,2990,3013,3017,3020,3026,3031,3046,3049,3060,3065,3068,3112,3115,3132,3136,3141,3207,3212,3243,3248,3265,3270,3310,3313],[10,11,5],"h1",{"id":12},"ledger-data-structures",[14,15],"hr",{},[17,18,20],"h2",{"id":19},"introduction","Introduction",[22,23,24],"p",{},"The XRP Ledger's reliability and performance depend on carefully designed data structures. This chapter explores the core classes that represent ledgers, manage their lifecycle, and provide efficient access to historical data.",[22,26,27],{},"The XRPL ledger is the authoritative record of the network's state at a given point in time. It contains all account balances, offers, escrows, and other objects, as well as a record of all transactions included in that ledger.",[22,29,30],{},"Every server always has an open ledger. All received new transactions are applied to the open ledger. The open ledger can't close until consensus is reached on the previous ledger and either there is at least one transaction or the ledger's close time has been reached.",[22,32,33],{},"Understanding these structures is essential for:",[35,36,37,41,44,47],"ul",{},[38,39,40],"li",{},"Working with the codebase effectively",[38,42,43],{},"Debugging ledger-related issues",[38,45,46],{},"Implementing new features that interact with ledger state",[38,48,49],{},"Understanding how consensus and validation work",[17,51,53],{"id":52},"the-ledger-class","The Ledger Class",[22,55,56,57,61],{},"The ",[58,59,60],"code",{},"Ledger"," class is the primary representation of a single ledger instance. It manages both the state (account balances, offers, escrows, etc.) and transaction data for a specific ledger.",[22,63,64,68,69,76,77],{},[65,66,67],"strong",{},"Location:"," ",[70,71,75],"a",{"href":72,"rel":73},"https:\u002F\u002Fgithub.com\u002FXRPLF\u002Frippled\u002Fblob\u002Fdevelop\u002Finclude\u002Fxrpl\u002Fprotocol\u002FLedgerHeader.h",[74],"nofollow","LedgerHeader.h",", ",[70,78,81],{"href":79,"rel":80},"https:\u002F\u002Fgithub.com\u002FXRPLF\u002Frippled\u002Fblob\u002Fdevelop\u002Fsrc\u002Fxrpld\u002Fapp\u002Fledger\u002FLedger.cpp",[74],"Ledger.cpp",[83,84,89],"pre",{"className":85,"code":86,"language":87,"meta":88,"style":88},"language-cpp shiki shiki-themes github-dark-high-contrast","\u002F\u002F Ledger.h (actual source code)\nclass Ledger final : public std::enable_shared_from_this\u003CLedger>,\n                     public DigestAwareReadView,\n                     public TxsRawView\n{\nprivate:\n    \u002F\u002F Ledger metadata (sequence, hashes, close time, etc.)\n    LedgerHeader header_;\n\n    \u002F\u002F State tree (all account states, trust lines, offers, escrows, etc.)\n    SHAMap mutable stateMap_;\n\n    \u002F\u002F Transaction tree (all transactions and their metadata)\n    SHAMap mutable txMap_;\n\n    \u002F\u002F Immutability flag - once true, ledger cannot be modified\n    bool mImmutable;\n\n    \u002F\u002F Protocol rules and enabled amendments for this ledger\n    Rules rules_;\n\n    \u002F\u002F Fee schedule for this ledger\n    Fees fees_;\n\n    \u002F\u002F ... additional private members ...\n};\n","cpp","",[58,90,91,100,138,150,158,164,170,176,185,192,198,210,215,221,231,236,242,251,256,262,271,276,282,291,296,302],{"__ignoreMap":88},[92,93,96],"span",{"class":94,"line":95},"line",1,[92,97,99],{"class":98},"sQrFR","\u002F\u002F Ledger.h (actual source code)\n",[92,101,103,107,111,114,118,121,124,127,130,133,135],{"class":94,"line":102},2,[92,104,106],{"class":105},"sWyjQ","class",[92,108,110],{"class":109},"s_sBn"," Ledger",[92,112,113],{"class":105}," final",[92,115,117],{"class":116},"sMAXC"," : ",[92,119,120],{"class":105},"public",[92,122,123],{"class":109}," std",[92,125,126],{"class":116},"::",[92,128,129],{"class":109},"enable_shared_from_this",[92,131,132],{"class":116},"\u003C",[92,134,60],{"class":109},[92,136,137],{"class":116},">,\n",[92,139,141,144,147],{"class":94,"line":140},3,[92,142,143],{"class":105},"                     public",[92,145,146],{"class":109}," DigestAwareReadView",[92,148,149],{"class":116},",\n",[92,151,153,155],{"class":94,"line":152},4,[92,154,143],{"class":105},[92,156,157],{"class":109}," TxsRawView\n",[92,159,161],{"class":94,"line":160},5,[92,162,163],{"class":116},"{\n",[92,165,167],{"class":94,"line":166},6,[92,168,169],{"class":105},"private:\n",[92,171,173],{"class":94,"line":172},7,[92,174,175],{"class":98},"    \u002F\u002F Ledger metadata (sequence, hashes, close time, etc.)\n",[92,177,179,182],{"class":94,"line":178},8,[92,180,181],{"class":109},"    LedgerHeader",[92,183,184],{"class":116}," header_;\n",[92,186,188],{"class":94,"line":187},9,[92,189,191],{"emptyLinePlaceholder":190},true,"\n",[92,193,195],{"class":94,"line":194},10,[92,196,197],{"class":98},"    \u002F\u002F State tree (all account states, trust lines, offers, escrows, etc.)\n",[92,199,201,204,207],{"class":94,"line":200},11,[92,202,203],{"class":116},"    SHAMap ",[92,205,206],{"class":105},"mutable",[92,208,209],{"class":116}," stateMap_;\n",[92,211,213],{"class":94,"line":212},12,[92,214,191],{"emptyLinePlaceholder":190},[92,216,218],{"class":94,"line":217},13,[92,219,220],{"class":98},"    \u002F\u002F Transaction tree (all transactions and their metadata)\n",[92,222,224,226,228],{"class":94,"line":223},14,[92,225,203],{"class":116},[92,227,206],{"class":105},[92,229,230],{"class":116}," txMap_;\n",[92,232,234],{"class":94,"line":233},15,[92,235,191],{"emptyLinePlaceholder":190},[92,237,239],{"class":94,"line":238},16,[92,240,241],{"class":98},"    \u002F\u002F Immutability flag - once true, ledger cannot be modified\n",[92,243,245,248],{"class":94,"line":244},17,[92,246,247],{"class":105},"    bool",[92,249,250],{"class":116}," mImmutable;\n",[92,252,254],{"class":94,"line":253},18,[92,255,191],{"emptyLinePlaceholder":190},[92,257,259],{"class":94,"line":258},19,[92,260,261],{"class":98},"    \u002F\u002F Protocol rules and enabled amendments for this ledger\n",[92,263,265,268],{"class":94,"line":264},20,[92,266,267],{"class":109},"    Rules",[92,269,270],{"class":116}," rules_;\n",[92,272,274],{"class":94,"line":273},21,[92,275,191],{"emptyLinePlaceholder":190},[92,277,279],{"class":94,"line":278},22,[92,280,281],{"class":98},"    \u002F\u002F Fee schedule for this ledger\n",[92,283,285,288],{"class":94,"line":284},23,[92,286,287],{"class":109},"    Fees",[92,289,290],{"class":116}," fees_;\n",[92,292,294],{"class":94,"line":293},24,[92,295,191],{"emptyLinePlaceholder":190},[92,297,299],{"class":94,"line":298},25,[92,300,301],{"class":98},"    \u002F\u002F ... additional private members ...\n",[92,303,305],{"class":94,"line":304},26,[92,306,307],{"class":116},"};\n",[22,309,310],{},[65,311,312],{},"Key Points:",[35,314,315,337,358],{},[38,316,317,320,321,324,325,328,329,332,333,336],{},[65,318,319],{},"Immutability",": Once ",[58,322,323],{},"mImmutable"," is set to ",[58,326,327],{},"true"," via ",[58,330,331],{},"setImmutable()",", the ledger cannot be modified. Only immutable ledgers can be stored in a ",[58,334,335],{},"LedgerHolder"," or published to the network.",[38,338,339,342,343,346,347,350,351,346,354,357],{},[65,340,341],{},"SHAMaps",": Both ",[58,344,345],{},"stateMap_"," and ",[58,348,349],{},"txMap_"," are Merkle trees. The root hash of each tree is stored in ",[58,352,353],{},"header_.accountHash",[58,355,356],{},"header_.txHash"," respectively.",[38,359,360,363,364,367],{},[65,361,362],{},"Rules",": The ",[58,365,366],{},"rules_"," object determines which amendments are active, affecting how transactions are processed.",[22,369,370],{},[65,371,372],{},"Core Components:",[83,374,379],{"className":375,"code":377,"language":378},[376],"language-text","┌─────────────────────────────────────────────────────────────┐\n│                     LEDGER CLASS                            │\n│                                                             │\n│   ┌─────────────────────────────────────────────────────┐   │\n│   │                 LedgerHeader                        │   │\n│   │   seq, hash, parentHash, accountHash, txHash,       │   │\n│   │   closeTime, closeTimeResolution, closeFlags, ...   │   │\n│   │   drops (total XRP in existence)                    │   │\n│   └─────────────────────────────────────────────────────┘   │\n│                           │                                 │\n│            ┌──────────────┴──────────────┐                  │\n│            ▼                             ▼                  │\n│   ┌────────────────────┐    ┌────────────────────────┐      │\n│   │  stateMap_ (SHAMap)│    │   txMap_ (SHAMap)      │      │\n│   │                    │    │                        │      │\n│   │ • Account roots    │    │ • Transactions         │      │\n│   │ • Trust lines      │    │ • Transaction metadata │      │\n│   │ • Offers           │    │   (results, effects)   │      │\n│   │ • Escrows          │    │                        │      │\n│   │ • AMM, Payment Ch  │    │                        │      │\n│   │ • ...all objects   │    │                        │      │\n│   └────────────────────┘    └────────────────────────┘      │\n│                                                             │\n│   ┌─────────────────────────────────────────────────────┐   │\n│   │                   Rules & Fees                      │   │\n│   │   rules_: Active amendments and protocol rules      │   │\n│   │   fees_: Base fee, reserve requirements             │   │\n│   └─────────────────────────────────────────────────────┘   │\n└─────────────────────────────────────────────────────────────┘\n","text",[58,380,377],{"__ignoreMap":88},[17,382,384],{"id":383},"construction-methods","Construction Methods",[22,386,387],{},"Ledgers can be created in several ways, depending on the source of data:",[22,389,390],{},[65,391,392],{},"1. Genesis Ledger:",[83,394,396],{"className":85,"code":395,"language":87,"meta":88,"style":88},"\u002F\u002F Ledger.cpp - Constructor signature\nLedger::Ledger(\n    create_genesis_t,\n    Config const& config,\n    std::vector\u003Cuint256> const& amendments,\n    Family& family)\n{\n    \u002F\u002F Initialize first ledger with:\n    \u002F\u002F - Sequence 1\n    \u002F\u002F - Initial XRP distribution\n    \u002F\u002F - Genesis account states\n    \u002F\u002F - Activated amendments\n}\n",[58,397,398,403,415,423,434,456,467,471,476,481,486,491,496],{"__ignoreMap":88},[92,399,400],{"class":94,"line":95},[92,401,402],{"class":98},"\u002F\u002F Ledger.cpp - Constructor signature\n",[92,404,405,407,409,412],{"class":94,"line":102},[92,406,60],{"class":109},[92,408,126],{"class":116},[92,410,60],{"class":411},"sj_SG",[92,413,414],{"class":116},"(\n",[92,416,417,421],{"class":94,"line":140},[92,418,420],{"class":419},"sCcAr","    create_genesis_t",[92,422,149],{"class":116},[92,424,425,428,431],{"class":94,"line":152},[92,426,427],{"class":116},"    Config ",[92,429,430],{"class":105},"const&",[92,432,433],{"class":116}," config,\n",[92,435,436,439,442,444,447,450,453],{"class":94,"line":160},[92,437,438],{"class":109},"    std",[92,440,441],{"class":116},"::vector",[92,443,132],{"class":105},[92,445,446],{"class":116},"uint256",[92,448,449],{"class":105},">",[92,451,452],{"class":105}," const&",[92,454,455],{"class":116}," amendments,\n",[92,457,458,461,464],{"class":94,"line":166},[92,459,460],{"class":116},"    Family",[92,462,463],{"class":105},"&",[92,465,466],{"class":116}," family)\n",[92,468,469],{"class":94,"line":172},[92,470,163],{"class":116},[92,472,473],{"class":94,"line":178},[92,474,475],{"class":98},"    \u002F\u002F Initialize first ledger with:\n",[92,477,478],{"class":94,"line":187},[92,479,480],{"class":98},"    \u002F\u002F - Sequence 1\n",[92,482,483],{"class":94,"line":194},[92,484,485],{"class":98},"    \u002F\u002F - Initial XRP distribution\n",[92,487,488],{"class":94,"line":200},[92,489,490],{"class":98},"    \u002F\u002F - Genesis account states\n",[92,492,493],{"class":94,"line":212},[92,494,495],{"class":98},"    \u002F\u002F - Activated amendments\n",[92,497,498],{"class":94,"line":217},[92,499,500],{"class":116},"}\n",[22,502,503],{},"Used to create the very first ledger in a new network.",[22,505,506],{},[65,507,508],{},"2. From Previous Ledger:",[83,510,512],{"className":85,"code":511,"language":87,"meta":88,"style":88},"\u002F\u002F Ledger.cpp - Constructor signature\nLedger::Ledger(\n    Ledger const& prevLedger,\n    NetClock::time_point closeTime)\n{\n    \u002F\u002F Copy and evolve:\n    \u002F\u002F - Increment sequence\n    \u002F\u002F - Set parent hash to previous ledger's hash\n    \u002F\u002F - Apply new close time\n    \u002F\u002F - Inherit state (copy-on-write)\n}\n",[58,513,514,518,528,538,546,550,555,560,565,570,575],{"__ignoreMap":88},[92,515,516],{"class":94,"line":95},[92,517,402],{"class":98},[92,519,520,522,524,526],{"class":94,"line":102},[92,521,60],{"class":109},[92,523,126],{"class":116},[92,525,60],{"class":411},[92,527,414],{"class":116},[92,529,530,533,535],{"class":94,"line":140},[92,531,532],{"class":116},"    Ledger ",[92,534,430],{"class":105},[92,536,537],{"class":116}," prevLedger,\n",[92,539,540,543],{"class":94,"line":152},[92,541,542],{"class":109},"    NetClock",[92,544,545],{"class":116},"::time_point closeTime)\n",[92,547,548],{"class":94,"line":160},[92,549,163],{"class":116},[92,551,552],{"class":94,"line":166},[92,553,554],{"class":98},"    \u002F\u002F Copy and evolve:\n",[92,556,557],{"class":94,"line":172},[92,558,559],{"class":98},"    \u002F\u002F - Increment sequence\n",[92,561,562],{"class":94,"line":178},[92,563,564],{"class":98},"    \u002F\u002F - Set parent hash to previous ledger's hash\n",[92,566,567],{"class":94,"line":187},[92,568,569],{"class":98},"    \u002F\u002F - Apply new close time\n",[92,571,572],{"class":94,"line":194},[92,573,574],{"class":98},"    \u002F\u002F - Inherit state (copy-on-write)\n",[92,576,577],{"class":94,"line":200},[92,578,500],{"class":116},[22,580,581],{},"This is the most common constructor used during consensus to build the next ledger.",[22,583,584],{},[65,585,586],{},"3. From Serialized Data:",[83,588,590],{"className":85,"code":589,"language":87,"meta":88,"style":88},"\u002F\u002F Ledger.cpp - Constructor signature\nLedger::Ledger(\n    LedgerHeader const& info,\n    Config const& config,\n    Family& family)\n{\n    \u002F\u002F Reconstruct from:\n    \u002F\u002F - Persisted header info\n    \u002F\u002F - Load SHAMaps from NodeStore\n}\n",[58,591,592,596,606,616,624,632,636,641,646,651],{"__ignoreMap":88},[92,593,594],{"class":94,"line":95},[92,595,402],{"class":98},[92,597,598,600,602,604],{"class":94,"line":102},[92,599,60],{"class":109},[92,601,126],{"class":116},[92,603,60],{"class":411},[92,605,414],{"class":116},[92,607,608,611,613],{"class":94,"line":140},[92,609,610],{"class":116},"    LedgerHeader ",[92,612,430],{"class":105},[92,614,615],{"class":116}," info,\n",[92,617,618,620,622],{"class":94,"line":152},[92,619,427],{"class":116},[92,621,430],{"class":105},[92,623,433],{"class":116},[92,625,626,628,630],{"class":94,"line":160},[92,627,460],{"class":116},[92,629,463],{"class":105},[92,631,466],{"class":116},[92,633,634],{"class":94,"line":166},[92,635,163],{"class":116},[92,637,638],{"class":94,"line":172},[92,639,640],{"class":98},"    \u002F\u002F Reconstruct from:\n",[92,642,643],{"class":94,"line":178},[92,644,645],{"class":98},"    \u002F\u002F - Persisted header info\n",[92,647,648],{"class":94,"line":187},[92,649,650],{"class":98},"    \u002F\u002F - Load SHAMaps from NodeStore\n",[92,652,653],{"class":94,"line":194},[92,654,500],{"class":116},[22,656,657],{},"Used when loading historical ledgers from the database or acquiring them from peers.",[17,659,661],{"id":660},"ledgerheader-structure","LedgerHeader Structure",[22,663,56,664,667,668],{},[58,665,666],{},"LedgerHeader"," struct contains all the metadata that uniquely identifies a ledger and its state. ",[65,669,670],{},"This is the data that hashes to the ledger's hash.",[22,672,673,68,675],{},[65,674,67],{},[70,676,75],{"href":72,"rel":677},[74],[83,679,681],{"className":85,"code":680,"language":87,"meta":88,"style":88},"\u002F\u002F LedgerHeader.h (actual source code)\nstruct LedgerHeader\n{\n    \u002F\u002F\n    \u002F\u002F For all ledgers\n    \u002F\u002F\n    LedgerIndex seq = 0;                              \u002F\u002F Sequence number\n    NetClock::time_point parentCloseTime = {};         \u002F\u002F When parent closed\n\n    \u002F\u002F\n    \u002F\u002F For closed ledgers\n    \u002F\u002F\n    uint256 hash = beast::zero;                        \u002F\u002F This ledger's hash\n    uint256 txHash = beast::zero;                      \u002F\u002F Transaction tree root\n    uint256 accountHash = beast::zero;                 \u002F\u002F State tree root\n    uint256 parentHash = beast::zero;                  \u002F\u002F Previous ledger's hash\n\n    XRPAmount drops = beast::zero;                     \u002F\u002F Total XRP in existence\n\n    bool mutable validated = false;                    \u002F\u002F Has been validated?\n    bool accepted = false;                             \u002F\u002F Has been accepted?\n\n    int closeFlags = 0;                                \u002F\u002F Flags for ledger close\n    NetClock::duration closeTimeResolution = {};       \u002F\u002F Close time resolution (2-120s)\n    NetClock::time_point closeTime = {};               \u002F\u002F When this ledger closed\n};\n",[58,682,683,688,696,700,705,710,714,734,754,758,762,767,771,790,806,822,838,842,859,863,883,899,903,920,939,957],{"__ignoreMap":88},[92,684,685],{"class":94,"line":95},[92,686,687],{"class":98},"\u002F\u002F LedgerHeader.h (actual source code)\n",[92,689,690,693],{"class":94,"line":102},[92,691,692],{"class":105},"struct",[92,694,695],{"class":109}," LedgerHeader\n",[92,697,698],{"class":94,"line":140},[92,699,163],{"class":116},[92,701,702],{"class":94,"line":152},[92,703,704],{"class":98},"    \u002F\u002F\n",[92,706,707],{"class":94,"line":160},[92,708,709],{"class":98},"    \u002F\u002F For all ledgers\n",[92,711,712],{"class":94,"line":166},[92,713,704],{"class":98},[92,715,716,719,722,725,728,731],{"class":94,"line":172},[92,717,718],{"class":109},"    LedgerIndex",[92,720,721],{"class":116}," seq ",[92,723,724],{"class":105},"=",[92,726,727],{"class":419}," 0",[92,729,730],{"class":116},";",[92,732,733],{"class":98},"                              \u002F\u002F Sequence number\n",[92,735,736,738,740,743,746,748,751],{"class":94,"line":178},[92,737,542],{"class":109},[92,739,126],{"class":116},[92,741,742],{"class":109},"time_point",[92,744,745],{"class":116}," parentCloseTime ",[92,747,724],{"class":105},[92,749,750],{"class":116}," {};",[92,752,753],{"class":98},"         \u002F\u002F When parent closed\n",[92,755,756],{"class":94,"line":187},[92,757,191],{"emptyLinePlaceholder":190},[92,759,760],{"class":94,"line":194},[92,761,704],{"class":98},[92,763,764],{"class":94,"line":200},[92,765,766],{"class":98},"    \u002F\u002F For closed ledgers\n",[92,768,769],{"class":94,"line":212},[92,770,704],{"class":98},[92,772,773,776,779,781,784,787],{"class":94,"line":217},[92,774,775],{"class":109},"    uint256",[92,777,778],{"class":116}," hash ",[92,780,724],{"class":105},[92,782,783],{"class":109}," beast",[92,785,786],{"class":116},"::zero;",[92,788,789],{"class":98},"                        \u002F\u002F This ledger's hash\n",[92,791,792,794,797,799,801,803],{"class":94,"line":223},[92,793,775],{"class":109},[92,795,796],{"class":116}," txHash ",[92,798,724],{"class":105},[92,800,783],{"class":109},[92,802,786],{"class":116},[92,804,805],{"class":98},"                      \u002F\u002F Transaction tree root\n",[92,807,808,810,813,815,817,819],{"class":94,"line":233},[92,809,775],{"class":109},[92,811,812],{"class":116}," accountHash ",[92,814,724],{"class":105},[92,816,783],{"class":109},[92,818,786],{"class":116},[92,820,821],{"class":98},"                 \u002F\u002F State tree root\n",[92,823,824,826,829,831,833,835],{"class":94,"line":238},[92,825,775],{"class":109},[92,827,828],{"class":116}," parentHash ",[92,830,724],{"class":105},[92,832,783],{"class":109},[92,834,786],{"class":116},[92,836,837],{"class":98},"                  \u002F\u002F Previous ledger's hash\n",[92,839,840],{"class":94,"line":244},[92,841,191],{"emptyLinePlaceholder":190},[92,843,844,847,850,852,854,856],{"class":94,"line":253},[92,845,846],{"class":109},"    XRPAmount",[92,848,849],{"class":116}," drops ",[92,851,724],{"class":105},[92,853,783],{"class":109},[92,855,786],{"class":116},[92,857,858],{"class":98},"                     \u002F\u002F Total XRP in existence\n",[92,860,861],{"class":94,"line":258},[92,862,191],{"emptyLinePlaceholder":190},[92,864,865,867,870,873,875,878,880],{"class":94,"line":264},[92,866,247],{"class":105},[92,868,869],{"class":105}," mutable",[92,871,872],{"class":116}," validated ",[92,874,724],{"class":105},[92,876,877],{"class":419}," false",[92,879,730],{"class":116},[92,881,882],{"class":98},"                    \u002F\u002F Has been validated?\n",[92,884,885,887,890,892,894,896],{"class":94,"line":273},[92,886,247],{"class":105},[92,888,889],{"class":116}," accepted ",[92,891,724],{"class":105},[92,893,877],{"class":419},[92,895,730],{"class":116},[92,897,898],{"class":98},"                             \u002F\u002F Has been accepted?\n",[92,900,901],{"class":94,"line":278},[92,902,191],{"emptyLinePlaceholder":190},[92,904,905,908,911,913,915,917],{"class":94,"line":284},[92,906,907],{"class":105},"    int",[92,909,910],{"class":116}," closeFlags ",[92,912,724],{"class":105},[92,914,727],{"class":419},[92,916,730],{"class":116},[92,918,919],{"class":98},"                                \u002F\u002F Flags for ledger close\n",[92,921,922,924,926,929,932,934,936],{"class":94,"line":293},[92,923,542],{"class":109},[92,925,126],{"class":116},[92,927,928],{"class":109},"duration",[92,930,931],{"class":116}," closeTimeResolution ",[92,933,724],{"class":105},[92,935,750],{"class":116},[92,937,938],{"class":98},"       \u002F\u002F Close time resolution (2-120s)\n",[92,940,941,943,945,947,950,952,954],{"class":94,"line":298},[92,942,542],{"class":109},[92,944,126],{"class":116},[92,946,742],{"class":109},[92,948,949],{"class":116}," closeTime ",[92,951,724],{"class":105},[92,953,750],{"class":116},[92,955,956],{"class":98},"               \u002F\u002F When this ledger closed\n",[92,958,959],{"class":94,"line":304},[92,960,307],{"class":116},[22,962,963],{},[65,964,965],{},"Key Header Fields:",[967,968,969,982],"table",{},[970,971,972],"thead",{},[973,974,975,979],"tr",{},[976,977,978],"th",{},"Field",[976,980,981],{},"Purpose",[983,984,985,996,1006,1020,1033,1043,1053,1063,1073,1083],"tbody",{},[973,986,987,993],{},[988,989,990],"td",{},[58,991,992],{},"seq",[988,994,995],{},"Ledger sequence number, incrementing from genesis",[973,997,998,1003],{},[988,999,1000],{},[58,1001,1002],{},"parentHash",[988,1004,1005],{},"Cryptographic link to previous ledger",[973,1007,1008,1013],{},[988,1009,1010],{},[58,1011,1012],{},"accountHash",[988,1014,1015,1016,1019],{},"Root hash of state tree (from ",[58,1017,1018],{},"stateMap_.getHash()",")",[973,1021,1022,1027],{},[988,1023,1024],{},[58,1025,1026],{},"txHash",[988,1028,1029,1030,1019],{},"Root hash of transaction tree (from ",[58,1031,1032],{},"txMap_.getHash()",[973,1034,1035,1040],{},[988,1036,1037],{},[58,1038,1039],{},"drops",[988,1041,1042],{},"Total XRP in existence (decreases as fees are burned)",[973,1044,1045,1050],{},[988,1046,1047],{},[58,1048,1049],{},"closeTime",[988,1051,1052],{},"When this ledger closed (consensus-agreed time)",[973,1054,1055,1060],{},[988,1056,1057],{},[58,1058,1059],{},"parentCloseTime",[988,1061,1062],{},"Parent ledger's close time",[973,1064,1065,1070],{},[988,1066,1067],{},[58,1068,1069],{},"closeTimeResolution",[988,1071,1072],{},"Granularity of close time (2-120 seconds)",[973,1074,1075,1080],{},[988,1076,1077],{},[58,1078,1079],{},"closeFlags",[988,1081,1082],{},"Indicates if close time had consensus",[973,1084,1085,1090],{},[988,1086,1087],{},[58,1088,1089],{},"validated",[988,1091,1092],{},"Set to true once ledger receives quorum validations",[22,1094,1095],{},[65,1096,1097],{},"Header Hashing:",[22,1099,1100],{},"The ledger hash uniquely identifies the ledger and is computed by serializing and hashing the header fields:",[83,1102,1104],{"className":85,"code":1103,"language":87,"meta":88,"style":88},"\u002F\u002F From calculateLedgerHash() - conceptual representation\nLedger Hash = SHA512Half(\n    HashPrefix::ledgerMaster ||  \u002F\u002F Prefix for ledger headers\n    seq ||\n    drops ||\n    parentHash ||\n    txHash ||\n    accountHash ||\n    parentCloseTime ||\n    closeTime ||\n    closeTimeResolution ||\n    closeFlags\n)\n",[58,1105,1106,1111,1123,1137,1145,1152,1159,1166,1173,1180,1187,1194,1199],{"__ignoreMap":88},[92,1107,1108],{"class":94,"line":95},[92,1109,1110],{"class":98},"\u002F\u002F From calculateLedgerHash() - conceptual representation\n",[92,1112,1113,1116,1118,1121],{"class":94,"line":102},[92,1114,1115],{"class":116},"Ledger Hash ",[92,1117,724],{"class":105},[92,1119,1120],{"class":411}," SHA512Half",[92,1122,414],{"class":116},[92,1124,1125,1128,1131,1134],{"class":94,"line":140},[92,1126,1127],{"class":109},"    HashPrefix",[92,1129,1130],{"class":116},"::ledgerMaster ",[92,1132,1133],{"class":105},"||",[92,1135,1136],{"class":98},"  \u002F\u002F Prefix for ledger headers\n",[92,1138,1139,1142],{"class":94,"line":152},[92,1140,1141],{"class":116},"    seq ",[92,1143,1144],{"class":105},"||\n",[92,1146,1147,1150],{"class":94,"line":160},[92,1148,1149],{"class":116},"    drops ",[92,1151,1144],{"class":105},[92,1153,1154,1157],{"class":94,"line":166},[92,1155,1156],{"class":116},"    parentHash ",[92,1158,1144],{"class":105},[92,1160,1161,1164],{"class":94,"line":172},[92,1162,1163],{"class":116},"    txHash ",[92,1165,1144],{"class":105},[92,1167,1168,1171],{"class":94,"line":178},[92,1169,1170],{"class":116},"    accountHash ",[92,1172,1144],{"class":105},[92,1174,1175,1178],{"class":94,"line":187},[92,1176,1177],{"class":116},"    parentCloseTime ",[92,1179,1144],{"class":105},[92,1181,1182,1185],{"class":94,"line":194},[92,1183,1184],{"class":116},"    closeTime ",[92,1186,1144],{"class":105},[92,1188,1189,1192],{"class":94,"line":200},[92,1190,1191],{"class":116},"    closeTimeResolution ",[92,1193,1144],{"class":105},[92,1195,1196],{"class":94,"line":212},[92,1197,1198],{"class":116},"    closeFlags\n",[92,1200,1201],{"class":94,"line":217},[92,1202,1203],{"class":116},")\n",[22,1205,1206],{},"This creates a unique, tamper-evident fingerprint for the entire ledger state. Any change to the state tree, transaction tree, or metadata produces a different hash.",[22,1208,1209,1212],{},[65,1210,1211],{},"Note:"," The \"ledger base\" refers to a query\u002Fresponse that includes the ledger header and may also contain the root node of the state tree. This is used during ledger acquisition from peers.",[17,1214,335],{"id":1215},"ledgerholder",[22,1217,1218,1219,1222],{},"A thread-safe container that holds an immutable ledger. ",[65,1220,1221],{},"Only immutable ledgers can be held"," - this is enforced at runtime.",[22,1224,1225,68,1227],{},[65,1226,67],{},[70,1228,1231],{"href":1229,"rel":1230},"https:\u002F\u002Fgithub.com\u002FXRPLF\u002Frippled\u002Fblob\u002Fdevelop\u002Fsrc\u002Fxrpld\u002Fapp\u002Fledger\u002FLedgerHolder.h",[74],"LedgerHolder.h",[83,1233,1235],{"className":85,"code":1234,"language":87,"meta":88,"style":88},"\u002F\u002F LedgerHolder.h (actual source code)\nclass LedgerHolder : public CountedObject\u003CLedgerHolder>\n{\npublic:\n    \u002F\u002F Update the held ledger (MUST be immutable!)\n    void set(std::shared_ptr\u003CLedger const> ledger)\n    {\n        if (!ledger)\n            LogicError(\"LedgerHolder::set with nullptr\");\n        if (!ledger->isImmutable())  \u002F\u002F Runtime check!\n            LogicError(\"LedgerHolder::set with mutable Ledger\");\n\n        std::lock_guard sl(m_lock);\n        m_heldLedger = std::move(ledger);\n    }\n\n    \u002F\u002F Return the (immutable) held ledger\n    std::shared_ptr\u003CLedger const> get()\n    {\n        std::lock_guard sl(m_lock);\n        return m_heldLedger;\n    }\n\n    \u002F\u002F Check if a ledger is held\n    bool empty()\n    {\n        std::lock_guard sl(m_lock);\n        return m_heldLedger == nullptr;\n    }\n\nprivate:\n    std::mutex m_lock;\n    std::shared_ptr\u003CLedger const> m_heldLedger;\n};\n",[58,1236,1237,1242,1263,1267,1272,1277,1311,1316,1330,1344,1364,1375,1379,1395,1412,1417,1421,1426,1448,1452,1464,1472,1476,1480,1485,1494,1498,1511,1528,1533,1538,1543,1556,1574],{"__ignoreMap":88},[92,1238,1239],{"class":94,"line":95},[92,1240,1241],{"class":98},"\u002F\u002F LedgerHolder.h (actual source code)\n",[92,1243,1244,1246,1249,1251,1253,1256,1258,1260],{"class":94,"line":102},[92,1245,106],{"class":105},[92,1247,1248],{"class":109}," LedgerHolder",[92,1250,117],{"class":116},[92,1252,120],{"class":105},[92,1254,1255],{"class":109}," CountedObject",[92,1257,132],{"class":116},[92,1259,335],{"class":109},[92,1261,1262],{"class":116},">\n",[92,1264,1265],{"class":94,"line":140},[92,1266,163],{"class":116},[92,1268,1269],{"class":94,"line":152},[92,1270,1271],{"class":105},"public:\n",[92,1273,1274],{"class":94,"line":160},[92,1275,1276],{"class":98},"    \u002F\u002F Update the held ledger (MUST be immutable!)\n",[92,1278,1279,1282,1285,1288,1291,1293,1296,1298,1300,1303,1306,1309],{"class":94,"line":166},[92,1280,1281],{"class":105},"    void",[92,1283,1284],{"class":411}," set",[92,1286,1287],{"class":116},"(",[92,1289,1290],{"class":109},"std",[92,1292,126],{"class":116},[92,1294,1295],{"class":109},"shared_ptr",[92,1297,132],{"class":116},[92,1299,60],{"class":109},[92,1301,1302],{"class":105}," const",[92,1304,1305],{"class":116},"> ",[92,1307,1308],{"class":109},"ledger",[92,1310,1203],{"class":116},[92,1312,1313],{"class":94,"line":172},[92,1314,1315],{"class":116},"    {\n",[92,1317,1318,1321,1324,1327],{"class":94,"line":178},[92,1319,1320],{"class":105},"        if",[92,1322,1323],{"class":116}," (",[92,1325,1326],{"class":105},"!",[92,1328,1329],{"class":116},"ledger)\n",[92,1331,1332,1335,1337,1341],{"class":94,"line":187},[92,1333,1334],{"class":411},"            LogicError",[92,1336,1287],{"class":116},[92,1338,1340],{"class":1339},"sTRMh","\"LedgerHolder::set with nullptr\"",[92,1342,1343],{"class":116},");\n",[92,1345,1346,1348,1350,1352,1355,1358,1361],{"class":94,"line":194},[92,1347,1320],{"class":105},[92,1349,1323],{"class":116},[92,1351,1326],{"class":105},[92,1353,1354],{"class":116},"ledger->",[92,1356,1357],{"class":411},"isImmutable",[92,1359,1360],{"class":116},"())",[92,1362,1363],{"class":98},"  \u002F\u002F Runtime check!\n",[92,1365,1366,1368,1370,1373],{"class":94,"line":200},[92,1367,1334],{"class":411},[92,1369,1287],{"class":116},[92,1371,1372],{"class":1339},"\"LedgerHolder::set with mutable Ledger\"",[92,1374,1343],{"class":116},[92,1376,1377],{"class":94,"line":212},[92,1378,191],{"emptyLinePlaceholder":190},[92,1380,1381,1384,1386,1389,1392],{"class":94,"line":217},[92,1382,1383],{"class":109},"        std",[92,1385,126],{"class":116},[92,1387,1388],{"class":109},"lock_guard",[92,1390,1391],{"class":411}," sl",[92,1393,1394],{"class":116},"(m_lock);\n",[92,1396,1397,1400,1402,1404,1406,1409],{"class":94,"line":223},[92,1398,1399],{"class":116},"        m_heldLedger ",[92,1401,724],{"class":105},[92,1403,123],{"class":109},[92,1405,126],{"class":116},[92,1407,1408],{"class":411},"move",[92,1410,1411],{"class":116},"(ledger);\n",[92,1413,1414],{"class":94,"line":233},[92,1415,1416],{"class":116},"    }\n",[92,1418,1419],{"class":94,"line":238},[92,1420,191],{"emptyLinePlaceholder":190},[92,1422,1423],{"class":94,"line":244},[92,1424,1425],{"class":98},"    \u002F\u002F Return the (immutable) held ledger\n",[92,1427,1428,1430,1432,1434,1436,1438,1440,1442,1445],{"class":94,"line":253},[92,1429,438],{"class":109},[92,1431,126],{"class":116},[92,1433,1295],{"class":109},[92,1435,132],{"class":116},[92,1437,60],{"class":109},[92,1439,1302],{"class":105},[92,1441,1305],{"class":116},[92,1443,1444],{"class":411},"get",[92,1446,1447],{"class":116},"()\n",[92,1449,1450],{"class":94,"line":258},[92,1451,1315],{"class":116},[92,1453,1454,1456,1458,1460,1462],{"class":94,"line":264},[92,1455,1383],{"class":109},[92,1457,126],{"class":116},[92,1459,1388],{"class":109},[92,1461,1391],{"class":411},[92,1463,1394],{"class":116},[92,1465,1466,1469],{"class":94,"line":273},[92,1467,1468],{"class":105},"        return",[92,1470,1471],{"class":116}," m_heldLedger;\n",[92,1473,1474],{"class":94,"line":278},[92,1475,1416],{"class":116},[92,1477,1478],{"class":94,"line":284},[92,1479,191],{"emptyLinePlaceholder":190},[92,1481,1482],{"class":94,"line":293},[92,1483,1484],{"class":98},"    \u002F\u002F Check if a ledger is held\n",[92,1486,1487,1489,1492],{"class":94,"line":298},[92,1488,247],{"class":105},[92,1490,1491],{"class":411}," empty",[92,1493,1447],{"class":116},[92,1495,1496],{"class":94,"line":304},[92,1497,1315],{"class":116},[92,1499,1501,1503,1505,1507,1509],{"class":94,"line":1500},27,[92,1502,1383],{"class":109},[92,1504,126],{"class":116},[92,1506,1388],{"class":109},[92,1508,1391],{"class":411},[92,1510,1394],{"class":116},[92,1512,1514,1516,1519,1522,1525],{"class":94,"line":1513},28,[92,1515,1468],{"class":105},[92,1517,1518],{"class":116}," m_heldLedger ",[92,1520,1521],{"class":105},"==",[92,1523,1524],{"class":419}," nullptr",[92,1526,1527],{"class":116},";\n",[92,1529,1531],{"class":94,"line":1530},29,[92,1532,1416],{"class":116},[92,1534,1536],{"class":94,"line":1535},30,[92,1537,191],{"emptyLinePlaceholder":190},[92,1539,1541],{"class":94,"line":1540},31,[92,1542,169],{"class":105},[92,1544,1546,1548,1550,1553],{"class":94,"line":1545},32,[92,1547,438],{"class":109},[92,1549,126],{"class":116},[92,1551,1552],{"class":109},"mutex",[92,1554,1555],{"class":116}," m_lock;\n",[92,1557,1559,1561,1563,1565,1567,1569,1571],{"class":94,"line":1558},33,[92,1560,438],{"class":109},[92,1562,126],{"class":116},[92,1564,1295],{"class":109},[92,1566,132],{"class":116},[92,1568,60],{"class":109},[92,1570,1302],{"class":105},[92,1572,1573],{"class":116},"> m_heldLedger;\n",[92,1575,1577],{"class":94,"line":1576},34,[92,1578,307],{"class":116},[22,1580,1581],{},[65,1582,1583],{},"Why immutability matters:",[35,1585,1586,1589,1592],{},[38,1587,1588],{},"Multiple threads can safely read from an immutable ledger without locks",[38,1590,1591],{},"Once set, the ledger's state never changes, preventing race conditions",[38,1593,1594,1595,76,1598,1601],{},"LedgerMaster uses LedgerHolders to track ",[58,1596,1597],{},"mValidLedger",[58,1599,1600],{},"mClosedLedger",", etc.",[22,1603,1604],{},[65,1605,1606],{},"Usage Pattern:",[83,1608,1611],{"className":1609,"code":1610,"language":378},[376],"┌─────────────────────────────────────────────────────────────┐\n│                    LEDGER HOLDER                            │\n│                                                             │\n│   ┌──────────────┐                                          │\n│   │   Thread 1   │──────┐                                   │\n│   └──────────────┘      │                                   │\n│                         ▼                                   │\n│   ┌──────────────┐    ┌────────────────┐    ┌───────────┐   │\n│   │   Thread 2   │───►│  LedgerHolder  │───►│  Ledger   │   │\n│   └──────────────┘    │   (mutex)      │    │ (const)   │   │\n│                       └────────────────┘    └───────────┘   │\n│                         ▲                                   │\n│   ┌──────────────┐      │                                   │\n│   │   Thread 3   │──────┘                                   │\n│   └──────────────┘                                          │\n│                                                             │\n│   • Multiple readers can access concurrently                │\n│   • Updates are serialized through mutex                    │\n│   • Only immutable ledgers can be held                      │\n└─────────────────────────────────────────────────────────────┘\n",[58,1612,1610],{"__ignoreMap":88},[17,1614,1616],{"id":1615},"ledgerhistory","LedgerHistory",[22,1618,1619],{},"Manages the cache and retrieval of historical ledgers.",[22,1621,1622,68,1624,76,1629],{},[65,1623,67],{},[70,1625,1628],{"href":1626,"rel":1627},"https:\u002F\u002Fgithub.com\u002FXRPLF\u002Frippled\u002Fblob\u002Fdevelop\u002Fsrc\u002Fxrpld\u002Fapp\u002Fledger\u002FLedgerHistory.h",[74],"LedgerHistory.h",[70,1630,1633],{"href":1631,"rel":1632},"https:\u002F\u002Fgithub.com\u002FXRPLF\u002Frippled\u002Fblob\u002Fdevelop\u002Fsrc\u002Fxrpld\u002Fapp\u002Fledger\u002FLedgerHistory.cpp",[74],"LedgerHistory.cpp",[83,1635,1637],{"className":85,"code":1636,"language":87,"meta":88,"style":88},"\u002F\u002F LedgerHistory.h (simplified from actual source)\nclass LedgerHistory {\n    \u002F\u002F Cache: hash → ledger\n    TaggedCache\u003Cuint256, Ledger const> m_ledgers_by_hash;\n\n    \u002F\u002F Index: sequence → hash\n    std::map\u003CLedgerIndex, uint256> mLedgersByIndex;\n\npublic:\n    \u002F\u002F Insert ledger into cache\n    void insert(\n        std::shared_ptr\u003CLedger const> const& ledger,\n        bool validated);\n\n    \u002F\u002F Retrieve by sequence\n    std::shared_ptr\u003CLedger const> getLedgerBySeq(\n        LedgerIndex ledgerIndex);\n\n    \u002F\u002F Retrieve by hash\n    std::shared_ptr\u003CLedger const> getLedgerByHash(\n        LedgerHash const& ledgerHash);\n\n    \u002F\u002F Fix index mapping\n    void fixIndex(\n        LedgerIndex ledgerIndex,\n        LedgerHash const& ledgerHash);\n};\n",[58,1638,1639,1644,1654,1659,1677,1681,1686,1707,1711,1715,1720,1729,1752,1762,1766,1771,1792,1802,1806,1811,1832,1844,1848,1853,1862,1870,1880],{"__ignoreMap":88},[92,1640,1641],{"class":94,"line":95},[92,1642,1643],{"class":98},"\u002F\u002F LedgerHistory.h (simplified from actual source)\n",[92,1645,1646,1648,1651],{"class":94,"line":102},[92,1647,106],{"class":105},[92,1649,1650],{"class":109}," LedgerHistory",[92,1652,1653],{"class":116}," {\n",[92,1655,1656],{"class":94,"line":140},[92,1657,1658],{"class":98},"    \u002F\u002F Cache: hash → ledger\n",[92,1660,1661,1664,1666,1668,1670,1672,1674],{"class":94,"line":152},[92,1662,1663],{"class":109},"    TaggedCache",[92,1665,132],{"class":116},[92,1667,446],{"class":109},[92,1669,76],{"class":116},[92,1671,60],{"class":109},[92,1673,1302],{"class":105},[92,1675,1676],{"class":116},"> m_ledgers_by_hash;\n",[92,1678,1679],{"class":94,"line":160},[92,1680,191],{"emptyLinePlaceholder":190},[92,1682,1683],{"class":94,"line":166},[92,1684,1685],{"class":98},"    \u002F\u002F Index: sequence → hash\n",[92,1687,1688,1690,1692,1695,1697,1700,1702,1704],{"class":94,"line":172},[92,1689,438],{"class":109},[92,1691,126],{"class":116},[92,1693,1694],{"class":109},"map",[92,1696,132],{"class":116},[92,1698,1699],{"class":109},"LedgerIndex",[92,1701,76],{"class":116},[92,1703,446],{"class":109},[92,1705,1706],{"class":116},"> mLedgersByIndex;\n",[92,1708,1709],{"class":94,"line":178},[92,1710,191],{"emptyLinePlaceholder":190},[92,1712,1713],{"class":94,"line":187},[92,1714,1271],{"class":105},[92,1716,1717],{"class":94,"line":194},[92,1718,1719],{"class":98},"    \u002F\u002F Insert ledger into cache\n",[92,1721,1722,1724,1727],{"class":94,"line":200},[92,1723,1281],{"class":105},[92,1725,1726],{"class":411}," insert",[92,1728,414],{"class":116},[92,1730,1731,1733,1735,1737,1739,1741,1743,1745,1747,1750],{"class":94,"line":212},[92,1732,1383],{"class":109},[92,1734,126],{"class":116},[92,1736,1295],{"class":109},[92,1738,132],{"class":116},[92,1740,60],{"class":109},[92,1742,1302],{"class":105},[92,1744,1305],{"class":116},[92,1746,430],{"class":105},[92,1748,1749],{"class":109}," ledger",[92,1751,149],{"class":116},[92,1753,1754,1757,1760],{"class":94,"line":217},[92,1755,1756],{"class":105},"        bool",[92,1758,1759],{"class":109}," validated",[92,1761,1343],{"class":116},[92,1763,1764],{"class":94,"line":223},[92,1765,191],{"emptyLinePlaceholder":190},[92,1767,1768],{"class":94,"line":233},[92,1769,1770],{"class":98},"    \u002F\u002F Retrieve by sequence\n",[92,1772,1773,1775,1777,1779,1781,1783,1785,1787,1790],{"class":94,"line":238},[92,1774,438],{"class":109},[92,1776,126],{"class":116},[92,1778,1295],{"class":109},[92,1780,132],{"class":116},[92,1782,60],{"class":109},[92,1784,1302],{"class":105},[92,1786,1305],{"class":116},[92,1788,1789],{"class":411},"getLedgerBySeq",[92,1791,414],{"class":116},[92,1793,1794,1797,1800],{"class":94,"line":244},[92,1795,1796],{"class":109},"        LedgerIndex",[92,1798,1799],{"class":109}," ledgerIndex",[92,1801,1343],{"class":116},[92,1803,1804],{"class":94,"line":253},[92,1805,191],{"emptyLinePlaceholder":190},[92,1807,1808],{"class":94,"line":258},[92,1809,1810],{"class":98},"    \u002F\u002F Retrieve by hash\n",[92,1812,1813,1815,1817,1819,1821,1823,1825,1827,1830],{"class":94,"line":264},[92,1814,438],{"class":109},[92,1816,126],{"class":116},[92,1818,1295],{"class":109},[92,1820,132],{"class":116},[92,1822,60],{"class":109},[92,1824,1302],{"class":105},[92,1826,1305],{"class":116},[92,1828,1829],{"class":411},"getLedgerByHash",[92,1831,414],{"class":116},[92,1833,1834,1837,1839,1842],{"class":94,"line":273},[92,1835,1836],{"class":109},"        LedgerHash",[92,1838,452],{"class":105},[92,1840,1841],{"class":109}," ledgerHash",[92,1843,1343],{"class":116},[92,1845,1846],{"class":94,"line":278},[92,1847,191],{"emptyLinePlaceholder":190},[92,1849,1850],{"class":94,"line":284},[92,1851,1852],{"class":98},"    \u002F\u002F Fix index mapping\n",[92,1854,1855,1857,1860],{"class":94,"line":293},[92,1856,1281],{"class":105},[92,1858,1859],{"class":411}," fixIndex",[92,1861,414],{"class":116},[92,1863,1864,1866,1868],{"class":94,"line":298},[92,1865,1796],{"class":109},[92,1867,1799],{"class":109},[92,1869,149],{"class":116},[92,1871,1872,1874,1876,1878],{"class":94,"line":304},[92,1873,1836],{"class":109},[92,1875,452],{"class":105},[92,1877,1841],{"class":109},[92,1879,1343],{"class":116},[92,1881,1882],{"class":94,"line":1500},[92,1883,307],{"class":116},[22,1885,1886],{},[65,1887,1888],{},"Cache Organization:",[83,1890,1893],{"className":1891,"code":1892,"language":378},[376],"┌─────────────────────────────────────────────────────────────┐\n│                   LEDGER HISTORY                            │\n│                                                             │\n│   ┌─────────────────────────────────────────────────────┐   │\n│   │              m_ledgers_by_hash                      │   │\n│   │         (TaggedCache\u003Cuint256, Ledger>)              │   │\n│   │                                                     │   │\n│   │   Hash A ────────► Ledger Object                    │   │\n│   │   Hash B ────────► Ledger Object                    │   │\n│   │   Hash C ────────► Ledger Object                    │   │\n│   │   ...                                               │   │\n│   └─────────────────────────────────────────────────────┘   │\n│                                                             │\n│   ┌─────────────────────────────────────────────────────┐   │\n│   │              mLedgersByIndex                        │   │\n│   │          (map\u003CLedgerIndex, uint256>)                │   │\n│   │                                                     │   │\n│   │   Seq 100 ────────► Hash A                          │   │\n│   │   Seq 101 ────────► Hash B                          │   │\n│   │   Seq 102 ────────► Hash C                          │   │\n│   │   ...                                               │   │\n│   └─────────────────────────────────────────────────────┘   │\n│                                                             │\n│   Lookup by seq:  seq → hash → ledger                       │\n│   Lookup by hash: hash → ledger                             │\n└─────────────────────────────────────────────────────────────┘\n",[58,1894,1892],{"__ignoreMap":88},[22,1896,1897],{},[65,1898,1899],{},"Key Operations:",[22,1901,56,1902,1905,1906,1909],{},[58,1903,1904],{},"insert()"," method (from LedgerHistory.cpp) adds ledgers to both caches and ensures the index-to-hash mapping is correct. The ",[58,1907,1908],{},"fixIndex()"," method is used to correct any inconsistencies in the index mapping that may occur during acquisition.",[17,1911,1913],{"id":1912},"immutability-enforcement","Immutability Enforcement",[22,1915,1916,1919,1920,1923,1924,1926],{},[65,1917,1918],{},"Once a ledger is finalized, it can never be changed."," This is enforced both at compile time (via ",[58,1921,1922],{},"const"," correctness) and runtime (via the ",[58,1925,323],{}," flag).",[83,1928,1930],{"className":85,"code":1929,"language":87,"meta":88,"style":88},"void Ledger::setImmutable(bool rehash)\n{\n    \u002F\u002F Force update of SHAMap root hashes\n    if (!mImmutable && rehash)\n    {\n        \u002F\u002F Get final root hashes from SHAMaps\n        header_.txHash = txMap_.getHash().as_uint256();\n        header_.accountHash = stateMap_.getHash().as_uint256();\n    }\n\n    \u002F\u002F Calculate final ledger hash from header\n    if (rehash)\n        header_.hash = calculateLedgerHash(header_);\n\n    \u002F\u002F Lock down everything - no more modifications allowed\n    mImmutable = true;\n    txMap_.setImmutable();    \u002F\u002F SHAMap becomes read-only\n    stateMap_.setImmutable(); \u002F\u002F SHAMap becomes read-only\n\n    \u002F\u002F Validate fee object exists (unless very early ledger)\n    setup();\n}\n",[58,1931,1932,1954,1958,1963,1981,1985,1990,2012,2030,2034,2038,2043,2050,2063,2067,2072,2084,2097,2109,2113,2118,2125],{"__ignoreMap":88},[92,1933,1934,1937,1939,1941,1944,1946,1949,1952],{"class":94,"line":95},[92,1935,1936],{"class":105},"void",[92,1938,110],{"class":109},[92,1940,126],{"class":116},[92,1942,1943],{"class":411},"setImmutable",[92,1945,1287],{"class":116},[92,1947,1948],{"class":105},"bool",[92,1950,1951],{"class":109}," rehash",[92,1953,1203],{"class":116},[92,1955,1956],{"class":94,"line":102},[92,1957,163],{"class":116},[92,1959,1960],{"class":94,"line":140},[92,1961,1962],{"class":98},"    \u002F\u002F Force update of SHAMap root hashes\n",[92,1964,1965,1968,1970,1972,1975,1978],{"class":94,"line":152},[92,1966,1967],{"class":105},"    if",[92,1969,1323],{"class":116},[92,1971,1326],{"class":105},[92,1973,1974],{"class":116},"mImmutable ",[92,1976,1977],{"class":105},"&&",[92,1979,1980],{"class":116}," rehash)\n",[92,1982,1983],{"class":94,"line":160},[92,1984,1315],{"class":116},[92,1986,1987],{"class":94,"line":166},[92,1988,1989],{"class":98},"        \u002F\u002F Get final root hashes from SHAMaps\n",[92,1991,1992,1995,1997,2000,2003,2006,2009],{"class":94,"line":172},[92,1993,1994],{"class":116},"        header_.txHash ",[92,1996,724],{"class":105},[92,1998,1999],{"class":116}," txMap_.",[92,2001,2002],{"class":411},"getHash",[92,2004,2005],{"class":116},"().",[92,2007,2008],{"class":411},"as_uint256",[92,2010,2011],{"class":116},"();\n",[92,2013,2014,2017,2019,2022,2024,2026,2028],{"class":94,"line":178},[92,2015,2016],{"class":116},"        header_.accountHash ",[92,2018,724],{"class":105},[92,2020,2021],{"class":116}," stateMap_.",[92,2023,2002],{"class":411},[92,2025,2005],{"class":116},[92,2027,2008],{"class":411},[92,2029,2011],{"class":116},[92,2031,2032],{"class":94,"line":187},[92,2033,1416],{"class":116},[92,2035,2036],{"class":94,"line":194},[92,2037,191],{"emptyLinePlaceholder":190},[92,2039,2040],{"class":94,"line":200},[92,2041,2042],{"class":98},"    \u002F\u002F Calculate final ledger hash from header\n",[92,2044,2045,2047],{"class":94,"line":212},[92,2046,1967],{"class":105},[92,2048,2049],{"class":116}," (rehash)\n",[92,2051,2052,2055,2057,2060],{"class":94,"line":217},[92,2053,2054],{"class":116},"        header_.hash ",[92,2056,724],{"class":105},[92,2058,2059],{"class":411}," calculateLedgerHash",[92,2061,2062],{"class":116},"(header_);\n",[92,2064,2065],{"class":94,"line":223},[92,2066,191],{"emptyLinePlaceholder":190},[92,2068,2069],{"class":94,"line":233},[92,2070,2071],{"class":98},"    \u002F\u002F Lock down everything - no more modifications allowed\n",[92,2073,2074,2077,2079,2082],{"class":94,"line":238},[92,2075,2076],{"class":116},"    mImmutable ",[92,2078,724],{"class":105},[92,2080,2081],{"class":419}," true",[92,2083,1527],{"class":116},[92,2085,2086,2089,2091,2094],{"class":94,"line":244},[92,2087,2088],{"class":116},"    txMap_.",[92,2090,1943],{"class":411},[92,2092,2093],{"class":116},"();",[92,2095,2096],{"class":98},"    \u002F\u002F SHAMap becomes read-only\n",[92,2098,2099,2102,2104,2106],{"class":94,"line":253},[92,2100,2101],{"class":116},"    stateMap_.",[92,2103,1943],{"class":411},[92,2105,2093],{"class":116},[92,2107,2108],{"class":98}," \u002F\u002F SHAMap becomes read-only\n",[92,2110,2111],{"class":94,"line":258},[92,2112,191],{"emptyLinePlaceholder":190},[92,2114,2115],{"class":94,"line":264},[92,2116,2117],{"class":98},"    \u002F\u002F Validate fee object exists (unless very early ledger)\n",[92,2119,2120,2123],{"class":94,"line":273},[92,2121,2122],{"class":411},"    setup",[92,2124,2011],{"class":116},[92,2126,2127],{"class":94,"line":278},[92,2128,500],{"class":116},[22,2130,2131],{},[65,2132,2133],{},"Immutability Lifecycle:",[83,2135,2138],{"className":2136,"code":2137,"language":378},[376],"┌─────────────────────────────────────────────────────────────┐\n│ LEDGER MUTABILITY LIFECYCLE                                 │\n│                                                             │\n│  1. Construction → MUTABLE                                  │\n│     • Ledger(prevLedger, closeTime)                         │\n│     • Can modify state, add transactions                    │\n│     • NOT safe for concurrent access                        │\n│                                                             │\n│  2. Build & Consensus → STILL MUTABLE                       │\n│     • Apply transactions to state                           │\n│     • Flush dirty SHAMap nodes to database                  │\n│     • Calculate final hashes                                │\n│                                                             │\n│  3. setImmutable() called → IMMUTABLE                       │\n│     • Header hashes locked in                               │\n│     • SHAMaps become read-only                              │\n│     • Safe for concurrent reads                             │\n│     • Can be stored in LedgerHolder                         │\n│                                                             │\n│  4. Validation → VALIDATED                                  │\n│     • header_.validated = true                              │\n│     • Received quorum of trusted validations                │\n│     • Now part of canonical ledger history                  │\n└─────────────────────────────────────────────────────────────┘\n",[58,2139,2137],{"__ignoreMap":88},[22,2141,2142],{},[65,2143,2144],{},"Immutability Rules:",[967,2146,2147,2160],{},[970,2148,2149],{},[973,2150,2151,2154,2157],{},[976,2152,2153],{},"Operation",[976,2155,2156],{},"Mutable Ledger",[976,2158,2159],{},"Immutable Ledger",[983,2161,2162,2179,2188,2201,2210,2222],{},[973,2163,2164,2173,2176],{},[988,2165,2166,2167,76,2170,1019],{},"Modify state (",[58,2168,2169],{},"rawInsert",[58,2171,2172],{},"rawReplace",[988,2174,2175],{},"✅ Allowed",[988,2177,2178],{},"❌ Forbidden",[973,2180,2181,2184,2186],{},[988,2182,2183],{},"Add transactions",[988,2185,2175],{},[988,2187,2178],{},[973,2189,2190,2195,2198],{},[988,2191,2192,2193],{},"Store in ",[58,2194,335],{},[988,2196,2197],{},"❌ Runtime error",[988,2199,2200],{},"✅ Required",[973,2202,2203,2206,2208],{},[988,2204,2205],{},"Publish to network",[988,2207,2178],{},[988,2209,2200],{},[973,2211,2212,2217,2220],{},[988,2213,2214,2215],{},"Cache in ",[58,2216,1616],{},[988,2218,2219],{},"❌ Not typical",[988,2221,2175],{},[973,2223,2224,2233,2235],{},[988,2225,2226,2227,76,2230,1019],{},"Read operations (",[58,2228,2229],{},"read",[58,2231,2232],{},"peek",[988,2234,2175],{},[988,2236,2175],{},[17,2238,2240],{"id":2239},"shamap-integration","SHAMap Integration",[22,2242,2243],{},"Ledgers use SHAMaps for state and transaction storage. The SHAMap is a Merkle-Patricia trie covered in detail in later modules. Here we focus on how the Ledger class interacts with it:",[83,2245,2248],{"className":2246,"code":2247,"language":378},[376],"┌─────────────────────────────────────────────────────────────┐\n│                  SHAMAP INTEGRATION                         │\n│                                                             │\n│   Ledger                                                    │\n│   ┌─────────────────────────────────────────────────────┐   │\n│   │                                                     │   │\n│   │   stateMap_ (SHAMap)                                │   │\n│   │   ┌───────────────────────────────────────────┐     │   │\n│   │   │              Root Hash                    │     │   │\n│   │   │             \u002F    |    \\                   │     │   │\n│   │   │        [Inner] [Inner] [Inner]            │     │   │\n│   │   │           |       |       |               │     │   │\n│   │   │        [Leaf]  [Leaf]  [Leaf]             │     │   │\n│   │   │      AccountNode AccountNode ...          │     │   │\n│   │   └───────────────────────────────────────────┘     │   │\n│   │                                                     │   │\n│   │   txMap_ (SHAMap)                                   │   │\n│   │   ┌───────────────────────────────────────────┐     │   │\n│   │   │              Root Hash                    │     │   │\n│   │   │             \u002F    |    \\                   │     │   │\n│   │   │        [Inner] [Inner] [Inner]            │     │   │\n│   │   │           |       |       |               │     │   │\n│   │   │        [Leaf]  [Leaf]  [Leaf]             │     │   │\n│   │   │       TxNode  TxNode  TxNode              │     │   │\n│   │   └───────────────────────────────────────────┘     │   │\n│   │                                                     │   │\n│   └─────────────────────────────────────────────────────┘   │\n│                                                             │\n│   accountHash = stateMap_.getHash()                         │\n│   txHash = txMap_.getHash()                                 │\n└─────────────────────────────────────────────────────────────┘\n",[58,2249,2247],{"__ignoreMap":88},[22,2251,2252,2253,2256],{},"When ",[58,2254,2255],{},"setImmutable(true)"," is called, the final root hashes are retrieved from the SHAMaps and stored in the LedgerHeader.",[17,2258,2260],{"id":2259},"the-rules-class","The Rules Class",[22,2262,56,2263,2265,2266],{},[58,2264,362],{}," class encapsulates which amendments (protocol upgrades) are enabled for a specific ledger. ",[65,2267,2268],{},"All nodes must agree on which amendments are active for deterministic transaction processing.",[22,2270,2271,68,2273],{},[65,2272,67],{},[70,2274,2277],{"href":2275,"rel":2276},"https:\u002F\u002Fgithub.com\u002FXRPLF\u002Frippled\u002Fblob\u002Fdevelop\u002Finclude\u002Fxrpl\u002Fprotocol\u002FRules.h",[74],"Rules.h",[83,2279,2281],{"className":85,"code":2280,"language":87,"meta":88,"style":88},"\u002F\u002F Rules.h (actual source code - uses pimpl idiom)\nclass Rules\n{\nprivate:\n    class Impl;  \u002F\u002F Implementation hidden in .cpp file\n\n    \u002F\u002F Shared pointer makes Rules cheap to copy\n    std::shared_ptr\u003CImpl const> impl_;\n\npublic:\n    \u002F\u002F Construct rules from a set of enabled amendment IDs\n    explicit Rules(std::unordered_set\u003Cuint256, beast::uhash\u003C>> const& presets);\n\n    \u002F\u002F Check if a specific amendment is enabled\n    bool enabled(uint256 const& feature) const;\n\n    \u002F\u002F Rules are cheap to copy due to shared_ptr\n    Rules(Rules const&) = default;\n    Rules& operator=(Rules const&) = default;\n\n    \u002F\u002F Compare two rule sets\n    bool operator==(Rules const&) const;\n};\n",[58,2282,2283,2288,2295,2299,2303,2314,2318,2323,2341,2345,2349,2354,2395,2399,2404,2427,2431,2436,2455,2480,2484,2489,2509],{"__ignoreMap":88},[92,2284,2285],{"class":94,"line":95},[92,2286,2287],{"class":98},"\u002F\u002F Rules.h (actual source code - uses pimpl idiom)\n",[92,2289,2290,2292],{"class":94,"line":102},[92,2291,106],{"class":105},[92,2293,2294],{"class":109}," Rules\n",[92,2296,2297],{"class":94,"line":140},[92,2298,163],{"class":116},[92,2300,2301],{"class":94,"line":152},[92,2302,169],{"class":105},[92,2304,2305,2308,2311],{"class":94,"line":160},[92,2306,2307],{"class":105},"    class",[92,2309,2310],{"class":116}," Impl;",[92,2312,2313],{"class":98},"  \u002F\u002F Implementation hidden in .cpp file\n",[92,2315,2316],{"class":94,"line":166},[92,2317,191],{"emptyLinePlaceholder":190},[92,2319,2320],{"class":94,"line":172},[92,2321,2322],{"class":98},"    \u002F\u002F Shared pointer makes Rules cheap to copy\n",[92,2324,2325,2327,2329,2331,2333,2336,2338],{"class":94,"line":178},[92,2326,438],{"class":109},[92,2328,126],{"class":116},[92,2330,1295],{"class":109},[92,2332,132],{"class":116},[92,2334,2335],{"class":109},"Impl",[92,2337,1302],{"class":105},[92,2339,2340],{"class":116},"> impl_;\n",[92,2342,2343],{"class":94,"line":187},[92,2344,191],{"emptyLinePlaceholder":190},[92,2346,2347],{"class":94,"line":194},[92,2348,1271],{"class":105},[92,2350,2351],{"class":94,"line":200},[92,2352,2353],{"class":98},"    \u002F\u002F Construct rules from a set of enabled amendment IDs\n",[92,2355,2356,2359,2362,2364,2366,2368,2371,2373,2375,2377,2380,2382,2385,2388,2390,2393],{"class":94,"line":212},[92,2357,2358],{"class":105},"    explicit",[92,2360,2361],{"class":411}," Rules",[92,2363,1287],{"class":116},[92,2365,1290],{"class":109},[92,2367,126],{"class":116},[92,2369,2370],{"class":109},"unordered_set",[92,2372,132],{"class":116},[92,2374,446],{"class":109},[92,2376,76],{"class":116},[92,2378,2379],{"class":109},"beast",[92,2381,126],{"class":116},[92,2383,2384],{"class":109},"uhash",[92,2386,2387],{"class":116},"\u003C>> ",[92,2389,430],{"class":105},[92,2391,2392],{"class":109}," presets",[92,2394,1343],{"class":116},[92,2396,2397],{"class":94,"line":217},[92,2398,191],{"emptyLinePlaceholder":190},[92,2400,2401],{"class":94,"line":223},[92,2402,2403],{"class":98},"    \u002F\u002F Check if a specific amendment is enabled\n",[92,2405,2406,2408,2411,2413,2415,2417,2420,2423,2425],{"class":94,"line":233},[92,2407,247],{"class":105},[92,2409,2410],{"class":411}," enabled",[92,2412,1287],{"class":116},[92,2414,446],{"class":109},[92,2416,452],{"class":105},[92,2418,2419],{"class":109}," feature",[92,2421,2422],{"class":116},") ",[92,2424,1922],{"class":105},[92,2426,1527],{"class":116},[92,2428,2429],{"class":94,"line":238},[92,2430,191],{"emptyLinePlaceholder":190},[92,2432,2433],{"class":94,"line":244},[92,2434,2435],{"class":98},"    \u002F\u002F Rules are cheap to copy due to shared_ptr\n",[92,2437,2438,2440,2442,2444,2446,2448,2450,2453],{"class":94,"line":253},[92,2439,267],{"class":411},[92,2441,1287],{"class":116},[92,2443,362],{"class":109},[92,2445,452],{"class":105},[92,2447,2422],{"class":116},[92,2449,724],{"class":105},[92,2451,2452],{"class":105}," default",[92,2454,1527],{"class":116},[92,2456,2457,2459,2461,2464,2466,2468,2470,2472,2474,2476,2478],{"class":94,"line":258},[92,2458,267],{"class":109},[92,2460,463],{"class":105},[92,2462,2463],{"class":105}," operator",[92,2465,724],{"class":109},[92,2467,1287],{"class":116},[92,2469,362],{"class":109},[92,2471,452],{"class":105},[92,2473,2422],{"class":116},[92,2475,724],{"class":105},[92,2477,2452],{"class":105},[92,2479,1527],{"class":116},[92,2481,2482],{"class":94,"line":264},[92,2483,191],{"emptyLinePlaceholder":190},[92,2485,2486],{"class":94,"line":273},[92,2487,2488],{"class":98},"    \u002F\u002F Compare two rule sets\n",[92,2490,2491,2493,2495,2497,2499,2501,2503,2505,2507],{"class":94,"line":278},[92,2492,247],{"class":105},[92,2494,2463],{"class":105},[92,2496,1521],{"class":109},[92,2498,1287],{"class":116},[92,2500,362],{"class":109},[92,2502,452],{"class":105},[92,2504,2422],{"class":116},[92,2506,1922],{"class":105},[92,2508,1527],{"class":116},[92,2510,2511],{"class":94,"line":284},[92,2512,307],{"class":116},[22,2514,2515],{},[65,2516,2517],{},"How Rules Are Used:",[22,2519,2520],{},"Throughout transaction processing, the code checks if specific amendments are enabled to determine which logic path to use:",[83,2522,2524],{"className":85,"code":2523,"language":87,"meta":88,"style":88},"\u002F\u002F Example from payment processing\nif (view.rules().enabled(featureFlowCross))\n{\n    \u002F\u002F Use new payment engine introduced by FlowCross amendment\n    return flowCross(view, deliver, account, src, dst, ...);\n}\nelse\n{\n    \u002F\u002F Use legacy payment engine\n    return legacyPaymentEngine(view, deliver, ...);\n}\n",[58,2525,2526,2531,2550,2554,2559,2570,2574,2579,2583,2588,2598],{"__ignoreMap":88},[92,2527,2528],{"class":94,"line":95},[92,2529,2530],{"class":98},"\u002F\u002F Example from payment processing\n",[92,2532,2533,2536,2539,2542,2544,2547],{"class":94,"line":102},[92,2534,2535],{"class":105},"if",[92,2537,2538],{"class":116}," (view.",[92,2540,2541],{"class":411},"rules",[92,2543,2005],{"class":116},[92,2545,2546],{"class":411},"enabled",[92,2548,2549],{"class":116},"(featureFlowCross))\n",[92,2551,2552],{"class":94,"line":140},[92,2553,163],{"class":116},[92,2555,2556],{"class":94,"line":152},[92,2557,2558],{"class":98},"    \u002F\u002F Use new payment engine introduced by FlowCross amendment\n",[92,2560,2561,2564,2567],{"class":94,"line":160},[92,2562,2563],{"class":105},"    return",[92,2565,2566],{"class":411}," flowCross",[92,2568,2569],{"class":116},"(view, deliver, account, src, dst, ...);\n",[92,2571,2572],{"class":94,"line":166},[92,2573,500],{"class":116},[92,2575,2576],{"class":94,"line":172},[92,2577,2578],{"class":105},"else\n",[92,2580,2581],{"class":94,"line":178},[92,2582,163],{"class":116},[92,2584,2585],{"class":94,"line":187},[92,2586,2587],{"class":98},"    \u002F\u002F Use legacy payment engine\n",[92,2589,2590,2592,2595],{"class":94,"line":194},[92,2591,2563],{"class":105},[92,2593,2594],{"class":411}," legacyPaymentEngine",[92,2596,2597],{"class":116},"(view, deliver, ...);\n",[92,2599,2600],{"class":94,"line":200},[92,2601,500],{"class":116},[22,2603,2604],{},[65,2605,2606],{},"Amendment Activation:",[83,2608,2611],{"className":2609,"code":2610,"language":378},[376],"┌─────────────────────────────────────────────────────────────┐\n│           AMENDMENT LIFECYCLE PER LEDGER                    │\n│                                                             │\n│  1. Amendment Proposed                                      │\n│     • Validators vote yes\u002Fno on amendments                  │\n│     • Votes recorded in validation messages                 │\n│                                                             │\n│  2. Amendment Gains Majority (80%+ for 2 weeks)             │\n│     • Flag ledger arrives (every 256 ledgers)               │\n│     • Amendment marked as \"enabled\"                         │\n│     • Rules object updated for next ledger                  │\n│                                                             │\n│  3. Rules Object Created for Each Ledger                    │\n│     • makeRulesGivenLedger() reads enabled amendments       │\n│     • Creates Rules object with that ledger's active set    │\n│     • All transaction processing uses these rules           │\n│                                                             │\n│  4. Deterministic Processing                                │\n│     • Same ledger + same rules = same result                │\n│     • Historical replays work correctly                     │\n│     • All validators reach identical state                  │\n└─────────────────────────────────────────────────────────────┘\n",[58,2612,2610],{"__ignoreMap":88},[22,2614,2615],{},[65,2616,2617],{},"Why This Matters:",[35,2619,2620,2626,2632],{},[38,2621,2622,2625],{},[65,2623,2624],{},"Consensus requires determinism",": All validators must process transactions identically",[38,2627,2628,2631],{},[65,2629,2630],{},"Amendments change behavior",": Different amendment sets → different results",[38,2633,2634,363,2637,2639],{},[65,2635,2636],{},"Rules track the truth",[58,2638,362],{}," object for ledger N reflects exactly which amendments were active when ledger N was built",[22,2641,2642,2643,2646],{},"See ",[65,2644,2645],{},"Amendments"," in Consensus II for full details on the amendment system.",[17,2648,2650],{"id":2649},"key-operations","Key Operations",[22,2652,2653,2654,2656],{},"The Ledger class provides methods to read and modify state objects. All operations work through the ",[58,2655,345],{}," SHAMap.",[22,2658,2659],{},[65,2660,2661],{},"Reading State:",[83,2663,2665],{"className":85,"code":2664,"language":87,"meta":88,"style":88},"\u002F\u002F Ledger.cpp:414-431\nstd::shared_ptr\u003CSLE const> Ledger::read(Keylet const& k) const\n{\n    \u002F\u002F 1. Look up item in state map\n    auto const& item = stateMap_.peekItem(k.key);\n    if (!item)\n        return nullptr;  \u002F\u002F Object doesn't exist\n\n    \u002F\u002F 2. Deserialize to Serialized Ledger Entry (SLE)\n    auto sle = std::make_shared\u003CSLE>(SerialIter{item->slice()}, item->key());\n\n    \u002F\u002F 3. Verify type matches expectation\n    if (!k.check(*sle))\n        return nullptr;\n\n    return sle;\n}\n",[58,2666,2667,2672,2710,2714,2719,2739,2750,2761,2765,2770,2805,2809,2814,2836,2844,2848,2855],{"__ignoreMap":88},[92,2668,2669],{"class":94,"line":95},[92,2670,2671],{"class":98},"\u002F\u002F Ledger.cpp:414-431\n",[92,2673,2674,2676,2678,2680,2682,2685,2687,2689,2691,2693,2695,2697,2700,2702,2705,2707],{"class":94,"line":102},[92,2675,1290],{"class":109},[92,2677,126],{"class":116},[92,2679,1295],{"class":109},[92,2681,132],{"class":116},[92,2683,2684],{"class":109},"SLE",[92,2686,1302],{"class":105},[92,2688,1305],{"class":116},[92,2690,60],{"class":109},[92,2692,126],{"class":116},[92,2694,2229],{"class":411},[92,2696,1287],{"class":116},[92,2698,2699],{"class":109},"Keylet",[92,2701,452],{"class":105},[92,2703,2704],{"class":109}," k",[92,2706,2422],{"class":116},[92,2708,2709],{"class":105},"const\n",[92,2711,2712],{"class":94,"line":140},[92,2713,163],{"class":116},[92,2715,2716],{"class":94,"line":152},[92,2717,2718],{"class":98},"    \u002F\u002F 1. Look up item in state map\n",[92,2720,2721,2724,2726,2729,2731,2733,2736],{"class":94,"line":160},[92,2722,2723],{"class":105},"    auto",[92,2725,452],{"class":105},[92,2727,2728],{"class":116}," item ",[92,2730,724],{"class":105},[92,2732,2021],{"class":116},[92,2734,2735],{"class":411},"peekItem",[92,2737,2738],{"class":116},"(k.key);\n",[92,2740,2741,2743,2745,2747],{"class":94,"line":166},[92,2742,1967],{"class":105},[92,2744,1323],{"class":116},[92,2746,1326],{"class":105},[92,2748,2749],{"class":116},"item)\n",[92,2751,2752,2754,2756,2758],{"class":94,"line":172},[92,2753,1468],{"class":105},[92,2755,1524],{"class":419},[92,2757,730],{"class":116},[92,2759,2760],{"class":98},"  \u002F\u002F Object doesn't exist\n",[92,2762,2763],{"class":94,"line":178},[92,2764,191],{"emptyLinePlaceholder":190},[92,2766,2767],{"class":94,"line":187},[92,2768,2769],{"class":98},"    \u002F\u002F 2. Deserialize to Serialized Ledger Entry (SLE)\n",[92,2771,2772,2774,2777,2779,2781,2783,2786,2788,2790,2793,2796,2799,2802],{"class":94,"line":194},[92,2773,2723],{"class":105},[92,2775,2776],{"class":116}," sle ",[92,2778,724],{"class":105},[92,2780,123],{"class":109},[92,2782,126],{"class":116},[92,2784,2785],{"class":411},"make_shared",[92,2787,132],{"class":116},[92,2789,2684],{"class":109},[92,2791,2792],{"class":116},">(SerialIter{item->",[92,2794,2795],{"class":411},"slice",[92,2797,2798],{"class":116},"()}, item->",[92,2800,2801],{"class":411},"key",[92,2803,2804],{"class":116},"());\n",[92,2806,2807],{"class":94,"line":200},[92,2808,191],{"emptyLinePlaceholder":190},[92,2810,2811],{"class":94,"line":212},[92,2812,2813],{"class":98},"    \u002F\u002F 3. Verify type matches expectation\n",[92,2815,2816,2818,2820,2822,2825,2828,2830,2833],{"class":94,"line":217},[92,2817,1967],{"class":105},[92,2819,1323],{"class":116},[92,2821,1326],{"class":105},[92,2823,2824],{"class":116},"k.",[92,2826,2827],{"class":411},"check",[92,2829,1287],{"class":116},[92,2831,2832],{"class":105},"*",[92,2834,2835],{"class":116},"sle))\n",[92,2837,2838,2840,2842],{"class":94,"line":223},[92,2839,1468],{"class":105},[92,2841,1524],{"class":419},[92,2843,1527],{"class":116},[92,2845,2846],{"class":94,"line":233},[92,2847,191],{"emptyLinePlaceholder":190},[92,2849,2850,2852],{"class":94,"line":238},[92,2851,2563],{"class":105},[92,2853,2854],{"class":116}," sle;\n",[92,2856,2857],{"class":94,"line":244},[92,2858,500],{"class":116},[22,2860,56,2861,2864,2865,2867,2868,2871],{},[58,2862,2863],{},"read()"," method uses a ",[58,2866,2699],{}," for type-safe lookups. A Keylet combines a key with a type checker, ensuring you retrieve the correct object type (e.g., ",[58,2869,2870],{},"keylet::account(accountID)"," for account roots).",[22,2873,2874],{},[65,2875,2876],{},"Modifying State (Mutable Ledgers Only):",[83,2878,2880],{"className":85,"code":2879,"language":87,"meta":88,"style":88},"\u002F\u002F Insert new object\nvoid rawInsert(std::shared_ptr\u003CSLE> const& sle);\n\n\u002F\u002F Update existing object\nvoid rawReplace(std::shared_ptr\u003CSLE> const& sle);\n\n\u002F\u002F Delete object\nvoid rawErase(std::shared_ptr\u003CSLE> const& sle);\n",[58,2881,2882,2887,2915,2919,2924,2951,2955,2960],{"__ignoreMap":88},[92,2883,2884],{"class":94,"line":95},[92,2885,2886],{"class":98},"\u002F\u002F Insert new object\n",[92,2888,2889,2891,2894,2896,2898,2900,2902,2904,2906,2908,2910,2913],{"class":94,"line":102},[92,2890,1936],{"class":105},[92,2892,2893],{"class":411}," rawInsert",[92,2895,1287],{"class":116},[92,2897,1290],{"class":109},[92,2899,126],{"class":116},[92,2901,1295],{"class":109},[92,2903,132],{"class":116},[92,2905,2684],{"class":109},[92,2907,1305],{"class":116},[92,2909,430],{"class":105},[92,2911,2912],{"class":109}," sle",[92,2914,1343],{"class":116},[92,2916,2917],{"class":94,"line":140},[92,2918,191],{"emptyLinePlaceholder":190},[92,2920,2921],{"class":94,"line":152},[92,2922,2923],{"class":98},"\u002F\u002F Update existing object\n",[92,2925,2926,2928,2931,2933,2935,2937,2939,2941,2943,2945,2947,2949],{"class":94,"line":160},[92,2927,1936],{"class":105},[92,2929,2930],{"class":411}," rawReplace",[92,2932,1287],{"class":116},[92,2934,1290],{"class":109},[92,2936,126],{"class":116},[92,2938,1295],{"class":109},[92,2940,132],{"class":116},[92,2942,2684],{"class":109},[92,2944,1305],{"class":116},[92,2946,430],{"class":105},[92,2948,2912],{"class":109},[92,2950,1343],{"class":116},[92,2952,2953],{"class":94,"line":166},[92,2954,191],{"emptyLinePlaceholder":190},[92,2956,2957],{"class":94,"line":172},[92,2958,2959],{"class":98},"\u002F\u002F Delete object\n",[92,2961,2962,2964,2967,2969,2971,2973,2975,2977,2979,2981,2983,2985],{"class":94,"line":178},[92,2963,1936],{"class":105},[92,2965,2966],{"class":411}," rawErase",[92,2968,1287],{"class":116},[92,2970,1290],{"class":109},[92,2972,126],{"class":116},[92,2974,1295],{"class":109},[92,2976,132],{"class":116},[92,2978,2684],{"class":109},[92,2980,1305],{"class":116},[92,2982,430],{"class":105},[92,2984,2912],{"class":109},[92,2986,1343],{"class":116},[22,2988,2989],{},"These methods:",[35,2991,2992,2998,3001,3006],{},[38,2993,2994,2995,2997],{},"Only work on mutable ledgers (before ",[58,2996,331],{}," is called)",[38,2999,3000],{},"Serialize the SLE to binary format",[38,3002,3003,3004],{},"Add\u002Fupdate\u002Fremove items in ",[58,3005,345],{},[38,3007,3008,3009,3012],{},"Throw ",[58,3010,3011],{},"LogicError"," if the operation fails (duplicate key, missing key, etc.)",[17,3014,3016],{"id":3015},"database-persistence","Database Persistence",[22,3018,3019],{},"Ledgers are stored using a two-tier system:",[83,3021,3024],{"className":3022,"code":3023,"language":378},[376],"┌─────────────────────────────────────────────────────────────┐\n│                  PERSISTENCE ARCHITECTURE                   │\n│                                                             │\n│   Ledger Object                                             │\n│       │                                                     │\n│       ├──► LedgerHeader → SQL Database                      │\n│       │    • Sequence, hashes, close time                   │\n│       │    • Fast header lookups by seq or hash             │\n│       │                                                     │\n│       └──► stateMap_ & txMap_ → NodeStore                   │\n│            • Individual tree nodes stored by hash           │\n│            • Shared across ledgers (deduplication)          │\n│            • Lazy loading on access                         │\n└─────────────────────────────────────────────────────────────┘\n",[58,3025,3023],{"__ignoreMap":88},[22,3027,3028],{},[65,3029,3030],{},"Why Two Storage Systems?",[3032,3033,3034,3040],"ol",{},[38,3035,3036,3039],{},[65,3037,3038],{},"SQL Database",": Stores ledger headers for fast sequential access and indexing",[38,3041,3042,3045],{},[65,3043,3044],{},"NodeStore",": Stores SHAMap tree nodes for efficient content-addressable storage",[22,3047,3048],{},"When loading a ledger:",[3032,3050,3051,3054,3057],{},[38,3052,3053],{},"Retrieve header from SQL database by sequence or hash",[38,3055,3056],{},"Construct empty SHAMaps with root hashes from header",[38,3058,3059],{},"Load tree nodes from NodeStore on-demand as they're accessed",[22,3061,3062],{},[65,3063,3064],{},"Integrity Verification:",[22,3066,3067],{},"Before persisting, the system verifies hash consistency:",[83,3069,3071],{"className":85,"code":3070,"language":87,"meta":88,"style":88},"assert(header_.accountHash == stateMap_.getHash().as_uint256());\nassert(header_.txHash == txMap_.getHash().as_uint256());\n",[58,3072,3073,3093],{"__ignoreMap":88},[92,3074,3075,3078,3081,3083,3085,3087,3089,3091],{"class":94,"line":95},[92,3076,3077],{"class":411},"assert",[92,3079,3080],{"class":116},"(header_.accountHash ",[92,3082,1521],{"class":105},[92,3084,2021],{"class":116},[92,3086,2002],{"class":411},[92,3088,2005],{"class":116},[92,3090,2008],{"class":411},[92,3092,2804],{"class":116},[92,3094,3095,3097,3100,3102,3104,3106,3108,3110],{"class":94,"line":102},[92,3096,3077],{"class":411},[92,3098,3099],{"class":116},"(header_.txHash ",[92,3101,1521],{"class":105},[92,3103,1999],{"class":116},[92,3105,2002],{"class":411},[92,3107,2005],{"class":116},[92,3109,2008],{"class":411},[92,3111,2804],{"class":116},[22,3113,3114],{},"This ensures the header accurately represents the tree contents. Mismatches indicate data corruption, Byzantine attacks, or implementation bugs.",[22,3116,3117,3120,3121,346,3126,3131],{},[65,3118,3119],{},"Implementation:"," See ",[70,3122,3125],{"href":3123,"rel":3124},"https:\u002F\u002Fgithub.com\u002FXRPLF\u002Frippled\u002Fblob\u002Fdevelop\u002Fsrc\u002Fxrpld\u002Fapp\u002Frdb\u002Fbackend\u002Fdetail\u002FNode.cpp",[74],"Node.cpp",[70,3127,3130],{"href":3128,"rel":3129},"https:\u002F\u002Fgithub.com\u002FXRPLF\u002Frippled\u002Fblob\u002Fdevelop\u002Fsrc\u002Fxrpld\u002Fapp\u002Frdb\u002Fbackend\u002Fdetail\u002FSQLiteDatabase.cpp",[74],"SQLiteDatabase.cpp"," for details.",[17,3133,3135],{"id":3134},"summary","Summary",[22,3137,3138],{},[65,3139,3140],{},"Core Data Structures:",[967,3142,3143,3155],{},[970,3144,3145],{},[973,3146,3147,3150,3152],{},[976,3148,3149],{},"Structure",[976,3151,981],{},[976,3153,3154],{},"Key Features",[983,3156,3157,3167,3177,3187,3197],{},[973,3158,3159,3161,3164],{},[988,3160,60],{},[988,3162,3163],{},"Single ledger instance",[988,3165,3166],{},"State + Tx maps, immutability",[973,3168,3169,3171,3174],{},[988,3170,666],{},[988,3172,3173],{},"Header metadata",[988,3175,3176],{},"Hashing, identification",[973,3178,3179,3181,3184],{},[988,3180,335],{},[988,3182,3183],{},"Thread-safe container",[988,3185,3186],{},"Mutex protection, const enforcement",[973,3188,3189,3191,3194],{},[988,3190,1616],{},[988,3192,3193],{},"Cache management",[988,3195,3196],{},"Hash\u002Fseq lookup, validation tracking",[973,3198,3199,3201,3204],{},[988,3200,362],{},[988,3202,3203],{},"Protocol configuration",[988,3205,3206],{},"Amendment checking",[22,3208,3209],{},[65,3210,3211],{},"Key Properties:",[3032,3213,3214,3219,3225,3231,3237],{},[38,3215,3216,3218],{},[65,3217,319],{},": Validated ledgers cannot be modified",[38,3220,3221,3224],{},[65,3222,3223],{},"Efficient Lookup",": Dual indexing by hash and sequence",[38,3226,3227,3230],{},[65,3228,3229],{},"Thread Safety",": LedgerHolder provides safe concurrent access",[38,3232,3233,3236],{},[65,3234,3235],{},"Persistence",": Multiple storage backends supported",[38,3238,3239,3242],{},[65,3240,3241],{},"Integrity",": Hash verification at all levels",[22,3244,3245],{},[65,3246,3247],{},"Design Patterns:",[35,3249,3250,3253,3256,3259,3262],{},[38,3251,3252],{},"Shared pointers for memory management",[38,3254,3255],{},"Copy-on-write for efficient branching",[38,3257,3258],{},"Const correctness for immutability",[38,3260,3261],{},"Tagged caches for LRU eviction",[38,3263,3264],{},"Pimpl idiom for Rules (hides implementation details)",[22,3266,3267],{},[65,3268,3269],{},"Source Code References:",[35,3271,3272,3280,3286,3292,3298,3304],{},[38,3273,3274,3279],{},[70,3275,3278],{"href":3276,"rel":3277},"https:\u002F\u002Fgithub.com\u002FXRPLF\u002Frippled\u002Fblob\u002Fdevelop\u002Fsrc\u002Fxrpld\u002Fapp\u002Fledger\u002FLedger.h",[74],"Ledger.h"," - Ledger class definition",[38,3281,3282,3285],{},[70,3283,81],{"href":79,"rel":3284},[74]," - Ledger implementation",[38,3287,3288,3291],{},[70,3289,75],{"href":72,"rel":3290},[74]," - LedgerHeader structure",[38,3293,3294,3297],{},[70,3295,1231],{"href":1229,"rel":3296},[74]," - Thread-safe holder",[38,3299,3300,3303],{},[70,3301,1628],{"href":1626,"rel":3302},[74]," - History cache",[38,3305,3306,3309],{},[70,3307,2277],{"href":2275,"rel":3308},[74]," - Amendment rules",[22,3311,3312],{},"In the next chapter, we'll explore how ledgers are acquired from the network and validated.",[3314,3315,3316],"style",{},"html pre.shiki code .sQrFR, html code.shiki .sQrFR{--shiki-default:#BDC4CC}html pre.shiki code .sWyjQ, html code.shiki .sWyjQ{--shiki-default:#FF9492}html pre.shiki code .s_sBn, html code.shiki .s_sBn{--shiki-default:#FFB757}html pre.shiki code .sMAXC, html code.shiki .sMAXC{--shiki-default:#F0F3F6}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sj_SG, html code.shiki .sj_SG{--shiki-default:#DBB7FF}html pre.shiki code .sCcAr, html code.shiki .sCcAr{--shiki-default:#91CBFF}html pre.shiki code .sTRMh, html code.shiki .sTRMh{--shiki-default:#ADDCFF}",{"title":88,"searchDepth":102,"depth":102,"links":3318},[3319,3320,3321,3322,3323,3324,3325,3326,3327,3328,3329,3330],{"id":19,"depth":102,"text":20},{"id":52,"depth":102,"text":53},{"id":383,"depth":102,"text":384},{"id":660,"depth":102,"text":661},{"id":1215,"depth":102,"text":335},{"id":1615,"depth":102,"text":1616},{"id":1912,"depth":102,"text":1913},{"id":2239,"depth":102,"text":2240},{"id":2259,"depth":102,"text":2260},{"id":2649,"depth":102,"text":2650},{"id":3015,"depth":102,"text":3016},{"id":3134,"depth":102,"text":3135},"Ledger Data Structures for Consensus I: Node, Consensus, and Ledger Fundamentals, in the Core Dev Bootcamp: XRPL Commons docs.","md",{},"\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule08\u002Fledger-data-structures",{"title":5,"description":3331},"xrpl-trainings\u002Fcore-dev-bootcamp\u002Fmodule08\u002Fledger-data-structures.md","docs\u002Fcore-dev-bootcamp\u002Fmodule08\u002Fledger-data-structures","RV5JQSYm7eP8J_E-wd559UmrcrTS4JmanSIww3tpcnE",[],[3341,3382,3396,3416,3439,3830],{"title":3342,"path":3343,"children":3344,"description":3381,"pages":217},"XRPL Basics","\u002Fdocs\u002Fxrpl-basics",[3345,3348,3351,3354,3357,3360,3363,3366,3369,3372,3375,3378],{"title":3346,"path":3347},"Getting Started","\u002Fdocs\u002Fxrpl-basics\u002Fgetting-started",{"title":3349,"path":3350},"Trustline","\u002Fdocs\u002Fxrpl-basics\u002Ftrustline",{"title":3352,"path":3353},"Payments","\u002Fdocs\u002Fxrpl-basics\u002Fpayments",{"title":3355,"path":3356},"Reading and subscribing to Transactions","\u002Fdocs\u002Fxrpl-basics\u002Freading-and-writing-memos",{"title":3358,"path":3359},"Writing and reading memos","\u002Fdocs\u002Fxrpl-basics\u002Fwriting-and-reading-memos",{"title":3361,"path":3362},"Non Fungible Tokens","\u002Fdocs\u002Fxrpl-basics\u002Fnon-fungible-tokens",{"title":3364,"path":3365},"Multi-Purpose Tokens","\u002Fdocs\u002Fxrpl-basics\u002Fmptoken",{"title":3367,"path":3368},"PathFinding","\u002Fdocs\u002Fxrpl-basics\u002Fpath-finding",{"title":3370,"path":3371},"Escrow","\u002Fdocs\u002Fxrpl-basics\u002Fescrow",{"title":3373,"path":3374},"Price Oracles","\u002Fdocs\u002Fxrpl-basics\u002Fprice-oracles",{"title":3376,"path":3377},"Tickets","\u002Fdocs\u002Fxrpl-basics\u002Ftickets",{"title":3379,"path":3380},"Multi-Signature","\u002Fdocs\u002Fxrpl-basics\u002Fmulti-signature","In this section we will cover some of the primary functionality of the XRPL ledger.",{"title":3383,"path":3384,"children":3385,"description":3395,"pages":152},"Token Issuance and Liquidity","\u002Fdocs\u002Ftoken-issuance-and-liquidity",[3386,3389,3392],{"title":3387,"path":3388},"Creating Accounts and Setup","\u002Fdocs\u002Ftoken-issuance-and-liquidity\u002Fcreating-accounts",{"title":3390,"path":3391},"Issuing Tokens","\u002Fdocs\u002Ftoken-issuance-and-liquidity\u002Fissuing-tokens",{"title":3393,"path":3394},"Creating an AMM Pool","\u002Fdocs\u002Ftoken-issuance-and-liquidity\u002Fcreating-an-amm-pool","This session will cover token issuance and providing liquidity for your tokens using the automatic market maker built in to the XRPL",{"title":3397,"path":3398,"children":3399,"description":3415,"pages":166},"Cyphered Chat on XRPL","\u002Fdocs\u002Fcyphered-chat-on-xrpl",[3400,3403,3406,3409,3412],{"title":3401,"path":3402},"Set up","\u002Fdocs\u002Fcyphered-chat-on-xrpl\u002Fset-up",{"title":3404,"path":3405},"Set up Keys","\u002Fdocs\u002Fcyphered-chat-on-xrpl\u002Fset-up-keys",{"title":3407,"path":3408},"Cypher the message","\u002Fdocs\u002Fcyphered-chat-on-xrpl\u002Fcypher-the-message",{"title":3410,"path":3411},"Set up the memo & send the tx","\u002Fdocs\u002Fcyphered-chat-on-xrpl\u002Fset-up-the-memo-and-send-the-tx",{"title":3413,"path":3414},"Get the message and decypher it","\u002Fdocs\u002Fcyphered-chat-on-xrpl\u002Fget-the-message-and-decypher-it","Send encrypted messages over XRPL",{"title":3417,"path":3418,"children":3419,"description":3438,"pages":172},"EVM Sidechain","\u002Fdocs\u002Fevm-sidechain",[3420,3423,3426,3429,3432,3435],{"title":3421,"path":3422},"Connecting Metamask","\u002Fdocs\u002Fevm-sidechain\u002Fconnecting-metamask",{"title":3424,"path":3425},"Set up a Foundry project","\u002Fdocs\u002Fevm-sidechain\u002Fset-up-an-evm-project",{"title":3427,"path":3428},"Bridging Assets","\u002Fdocs\u002Fevm-sidechain\u002Fbridging-assets",{"title":3430,"path":3431},"Remix","\u002Fdocs\u002Fevm-sidechain\u002Fremix",{"title":3433,"path":3434},"Banking App","\u002Fdocs\u002Fevm-sidechain\u002Fbanking-app",{"title":3436,"path":3437},"Banking Contract Key Concepts","\u002Fdocs\u002Fevm-sidechain\u002Fbanking-contract-key-concepts","This workshop will walk you through deploying a smart contract and building a full app on the XRPL EVM sidechain",{"title":3440,"path":3441,"children":3442,"description":3828,"pages":3829},"Core Dev Bootcamp","\u002Fdocs\u002Fcore-dev-bootcamp",[3443,3463,3506,3556,3587,3644,3675,3691,3731,3763,3787,3803],{"title":3444,"path":3445,"children":3446},"Rippled I – Compilation, Configuration, and Launch","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule01",[3447,3450,3453,3456],{"title":3448,"path":3449},"Environment & Build Toolchain","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule01\u002Fenvironment-build-toolchain",{"title":3451,"path":3452},"Compilation Process & Generating Binary","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule01\u002Fcompilation-process-generating-binary",{"title":3454,"path":3455},"Local Development & Testing","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule01\u002Flocal-development-testing",{"title":3457,"path":3458,"children":3459},"Homeworks","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule01\u002Fhomeworks",[3460],{"title":3461,"path":3462},"Homework 1: Rippled Node Setup and Mainnet Synchronization","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule01\u002Fhomeworks\u002Fhomework1",{"title":3464,"path":3465,"children":3466},"Rippled II: Deep Dive into the Protocol and Codebase","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule02",[3467,3470,3473,3476,3479,3482,3485,3488,3491],{"title":3468,"path":3469},"Protocols: Communication and Interoperability","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule02\u002Fprotocols-communication-and-interoperability",{"title":3471,"path":3472},"Transactors: Transaction Processing Framework","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule02\u002Ftransactors-transaction-processing-framework",{"title":3474,"path":3475},"Application Layer: Central Orchestration and Coordination","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule02\u002Fapplication-layer-central-orchestration-and-coordination",{"title":3477,"path":3478},"Consensus Engine: XRP Ledger Consensus Protocol","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule02\u002Fconsensus-engine-xrp-ledger-consensus-protocol",{"title":3480,"path":3481},"Overlay Network: Peer-to-Peer Networking Layer","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule02\u002Foverlay-network-peer-to-peer-networking-layer",{"title":3483,"path":3484},"Transaction Lifecycle: Complete Transaction Journey","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule02\u002Ftransaction-lifecycle-complete-transaction-journey",{"title":3486,"path":3487},"Codebase Navigation: Efficiently Navigating the Rippled Source","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule02\u002Fcodebase-navigation-efficiently-navigating-the-rippled-source",{"title":3489,"path":3490},"Debugging Tools: Development and Debugging Techniques","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule02\u002Fdebugging-tools-development-and-debugging-techniques",{"title":3457,"path":3492,"children":3493},"\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule02\u002Fhomeworks",[3494,3497,3500,3503],{"title":3495,"path":3496},"Homework 1: Transaction Flow Analysis","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule02\u002Fhomeworks\u002Fhomework1",{"title":3498,"path":3499},"Homework 2: Transactor Code Exploration","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule02\u002Fhomeworks\u002Fhomework2",{"title":3501,"path":3502},"Homework 3: Logging and Debugging","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule02\u002Fhomeworks\u002Fhomework3",{"title":3504,"path":3505},"Homework 4: Architecture Diagram","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule02\u002Fhomeworks\u002Fhomework4",{"title":3507,"path":3508,"children":3509},"Anatomy of Rippled: SHAMap and NodeStore","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03",[3510,3513,3516,3519,3522,3525,3528,3531,3534,3537,3540,3543],{"title":3511,"path":3512},"Foundational Concepts","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Fstate-management-challenges",{"title":3514,"path":3515},"Trees, Hashing, and Cryptographic Commitments","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Ftree-fundamentals",{"title":3517,"path":3518},"SHAMap Architecture and Node Hierarchy","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Fshamap-architecture",{"title":3520,"path":3521},"Navigation, Hashing, and Merkle Properties","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Fshamap-navigation-hashing",{"title":3523,"path":3524},"Traversal, Iteration, and Synchronization","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Fshamap-synchronization",{"title":3526,"path":3527},"The NodeStore","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Fnodestore-architecture",{"title":3529,"path":3530},"Storage Abstraction and Backend Implementations","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Fstorage-backends",{"title":3532,"path":3533},"Cache Layer and Performance Optimization","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Fcache-layer",{"title":3535,"path":3536},"Database Operations and Lifecycle Management","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Fdatabase-operations",{"title":3538,"path":3539},"Cryptographic Proofs and State Reconstruction","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Fproofs-state-reconstruction",{"title":3541,"path":3542},"Resource Management and Performance Characteristics","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Fresource-management",{"title":3544,"path":3545,"children":3546},"Appendices","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Fappendices",[3547,3550,3553],{"title":3548,"path":3549},"Appendix : Codebase Navigation Guide","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Fappendices\u002Fnavigation",{"title":3551,"path":3552},"Appendix : Configuration Reference","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Fappendices\u002Fconfiguration",{"title":3554,"path":3555},"Appendix : Debugging and Development Tools","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03\u002Fappendices\u002Fdebugging",{"title":3557,"path":3558,"children":3559},"Transactors: Understanding the Lifecycle of a Transaction","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03bis",[3560,3563,3566,3569,3572,3575,3578,3581,3584],{"title":3561,"path":3562},"Transactor Architecture","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03bis\u002Ftransactor-architecture",{"title":3564,"path":3565},"Processing Pipeline","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03bis\u002Fprocessing-pipeline",{"title":3567,"path":3568},"Fee and Sequence Handling","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03bis\u002Ffee-sequence-handling",{"title":3570,"path":3571},"State Modification Patterns","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03bis\u002Fstate-modification",{"title":3573,"path":3574},"TER Result Codes","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03bis\u002Fter-result-codes",{"title":3576,"path":3577},"Case Study: CheckCreate Transactor","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03bis\u002Fcase-study-checkcreate",{"title":3579,"path":3580},"Homework 1: Trace a Transaction Through All Phases","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03bis\u002Fhomeworks\u002Fhomework1",{"title":3582,"path":3583},"Homework 2: Implement a Custom Validation Check","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03bis\u002Fhomeworks\u002Fhomework2",{"title":3585,"path":3586},"Homework 3: Analyze TER Code Paths","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule03bis\u002Fhomeworks\u002Fhomework3",{"title":3588,"path":3589,"children":3590},"Cryptography I: Blockchain Security and Cryptographic Foundations","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04",[3591,3594,3597,3600,3603,3606,3609,3612,3615,3618,3621,3624,3627,3638],{"title":3592,"path":3593},"The Four Pillars of Security","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fthe-four-pillars-of-security",{"title":3595,"path":3596},"The Lifecycle of a Cryptographic Key","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fthe-lifecycle-of-a-cryptographic-key",{"title":3598,"path":3599},"Random Number Generation","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Frandom-number-generation",{"title":3601,"path":3602},"Random Number Generation & Entropy","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Frandom-number-generation-and-entropy",{"title":3604,"path":3605},"Key Generation Pipeline","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fkey-generation-pipeline",{"title":3607,"path":3608},"Transaction Signing & Verification","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Ftransaction-signing-and-verification",{"title":3610,"path":3611},"Hash Functions in XRPL","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fhash-functions-in-xrpl",{"title":3613,"path":3614},"Base58Check Encoding","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fbase58check-encoding",{"title":3616,"path":3617},"Peer Handshake Protocol","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fpeer-handshake-protocol",{"title":3619,"path":3620},"Secure Memory Handling","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fsecure-memory-handling",{"title":3622,"path":3623},"Common Cryptographic Pitfalls","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fcommon-cryptographic-pitfalls",{"title":3625,"path":3626},"Performance & Optimization","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fperformance-and-optimization",{"title":3544,"path":3628,"children":3629},"\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fappendices",[3630,3632,3635],{"title":3548,"path":3631},"\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fappendices\u002Fcodebase-navigation-guide",{"title":3633,"path":3634},"Appendix : Debugging & Development Tools","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fappendices\u002Fdebugging-and-development-tools",{"title":3636,"path":3637},"Appendix : RFCs and Standards Reference","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fappendices\u002Frfcs-and-standards-reference",{"title":3457,"path":3639,"children":3640},"\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fhomeworks",[3641],{"title":3642,"path":3643},"Homework 1: Signature Verification Discovery","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule04\u002Fhomeworks\u002Fhomework1",{"title":3645,"path":3646,"children":3647},"Cryptography II: Protocol Extensions and Quantum Signatures","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule05",[3648,3651,3654,3657,3660,3663,3669],{"title":3649,"path":3650},"Overlay Architecture","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule05\u002Foverlay-architecture",{"title":3652,"path":3653},"Connection Lifecycle","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule05\u002Fconnection-lifecycle",{"title":3655,"path":3656},"Handshake Protocol","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule05\u002Fhandshake-protocol",{"title":3658,"path":3659},"Message Relaying","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule05\u002Fmessage-relaying",{"title":3661,"path":3662},"Peer Discovery","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule05\u002Fpeer-discovery",{"title":3544,"path":3664,"children":3665},"\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule05\u002Fappendices",[3666],{"title":3667,"path":3668},"XLS-??d Quantum-Resistant Signatures","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule05\u002Fappendices\u002Fxls-d",{"title":3457,"path":3670,"children":3671},"\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule05\u002Fhomeworks",[3672],{"title":3673,"path":3674},"Homework 1: Building Quantum-Resistant Signatures for XRPL","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule05\u002Fhomeworks\u002Fhomework1",{"title":3676,"path":3677,"children":3678},"Communication I: Understanding XRPL(d) RPC Architecture","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule06",[3679,3682,3685,3688],{"title":3680,"path":3681},"RPC Handler Architecture","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule06\u002Frpc-handler-architecture",{"title":3683,"path":3684},"Request and Response Flow","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule06\u002Frequest-response-flow",{"title":3686,"path":3687},"Authentication and Authorization","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule06\u002Fauthentication-authorization",{"title":3689,"path":3690},"Error Handling and Validation","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule06\u002Ferror-handling-validation",{"title":3692,"path":3693,"children":3694},"Communication II: Building and Integrating Custom RPC Handlers","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule07",[3695,3698,3701,3704,3707,3719],{"title":3696,"path":3697},"Implementing Custom Handlers","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule07\u002Fimplementing-custom-handlers",{"title":3699,"path":3700},"Testing RPC Handlers","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule07\u002Ftesting-rpc-handlers",{"title":3702,"path":3703},"Advanced Features","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule07\u002Fadvanced-features",{"title":3705,"path":3706},"Best Practices and Patterns","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule07\u002Fbest-practices-patterns",{"title":3544,"path":3708,"children":3709},"\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule07\u002Fappendices",[3710,3713,3716],{"title":3711,"path":3712},"Appendix: Handler Examples","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule07\u002Fappendices\u002Fhandler-examples",{"title":3714,"path":3715},"Appendix: Helper Functions","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule07\u002Fappendices\u002Fhelper-functions",{"title":3717,"path":3718},"Appendix: Debugging Guide","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule07\u002Fappendices\u002Fdebugging-guide",{"title":3457,"path":3720,"children":3721},"\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule07\u002Fhomeworks",[3722,3725,3728],{"title":3723,"path":3724},"Homework 1: Building a Custom RPC Handler","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule07\u002Fhomeworks\u002Fhomework1",{"title":3726,"path":3727},"Hints","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule07\u002Fhomeworks\u002Fhints",{"title":3729,"path":3730},"Snippets","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule07\u002Fhomeworks\u002Fsnippets",{"title":3732,"path":3733,"children":3734},"Consensus I: Node, Consensus, and Ledger Fundamentals","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule08",[3735,3738,3741,3744,3747,3748,3751,3754],{"title":3736,"path":3737},"Consensus Fundamentals","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule08\u002Fconsensus-fundamentals",{"title":3739,"path":3740},"Consensus Modes and Phases","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule08\u002Fconsensus-modes-phases",{"title":3742,"path":3743},"Consensus Lifecycle","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule08\u002Fconsensus-lifecycle",{"title":3745,"path":3746},"Ledger Architecture","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule08\u002Fledger-architecture",{"title":5,"path":3334},{"title":3749,"path":3750},"Ledger Acquisition and Validation","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule08\u002Fledger-acquisition-validation",{"title":3752,"path":3753},"RPC and Peer Transaction Lifecycle","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule08\u002Frpc-peer-tx-lifecycle",{"title":3457,"path":3755,"children":3756},"\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule08\u002Fhomeworks",[3757,3760],{"title":3758,"path":3759},"Homework 1: Transaction Consensus Journey","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule08\u002Fhomeworks\u002Fhomework1",{"title":3761,"path":3762},"Homework 2: Consensus Dispute Engineering","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule08\u002Fhomeworks\u002Fhomework2",{"title":3764,"path":3765,"children":3766},"Consensus II: UNLs and Ledger Amendments","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule09",[3767,3770,3773,3775,3778,3781,3784],{"title":3768,"path":3769},"Transaction Ordering","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule09\u002Ftx-ordering",{"title":3771,"path":3772},"Consensus Validations","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule09\u002Fconsensus-validations",{"title":2645,"path":3774},"\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule09\u002Famendments",{"title":3776,"path":3777},"UNL Management","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule09\u002Funl",{"title":3779,"path":3780},"Consensus Peers","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule09\u002Fconsensus-peers",{"title":3782,"path":3783},"Homework 1: Validator Keys Setup and Management","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule09\u002Fhomeworks\u002Fhomework1",{"title":3785,"path":3786},"Homework 2: Negative UNL Engineering","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule09\u002Fhomeworks\u002Fhomework2",{"title":3788,"path":3789,"children":3790},"AMM: Automated Market Maker","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule09bis",[3791,3794,3797,3800],{"title":3792,"path":3793},"AMM Architecture","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule09bis\u002Famm-architecture",{"title":3795,"path":3796},"AMM Transactions","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule09bis\u002Famm-transactions",{"title":3798,"path":3799},"AMM Logic","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule09bis\u002Famm-logic",{"title":3801,"path":3802},"Pathfinding Integration","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule09bis\u002Famm-pathfinding",{"title":3804,"path":3805,"children":3806},"Building Amendments: Lifecycle and Core Protocol Impact","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule10",[3807,3810,3813,3816,3819,3822,3825],{"title":3808,"path":3809},"Amendment Architecture","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule10\u002Famendment-architecture",{"title":3811,"path":3812},"Amendment Lifecycle","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule10\u002Famendment-lifecycle",{"title":3814,"path":3815},"Voting and Activation","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule10\u002Fvoting-and-activation",{"title":3817,"path":3818},"Core Protocol Impact","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule10\u002Fprotocol-impact",{"title":3820,"path":3821},"Network Coordination","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule10\u002Fnetwork-coordination",{"title":3823,"path":3824},"Monitoring and Tools","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule10\u002Famendment-monitoring",{"title":3826,"path":3827},"Homework 1: Amendment Status Analysis","\u002Fdocs\u002Fcore-dev-bootcamp\u002Fmodule10\u002Fhomework\u002Fhomework1","The XRPL Core Dev Bootcamp – Online Edition is a program designed for intermediate to advanced C++ developers looking to deepen their skills in the core of the XRP Ledger.",126,{"title":3831,"path":3832,"children":3833,"description":3840,"pages":140},"Tools","\u002Fdocs\u002Ftools",[3834,3837],{"title":3835,"path":3836},"Xaman Setup","\u002Fdocs\u002Ftools\u002Fxaman-setup",{"title":3838,"path":3839},"Metamask Setup","\u002Fdocs\u002Ftools\u002Fmetamask-setup","In this section you will find instructions on how to setup wallets and tools",1796220774682]