Stellar XDR conformance: 380 ledgers, five libraries, two findings resolved upstream
Written 15 November 2026
Written 2026-11-15. Every wallet, indexer and SDK in the Stellar ecosystem decodes the same ledger format (XDR), and each library does it its own way. When two libraries read the same transaction differently, an indexer can drop an address, a wallet can show the wrong balance change, or a service can refuse a transaction the network accepted. We built an open-source kit that finds those differences before users do.
The short version: github.com/zachsplat/xdr-conformance (Apache-2.0). Clone it and run ./run.sh quick; it needs git, Node 24 and Python 3.12 or later, and no docker, keys or accounts.
What it does
- Takes 380 ledgers from the public Galexie data lake across protocols 12 to 29: 112,278 transaction envelopes and 44,057 result metas.
- Puts every entry through rs-stellar-xdr, go-stellar-sdk, js-stellar-sdk, py-stellar-base and py-stellar-xdr and compares their output, with rs-stellar-xdr as the reference.
- Keeps a smaller corpus of rare shapes and deliberately hostile but valid inputs, where stellar-core's own decoder is the referee.
- Runs that corpus in public CI on every change, with every library version pinned, and fails on any divergence that is not already documented. The full 380-ledger rebuild with stellar-core runs locally with docker.
- Serves the 380 ledgers over Stellar RPC (
getLedgerswith cursor paging, optionally paced like a live network) and in Galexie's datastore layout, so an indexer can ingest real pubnet history with no code changes. It is also hosted athttps:/. Every ledger reads back byte for byte through go-stellar-sdk's/ rpc. nonceworks. com RPCLedgerBackendandBufferedStorageBackend(mockrpc). - Since 19 November it also runs six more SDKs (Dart, .NET, Elixir, Ruby, Java and PHP). That run found 11 new problems, filed upstream the same day: wrong hashes and dropped fee-bump signatures in the Dart SDK, a crash in the .NET SDK, schema and protocol 23 gaps in the Elixir SDK, and a count overflow in Ruby's XDR library (list).
What it found
| finding | library | status |
|---|---|---|
Default max_depth=200 refused transactions that pass stellar-core's admission checks (authorization trees from 199 levels) |
py-stellar-xdr 0.2.0 | Filed as lightsail-network/py-stellar-xdr#17; the maintainer confirmed it and merged a fix the same day (#19), released in 0.2.1. We verified all four test inputs decode with the new defaults. |
| SEP-51 JSON differs from the other libraries on four shapes found in pubnet history; two of them cannot be read back | py-stellar-base 17.0.1 | Filed as StellarCN/py-stellar-base#1269. The maintainer closed it on 2026-11-16 as fixed on main, where #1268 moved the SDK onto stellar-xdr; the fix ships in the next major release; we verified all four shapes on main. |
Indexers: the wallet-backend replay
The kit includes a first replay adapter for Stellar's wallet-backend. It reproduces three real wallet-backend bugs on the commits before their fixes (#716, address truncation for muxed and signed-payload accounts; #729, CAP-40 signed-payload signers; #731, trustlines created through the Stellar Asset Contract) and passes on the fixed commits. That is the kind of check an indexer can run before every release.
What's next
We are building this toward the Stellar Community Fund RFP for an XDR and CAP coverage audit tool: a larger corpus tagged by CAP, the conformance job offered to each SDK, and an indexer-hardening guide. If you maintain a Stellar SDK or indexer and want your library in the matrix, open an issue on the repo.