56,000 lines of memory-safe Rust. Full peer protocol. Full consensus. 22 transaction types. Connects to the live XRPL network today.
A ground-up rewrite that brings modern systems engineering to the XRP Ledger without compromising on protocol compatibility.
Written entirely in Rust. Buffer overflows, use-after-free, data races, and null pointer dereferences are eliminated by the compiler — not by hope. No garbage collector overhead. No manual memory management mistakes.
Built on Tokio from the ground up. Every peer connection, RPC request, WebSocket subscription, and consensus timer runs on an async executor. No thread-per-connection. No blocking I/O on the critical path.
Speaks the exact same RTXP protocol as rippled. Connects to existing peers, syncs the full account state tree via SHAMap download, and validates transactions against the live network. Drop-in network participant.
NuDB for content-addressed Merkle tree nodes (SHAMap) with 256MB cache. SQLite in WAL mode for relational data (ledger headers, transaction index, metadata). Crash-safe, delta-based writes between ledger closes.
Implements the XRP Ledger Consensus Protocol: proposal rounds with convergence thresholds (50% → 65% → 70% → 80%), UNL quorum validation, manifest-based ephemeral key delegation, and amendment tracking.
JSON-RPC with 15+ methods (server_info, account_info, tx, ledger, book_offers, submit, sign, and more). WebSocket API with subscribe/unsubscribe for live ledger events. Same response format — existing tools just work.
Mirrors rippled's battle-tested architecture — the view stack, SHAMap, consensus rounds — while leveraging Rust's type system for correctness.
xLedgRS implements the complete XRPL peer protocol. Every message, every handshake field, every compression mode.
The XRP Ledger stores all account state in a radix-16 Merkle tree called the SHAMap. Each leaf node contains a serialized ledger entry (AccountRoot, Offer, RippleState, etc.) keyed by its SHA-512-Half hash. Inner nodes aggregate 16 child hashes into a single parent hash, enabling efficient proof-of-inclusion and incremental state sync.
xLedgRS implements the SHAMap with NuDB-backed content-addressed storage, a 256MB LRU cache for hot inner nodes, and a sparse overlay mode for follower nodes that only materializes branches that change between ledgers.
Each handler implements the full lifecycle: preflight validation, preclaim checks, state application, and metadata generation.
The OfferCreate handler implements the full XRPL decentralized exchange: order book crossing with quality-sorted BTreeMap iteration, partial fills with IOU precision arithmetic (16-digit mantissa, round-half-even normalization matching rippled's STAmount), self-offer replacement, ticket-based sequence management, reserve checks (tecINSUFFICIENT_RESERVE), and funding validation (tecUNFUNDED_OFFER).
| Method | Description |
|---|---|
server_info | Node status, peer count, memory, uptime, validated ledger |
account_info | Account balance, sequence, owner count, flags |
account_lines | Trust lines with balances and limits |
account_offers | Open DEX orders for an account |
account_tx | Transaction history per account |
tx | Look up transaction by hash |
ledger | Ledger header by sequence or "validated" |
ledger_data | All ledger objects (paginated) |
book_offers | Order book for a currency pair |
submit | Submit a signed transaction |
sign | Server-side transaction signing (all 22 types) |
fee | Current transaction fee (escalation-aware) |
feature | Amendment status |
ripple_path_find | Cross-currency pathfinding |
ping | Connectivity check |
Requires Rust 1.75+, OpenSSL dev headers, and a network connection.
# Clone and build (release mode, ~2 min) git clone https://github.com/realJDP/xLedgRS.git cd xrpl-rs cargo build --release # Run on mainnet as a follower node ./target/release/xledgrs --config cfg/xrplnode.cfg # Run on testnet ./target/release/xledgrs --config cfg/testnet.cfg # Query your node curl -s http://127.0.0.1:5005 \ -d '{"method":"server_info"}' | jq .result.info # Check account balance curl -s http://127.0.0.1:5005 \ -d '{"method":"account_info","params":[{"account":"rN7n3473SaZBCG4dFL83w7p1W9cgZw6iTP"}]}' | jq .
# rippled-compatible configuration format [server] port_rpc port_peer [port_rpc] port = 5005 ip = 0.0.0.0 protocol = http [port_peer] port = 51235 ip = 0.0.0.0 protocol = peer [ips] s1.ripple.com 51235 s2.ripple.com 51235 r.ripple.com 51235 [peers_max] 21 [node_db] path=./data [xrpl_rs] enable_consensus_close_loop = 1
Rust 1.75+ (stable)
OpenSSL dev headers
protoc (prost-build)
~2 min build time
Linux x86_64 (primary)
macOS ARM64 (dev)
512 MB RAM (follower)
~10 GB disk (state)
Port 51235 (peer)
Port 5005 (JSON-RPC)
Port 6006 (WebSocket)
Outbound TCP required
Feature-by-feature comparison against the reference C++ implementation.
| Capability | rippled (C++) | xLedgRS (Rust) |
|---|---|---|
| Language | C++17 | Rust (memory-safe) |
| Async Model | Boost.Asio | Tokio (async/await) |
| Peer Protocol (RTXP) | Full | Full |
| TLS + Session Signatures | Full | Full |
| Consensus Protocol | Full | Full |
| State Sync (Peer) | Full | Full (7-9K obj/sec) |
| Ledger Following | Full | Full |
| Transaction Engine | 30+ types | 22 types |
| JSON-RPC API | Full (~50 methods) | 15 methods |
| WebSocket API | Full | subscribe/unsubscribe |
| DEX Order Book | Full | Full (BTreeMap quality sort) |
| NFToken Support | Full | Mint/Burn/Offer/Accept |
| Escrow & PayChan | Full | Full |
| Checks | Full | Full |
| Validator Mode | Full | In Progress |
| Amendment Voting | Full | Tracking Only |
| History Sharding | Full | Planned |
| Config Format | rippled .cfg | rippled .cfg + TOML |
| Build System | CMake + Conan | Cargo (single command) |
| Binary Size | ~80 MB | ~13 MB |
No framework bloat. Every dependency earns its place.
Built in the open. Contributions welcome.
Run it, fork it, improve it.