# Introduction (/docs)

> A test kit for software that reads the Stellar ledger.

A test kit for software that reads the Stellar ledger: a corpus of rare but valid XDR shapes,
most of them recorded on a real stellar-core, a replay harness that feeds them to an indexer, a conformance
runner that feeds them to the JavaScript, Go, Rust, Python, Java, Dart, PHP, .NET and Kotlin Multiplatform SDKs, to
soroban-sdk, the Rust contract SDK, and to the `stellar xdr` commands of stellar-cli, a linter for Go indexer code, and an indexer-hardening guide.

Indexers and SDKs keep breaking on shapes that are valid but rare: signed-payload signers, muxed
accounts, deep Soroban authorization trees, trustlines created by the Stellar Asset Contract,
maps whose keys collide after conversion. Each team finds the same bugs on its own. shapekit is
the shared set of those shapes plus the tools to run them. It is built in response to the SDF
RFP "XDR/CAP-Coverage Audit Tool and Indexer-Hardening Guide", and covers protocol 30
(stellar-core 30.0.0, stellar-xdr v30.0).

The dated log of what has landed is [STATUS.md](https://github.com/ErenTopaal/shapekit/blob/main/STATUS.md). The technical architecture of every
part, its interfaces and pins, and how it connects to the Stellar network software are in
[Technical architecture](/docs/architecture).

- [Install](/docs/install): Release binaries and their checks, building from source, and the checks CI runs.

- [Quick start](/docs/quick-start): Commands for checking the corpus, running an SDK over it, replaying chains into an indexer, linting Go indexer code, applying the guide to stellar-docs and regenerating the corpus.

- [Technical architecture](/docs/architecture): This document describes the technical architecture of shapekit and how it connects to the Stellar network software.

## What is in it [#what-is-in-it]

| Part | Where | Documentation |
|---|---|---|
| Corpus: XDR files plus a language-neutral manifest with expected decoded values, generated under both the testnet and mainnet passphrases, checked against stellar-core's `--check-lcm` goldens | `corpus/` | [coverage per CAP](https://github.com/ErenTopaal/shapekit/blob/main/corpus/coverage/COVERAGE.md), [adding a shape](/docs/corpus/adding-a-shape) |
| Generator: recipes recorded on a standalone stellar-core on a Docker network with no route off the host | `crates/shapekit-gen`, `crates/shapekit-core-driver` | [adding a shape](/docs/corpus/adding-a-shape) |
| Replay harness, the wallet-backend reference adapter, adapters for stellar-etl and stellar-rpc, and the mapped adapter for PostgreSQL indexers | `crates/shapekit-harness`, `crates/shapekit-mapped`, `adapters/` | [adapter interface](/docs/harness/adapter-interface), [mapping file](/docs/harness/mapping-adapter), [replay server](/docs/harness/replay-server), [running it in an indexer's CI](/docs/harness/indexer-ci) |
| SDK conformance runner and the testees for the Rust, Go, JavaScript, Python, Java, Dart, PHP, .NET and Kotlin Multiplatform SDKs and soroban-sdk | `crates/shapekit-conformance`, `testees/`, `conformance/` | [testee protocol](/docs/sdk/testee-protocol), [running it in an SDK's CI](/docs/sdk/sdk-ci), [seeded faults](/docs/sdk/seeded-faults) |
| Fuzzing: stellar-xdr against go-stellar-sdk, a coverage-guided search across the Rust, Go and JavaScript SDKs, and each SDK's own fuzzer checked by the encoding laws | `crates/shapekit-fuzz`, `testees/*/fuzz` | [differential fuzzing](/docs/operations/differential-fuzzing) |
| Linter for Go indexers built on go-stellar-sdk | `lint/` | [indexerlint](/docs/linter/indexerlint) |
| Indexer-hardening guide, written for developers.stellar.org; a draft until a stellar-core or platform engineer has reviewed it (see the [guide publication gate](https://github.com/ErenTopaal/shapekit/blob/main/STATUS.md#guide-publication-gate)) | `docs/guide/` | [the guide](/docs/guide/indexer-hardening) |
| Findings from running the corpus, each with its severity, affected component and corpus entry | `findings/` | [findings report](https://github.com/ErenTopaal/shapekit/blob/main/findings/FINDINGS.md) |
| CI, releases, maintenance | `.github/workflows/` | [infrastructure](/docs/operations/infrastructure), [maintenance](/docs/operations/maintenance), [protocol upgrade runbook](/docs/operations/protocol-upgrade-runbook), [security policy](https://github.com/ErenTopaal/shapekit/blob/main/SECURITY.md) |

## Infrastructure and privacy [#infrastructure-and-privacy]

shapekit collects no telemetry. The few commands that use the network, and everything the
project runs on, are listed in [Infrastructure](/docs/operations/infrastructure).

## Maintenance [#maintenance]

Maintained by [Eren Topal](https://github.com/ErenTopaal) through the first protocol upgrade after delivery
(protocol 31). The upgrade runbook is already rehearsed against protocol 31 with core's
next-protocol build; the outputs are in `next/`. The rules for changes, triage and how SDKs pin
corpus releases, and the rehearsal, are in [Maintenance](/docs/operations/maintenance).

## License [#license]

Apache License 2.0, see [LICENSE](https://github.com/ErenTopaal/shapekit/blob/main/LICENSE) and [NOTICE](https://github.com/ErenTopaal/shapekit/blob/main/NOTICE).

## All pages [#all-pages]

- [Adding a shape](/docs/corpus/adding-a-shape): How to add a shape family to the corpus and generate its core-emitted entries.

- [Adapter interface](/docs/harness/adapter-interface): The replay harness (shapekit harness run) feeds recorded chains to an indexer and checks what the indexer stored against the meta oracle.

- [Connecting a PostgreSQL indexer with a mapping file](/docs/harness/mapping-adapter): The replay harness talks to an indexer through an adapter (adapter-interface.md).

- [Replay server](/docs/harness/replay-server): shapekit serve replays one recorded chain over HTTP.

- [Running the corpus in an indexer's CI](/docs/harness/indexer-ci): An indexer repository replays the chains of a pinned shapekit corpus release into the indexer it builds, on every pull request, and gets the harness verdicts for each corpus entry.

- [Testee protocol](/docs/sdk/testee-protocol): A testee is a small program that wraps one Stellar SDK at one exact version and answers requests from the conformance runner (shapekit conformance run).

- [Running the corpus in an SDK's CI](/docs/sdk/sdk-ci): An SDK repository runs the shapekit corpus against the SDK version it builds, on every pull request, with a pinned corpus release and its own list of known failures.

- [Seeded faults](/docs/sdk/seeded-faults): shapekit conformance seed-check measures how much of an SDK's behaviour the corpus actually watches.

- [Reading a run: shapekit report](/docs/results/report): shapekit report turns one harness run or one conformance run into a single HTML page you can open from disk, attach to an issue or keep as a CI artifact.

- [indexerlint](/docs/linter/indexerlint): indexerlint checks Go indexer code built on github.com/stellar/go-stellar-sdk for the three ingestion mistakes the indexer-hardening guide describes.

- [Indexer Hardening](/docs/guide/indexer-hardening): Which transaction fields stellar-core validates and which it passes through, depth and size caps for decoding ledger data, deriving participants from meta, and storing muxed and signed-payload addresses.

- [Infrastructure](/docs/operations/infrastructure): Everything shapekit's deliverables run on, what they talk to, and what they record about you (nothing).

- [Maintenance](/docs/operations/maintenance): This page says who maintains shapekit, for how long, and the rules every change follows.

- [Protocol upgrade runbook](/docs/operations/protocol-upgrade-runbook): The steps for taking shapekit to a new Stellar protocol version.

- [Differential fuzzing](/docs/operations/differential-fuzzing): shapekit fuzz feeds generated and mutated XDR values through two decoders and reports every input on which they disagree.

- [The website](/docs/operations/site): The shapekit.org website is built from site/.