Build with OSPP › The standard

Conformance kit

Run your passport verifier against the official ospp.v1 vectors with one command, get a report, and show the badge.

What conformance means#

An implementation conforms to OSPP Protocol 1 when it returns the expected result for every rule, V-01 to V-16, on every passport in the official vectors, positive and negative cases alike. That is section 10 of the specification. The kit runs the 27 core cases. They do not exercise V-12, V-13, V-15 or V-16 beyond NOT_APPLICABLE; the vectors download also has passports for V-12 (effort-vectors.json) and V-16 (adr012-vectors.json) that you can run by hand. The V-16 cases need the issuer keys that governance revoked: the TypeScript verifier takes them as --revoked-issuer=KEY_ID@TIME; the Python command line has no such option, so run those cases with the TypeScript verifier or through the Python library. The vectors include valid passports and deliberately broken ones: a tampered claim, an altered inclusion proof, a smuggled field, a missing client signature, a cosignature that does not count, a history chain that breaks.

Both reference verifiers pass all 27 cases of the current vectors.

Run it#

The runner is one Python file with no dependencies (Python 3.10 or later). It fetches the published vectors, runs your verifier once per case, and compares every rule.

curl -O https://www.ospp.it.com/build/downloads/ospp_conformance.py
python3 ospp_conformance.py --report report.json -- <your verifier command>

Your verifier is called as <command> <file.ospp> --json, with --trusted-issuer=<key ids> added for the case that pins the issuer. It must print JSON with a rules list of {"rule": "V-01", "result": "VALID"} objects, where a result is VALID, INVALID, UNDETERMINED or NOT_APPLICABLE. That is the shape both reference verifiers print, so either can be used as a model.

To see the kit pass, run it on a reference verifier:

# the TypeScript reference verifier, one file, Node 20 or later
curl -O https://www.ospp.it.com/build/downloads/ospp-verify.mjs
python3 ospp_conformance.py -- node ospp-verify.mjs

# the Python reference verifier, Python 3.12 or later
pip install https://www.ospp.it.com/build/downloads/ospp_protocol-0.1.1-py3-none-any.whl https://www.ospp.it.com/build/downloads/ospp_verifier-0.1.1-py3-none-any.whl
python3 ospp_conformance.py -- ospp-verify

To test against a local copy of the vectors, add --vectors ospp-v1-vectors.json.

The report#

--report writes a JSON file with the vectors' version and SHA-256, your command, every case with any differences, and the outcome. It is what you attach when you ask to have an implementation listed. The runner exits 0 only when every case passes.

Beyond the passport rules#

The core vectors file also holds cases for the building blocks: canonical JSON (RFC 8785), commitments (three labels, and a check that a wrong label gives a different value), key ids, the signature envelope, Merkle proofs and C2SP checkpoints and the opening of history payloads. The full vectors zip adds delegation, freshness, measurements, effort baselines, node definitions and the expression language. An implementation that only verifies passports does not need these, but they are the fastest way to find a mistake in a primitive.

The badge#

A conformant implementation may show this badge, linked to its listing:

OSPP ospp.v1: conformant

<a href="https://www.ospp.it.com/build/tools/implementations/"><img src="https://www.ospp.it.com/build/badges/ospp-conformant.svg" alt="OSPP ospp.v1: conformant"></a>

The badge states conformance to the vectors named in the report. When OSPP publishes a new vectors version, run the kit again.