OBT Part 6: Checking and tests
Version: v0 working draft, 30 November 2026 · Status: public working draft, open for comment · Editor: LJ (Tytle)
Intellectual Property Rights #
The text is licensed under CC BY 4.0, the code, schemas, test vectors and packs under Apache 2.0 (Part 9). The editors' company seeks no patent on what this document describes (decision of 28 November 2026). Part 9 gives the royalty-free promise of every contributor (Regulation (EU) No 1025/2012, Annex II).
Foreword #
This document is Part 6 of the Open Business Trust (OBT) family: Part 0 overview, Part 1 Business Key, Part 2 Agent Mandate, Part 3 Compliance Receipt, Part 4 Present, Part 5 trust registry, Part 6 checking and tests, Part 7 country annexes, Part 8 privacy and security, Part 9 governance, Part 10 legal references. It follows the skeleton of ETSI technical specifications so that it can be taken up as it stands.
Modal verbs terminology #
In the present document "shall", "shall not", "should", "should not", "may", "need not", "will", "will not", "can" and "cannot" are to be interpreted as described in clause 3.2 of the ETSI Drafting Rules (Verbal forms for the expression of provisions). "must" and "must not" are not used except in direct citation.
Executive summary #
- A checker answers one question about a receipt: may I rely on it? It gives one of four answers.
- It takes nine steps, in the order of Part 3 clause 8.2, and stops at the first step that fails.
- It needs the network only for the status list and, when the holder has none, a revocation list. It never asks the issuer.
- Every rule has test vectors as plain data files. A checker in any language tests itself against them.
- A VAT engine is tested with public case packs. Each case's answer comes from the law, or from the European Commission's own published examples, never from an engine's answer.
- The engine's maker runs the packs and signs the report. OBT lists the engine when the report passes.
- A report gives counts for each pack. It never gives one number for an engine.
Introduction #
A receipt is only worth what a check of it proves. Part 3 defines the receipt and the steps of its check. This part makes the check testable: it states what each step can answer, gives the vectors a checker runs, and says when a checker, a VAT engine or an issuer conforms. Everything here is built, and every rule has a test that fails when the code and the text part.
1 Scope #
The present document specifies:
- the answers of a receipt check (the verdict and its completeness), and the outcomes of each step with their codes (clause 5);
- the test vectors of the receipt's claims, of signed receipts and of the e-invoice binding, and when a checker conforms to them (clause 6);
- the VAT conformance packs, how a case is judged, the signed report and the levels of a listed engine (clause 7);
- the conformance of a checker, a VAT engine and an issuer (clause 8).
It does not specify the receipt (Part 3), the country rules (Part 7) or the legal reference (Part 10). The check of a Business Key (Part 1) comes with its build [open]. Who may say "OBT conformant" is Part 9.
2 References #
2.1 Normative references #
- [1] OBT Part 3: "Compliance Receipt" (
obt-part3-compliance-receipt.md): clause 8 (presentation and the check), Annex A (the schema and the code lists). - [2] OBT Part 7: the country annexes (Portugal:
obt-part7-pt-annex.md). - [3] IETF RFC 7515 (JWS), RFC 7518 (JWA), RFC 7638 (JWK thumbprint).
- [4] JSON Schema, draft 2020-12.
2.2 Informative references #
3 Definition of terms, symbols and abbreviations #
3.1 Terms #
- checker: software that runs the check of Part 3 clause 8.2 on a receipt for a relying party.
- verdict: the checker's one answer about a receipt (clause 5.1).
- step: one of the checks of Part 3 clause 8.2, as clause 5.2 splits them. A step passes, fails or is not run.
- test vector: an input and the answer it shall get, as a plain data file.
- pack: a set of VAT cases, each with its facts, its date, the expected decision and the law it rests on.
- adapter: the function an engine's maker writes so the runner can ask the engine each case.
- report: the result of one run of the packs against one engine version.
3.2 Abbreviations #
- CRL: certificate revocation list.
- JWS: JSON Web Signature.
- TSA: time-stamping authority.
4 General concepts #
4.1 Actors #
| Actor | Role here |
|---|
| Relying party | Wants to know if a receipt can be relied on. Runs a checker, or the OBT landing page's checker. |
| Holder | Holds the receipt (the seller, the buyer or their agent). Gives the checker the receipt, the time stamp and the document. |
| Issuer | Made the receipt. A checker never contacts it (Part 3 OBT-RCP-8-01). |
| Engine's maker | Writes an adapter, runs the packs and signs the report. |
| OBT editors | Publish the vectors, the packs and the list of tested engines. |
4.2 What a checker reads #
| Input | Where it comes from | Needed for |
|---|
| The receipt | The holder | Every step |
| The OBT issuer list (trust anchors, and for each the issuers it lists) | The OBT host | header; without it every issuer is unknown |
| The receipt rules (Annex A.1, clause 5, the country annex) | The rules bundle, or a checker's own code | claims |
| The type metadata file | The URL vct names; it may be cached for ever | type |
| The status list | Fetched from status.status_list.uri | status |
| The time stamp, and the trusted TSAs | The holder (<address>/timestamp); the TSA list | timestamp |
| CRLs | The holder first; otherwise the seal's CRL distribution point | revocation |
| The document in hand | The holder | binding |
An input that is not given makes its step "not run" (clause 5.1). A check is then not complete, and says so.
5 The receipt check #
5.1 The verdict #
| Verdict | It means | A relying party |
|---|
valid | Every step that ran passed, the chain reaches the OBT issuer list, and the status is valid. | May rely on the receipt, within what complete says. |
unknown_issuer | Every step that ran passed, but the chain does not reach the OBT issuer list. | Is told "signed by an unknown issuer", never "valid" (Part 3 OBT-RCP-8-02). |
do_not_rely | The receipt is sound, but its status is not valid: invalid, suspended, withdrawn, replaced, or a value the checker does not know. | Does not rely on it. A withdrawn receipt's document still stands until a note corrects it. |
not_valid | A step failed. | Does not rely on it. |
| Id | Requirement |
|---|
| OBT-CHK-5.1-01 | A checker shall give exactly one of the four verdicts. |
| OBT-CHK-5.1-02 | A checker shall stop at the first step that fails (clause 5.2, "stops"), and give not_valid. |
| OBT-CHK-5.1-03 | A checker shall say whether the check is complete: every step of clause 5.2 run, none "not run". A check without the time stamp, the status list or the document is not complete. |
| OBT-CHK-5.1-04 | A checker shall not show valid for an incomplete check without saying which steps did not run. |
| OBT-CHK-5.1-05 | A checker shall not contact the issuer (Part 3 OBT-RCP-8-01). It fetches only the status list, a CRL and, once, the type metadata. |
5.2 The steps and their codes #
Each step has one of three results: passed, failed, or not run (the reference checker writes ok as true, false or null). The codes are the reference checker's [i.1]. Clause 6.2 makes the verdict and its completeness normative; a checker should use these codes for its steps, and may add its own words.
| Step | Part 3 clause 8.2 | Passed | Failed, and the check stops | Failed, and the check goes on | Not run |
|---|
parse | 1 | ok | key_binding (a receipt carries no key binding JWT), malformed | - | - |
header | 2 | ok | bad_header (typ, alg, x5c, or the header's iat not the claims'), bad_certificate, bad_chain | unknown_issuer (the chain does not reach the issuer list) | - |
signature | 3 | ok | bad_signature, iss_not_bound (iss or iss_reg_id not the certificate's) | - | - |
timestamp | 4 | ok | bad_timestamp | - | not_run (none given), unknown_tsa, unsupported_timestamp (the chain is then checked at the current time) |
revocation | 4 (10-07) | ok | seal_revoked | - | not_run (an unknown issuer), not_checked (no CRL covers the time) |
disclosures | 5 | ok | bad_disclosure | - | - |
claims | 5 | ok | bad_claims (the first reasons of the receipt rules) | - | not_run (no rules given) |
type | 6 | ok | bad_type | - | not_run (no type metadata given) |
time | 7 | ok | out_of_time (nbf, exp) | - | - |
status | 8 | ok | no_status, bad_status_list | status_invalid, status_suspended, status_withdrawn, status_replaced, status_unknown (the verdict is then do_not_rely) | not_run, unreachable |
binding | 9 | ok | other_document, einvoice_mismatch, xml_unreadable, gobl_rules_off | - | not_run (no document given), gobl_unconfirmed (the envelope names the receipt; its body is not confirmed) |
| Id | Requirement |
|---|
| OBT-CHK-5.2-01 | A checker shall take the steps in the order of the table. A step that needs an earlier step's result (the chain, the claims) shall not run before it. |
| OBT-CHK-5.2-02 | A checker shall read the time stamp before it checks the chain, and check the chain at the time-stamp time when the stamp is good and its TSA trusted (Part 3 OBT-RCP-10-04). With no good stamp from a trusted TSA it checks the chain at the current time, and the timestamp step is not run. |
| OBT-CHK-5.2-03 | binding (Part 3 clause 8.2 step 9): the file's SHA-256 against file_sha256; an e-invoice by the hash of its business document in canonical form, then the entry's syntax, specification and process against the XML (Part 3 OBT-RCP-5.3-18, 5.3-19); a GOBL envelope by its uuid and dig. An XML the checker cannot read is xml_unreadable with the reason, never other_document. |
| OBT-CHK-5.2-04 | A checker shall bound what it reads: the reference checker reads a chain of at most five certificates, a status list that inflates to at most 1 MiB, an XML of at most 256 levels, and refuses an XML with a DOCTYPE. A checker that reads less says "not run" or fails; it never passes a step it did not finish. |
6 Test vectors #
6.1 The receipt's claims #
receipt-v0/vectors.json (format obt-receipt-claim-vectors/v0 in its format member, made by receipt-v0/make-vectors.mjs, never by hand): the example receipt's claims, each valid variant, and each broken copy. A broken copy names refused_by: the rule that refuses it (an OBT rule id), or schema when the JSON Schema of Part 3 Annex A.1 refuses it, and then also rule, the rule of the text it breaks.
| Id | Requirement |
|---|
| OBT-CHK-6.1-01 | A checker's claim rules conform when they accept every vector of valid, and refuse every vector of invalid with its refused_by among their reasons, or, for schema, with its rule. The order of the reasons is the checker's own. |
| OBT-CHK-6.1-02 | A new rule of Part 3 or of a country annex comes with at least one broken copy that only it refuses, in the same change. |
6.2 Signed receipts #
packages/obt-checker/fixtures/vectors.json (format obt-receipt-vectors/v0): each vector names a signed receipt of that folder and the inputs a checker is given (a member left out takes defaults; a status list of null cannot be read; a document of null is not in hand), and what the check makes of it: expect.verdict, expect.complete and expect.steps, the steps that did not pass with the reference checker's codes. Everything there is an EXAMPLE: the authorities, the issuer and the receipts are not real, and a test receipt is not a receipt (Part 3 OBT-RCP-10-05).
The vectors hold, among others: a receipt changed after it was sealed; a seal signed by another issuer's seal; a self-signed seal; the root in x5c; a chain longer than its path length; an unknown critical extension; an expired seal, and a revoked seal, each with and without the stamp of its time; a key compromise from before the stamp; each kind of bad time stamp, and a stamp from an authority on no list; a cancelled status and a reserved status value; a status list of another issuer or with no exp; CRLs that are expired, signed by another key or carry a critical extension the checker does not apply; an issuer list without the authority, and one that pins another issuer; and another document in hand.
| Id | Requirement |
|---|
| OBT-CHK-6.2-01 | A checker conforms when it gives each vector's expect.verdict and expect.complete. expect.steps is exact for the reference checker and informative for another. |
| OBT-CHK-6.2-02 | A new code of clause 5.2 that a signed input can reach comes with a vector in the same change. |
6.3 The e-invoice binding #
packages/obt-checker/fixtures/xml/: e-invoices that each hit a hard case of the canonical form (an envelope, an undone default namespace, a prefix bound again below, CDATA, references, tabs and line feeds in an attribute, a processing instruction, ISO-8859-1), and four that a checker refuses (a DOCTYPE, an encoding it does not read, an undeclared prefix, no invoice). expected.json gives, for each readable file and for each of CIUS-PT's own samples, the SHA-256 of its business document in Exclusive XML Canonicalization, as two other implementations write it (libxml2 and xml-crypto), never as the reference checker does.
| Id | Requirement |
|---|
| OBT-CHK-6.3-01 | A checker that binds e-invoices conforms when it writes each file's hash of expected.json, writes the same hash for an invoice alone and inside its envelope, and refuses each refused- file. |
6.4 The legal reference #
A checker that reads the optional ref of a law entry conforms to LexPin's own vectors [i.3]: each valid string to its parts, each refused string to its error, each printed label to its label.
7 The VAT conformance packs #
7.1 The packs #
| Pack | What it tests |
|---|
eu-core | Where a supply is taxed, by whom and how: Directive 2006/112/EC Title V, Arts. 138, 195 and 196, the Union OSS, the travel agents' margin scheme. |
honesty | A fact the decision turns on is missing: the engine says provisional or asks, and never guesses. |
eu-commission | The European Commission's own worked examples: its Explanatory Notes and guides. |
pt | Portugal: the regional rates, the lists of reduced rates and AT's doctrine on them, the exemptions. |
Each case gives the facts in OBT's closed fact words [i.2], the date, the expected decision in Part 3's words, and rests_on, the law it comes from. A case may give sources: the law's exact words it rests on, the file that holds them, and optionally ref, the place in the act as a LexPin. The tests cover tax points from 1 January 2025.
| Id | Requirement |
|---|
| OBT-CHK-7.1-01 | An expected answer comes from the law, or from the European Commission's own published examples of applying it (its explanatory notes and guides, with its own conclusion as the answer), never from an engine's output. |
| OBT-CHK-7.1-02 | An engine receives the facts and the date only, never rests_on or sources. |
| OBT-CHK-7.1-03 | A pack uses only the closed fact words and Part 3's words. A pack with any other word is refused, so packs stay engine-neutral. |
| OBT-CHK-7.1-04 | A case's quote shall stand in its file exactly once, at its ref when it has one. The pack's publisher tests that. |
7.2 How a case is judged #
The engine answers decided, provisional or needs_facts, with its decision or the facts it needs. The runner compares the answer with the expected decision, member by member.
| Id | Requirement |
|---|
| OBT-CHK-7.2-01 | A case passes when every member of the expected decision holds in the answer. |
| OBT-CHK-7.2-02 | A citation is exact at the narrowest part of the article that is a rule of its own, or inside it. A citation of the article that holds that part is less exact: the case still passes, and the result says less_exact. A citation beside it, or none, fails. |
| OBT-CHK-7.2-03 | A report gives two counts for each pack: passed (the decision right) and exact (right, every citation at the law's own rule). It never gives one number for an engine. |
7.3 The report #
| Id | Requirement |
|---|
| OBT-CHK-7.3-01 | A report (obt-vat-conformance-report/v0) names the engine (id, version, data, as its receipts name them), each pack with its version and SHA-256, and each case's result. A run whose engine changes between cases says so (engine_changed). One report covers one engine version. |
| OBT-CHK-7.3-02 | The engine's maker signs its own report with its own key: a compact JWS [3] with alg ES256, typ obt-vat-conformance-report+jws, and kid the RFC 7638 thumbprint of the key. OBT gives out no keys. |
7.4 The levels of a listed engine #
| Level | Who runs the packs | Who signs | Needed |
|---|
| 1 | The engine's maker, with its adapter | The maker | eu-core and honesty passed in full |
| 2 | OBT, against the live engine (its endpoint) | OBT | as Level 1 [open]: not built |
A third level, a measured engine in a trusted execution environment, is planned and not built.
| Id | Requirement |
|---|
| OBT-CHK-7.4-01 | An entry of the list of tested engines names the engine, the level, the company with its public key, and the report's file and SHA-256. The list refuses an entry whose file, hash, signature or engine does not match, or whose report does not pass the level's packs in full. |
| OBT-CHK-7.4-02 | A receipt's engine (Part 3, engine) is tested when the list holds that id, version and data. |
| OBT-CHK-7.4-03 | [open] Whether a level for a country also needs that country's pack in full. Today a report shows each country pack's counts beside the levels' packs. |
8 Conformance #
| Id | Requirement |
|---|
| OBT-CHK-8-01 | A checker conforms when it meets clauses 5.1 and 5.2 and gives the answers of clauses 6.1 and 6.2, and of 6.3 and 6.4 when it binds e-invoices or reads legal references. |
| OBT-CHK-8-02 | A VAT engine version is tested at a level when the list of tested engines holds it at that level (clause 7.4). |
| OBT-CHK-8-03 | An issuer conforms when every receipt it makes passes its own run of the receipt rules before it signs, the engine its receipts name is tested at Level 1 or above, and its receipts give valid with a conforming checker. [open]: a public test of an issuer from end to end (documents in, receipts out, each checked) is not written. |
| OBT-CHK-8-04 | Who may say "OBT conformant", and of what, is Part 9. |
9 Security considerations [SEC] #
| Threat | Control |
|---|
| A fixture's example authority or key is trusted as real | Everything in the vectors is an example; no list of trusted issuers names it; a test receipt is not a receipt (Part 3 OBT-RCP-10-05). |
| A crafted input makes a checker read without end | The read limits of OBT-CHK-5.2-04; a step a checker did not finish never passes. |
| A checker is tricked into contacting the issuer, so the issuer learns which credential is checked, and by whom | OBT-CHK-5.1-05: the status list, a CRL and the type metadata only. |
| A report overstates an engine | A report is signed by its maker, covers one engine version and gives counts per pack; the list re-checks its file, hash, signature and level (OBT-CHK-7.4-01). |
10 Privacy considerations [PRIV] #
The vectors and the packs hold no personal data: their tax numbers are examples, and a case's facts name no person. A report names an engine and the company that ran it, never a client of that company. A checker that runs in a browser sends the receipt and the document nowhere.
Annex A (informative): the reference implementations and their tests #
| What | Where | Its own test |
|---|
| The checker (clause 5) | packages/obt-checker/src/index.mjs | test/checker.test.ts, test/vectors.test.ts |
| The time stamp reader | packages/obt-checker/src/timestamp.mjs | test/checker.test.ts |
| The e-invoice canonical form | packages/obt-checker/src/xmlCanonical.mjs | test/xmlCanonical.test.ts |
| The receipt rules | packages/receipt-rules: the claims check, the law entry's legal reference, the schema, and the receipt in words; bundled for a browser as packages/obt-checker/rules/receipt-rules.mjs | its npm test (the claim vectors); the bundle: it is today's, and it answers as the package does |
| The claim vectors | receipt-v0/make-vectors.mjs, check-negatives.mjs | make-vectors.mjs --check |
| The signed vectors | Made by the first issuer's own software (signing, status list, time stamp), which is not part of this repository | test/vectors.test.ts |
| The canonical-form answers | Written by libxml2 (xmllint) and xml-crypto, never by the checker, with a script that is not part of this repository | test/xmlCanonical.test.ts |
| The packs and the runner | packages/obt-vat-conformance | its npm test; the publisher's source test |
| The list of tested engines | checkImplementations in packages/obt-vat-conformance | the landing page's build |
History #
| Version | Date | Change |
|---|
| v0 working draft | 1 December 2026 | Annex A: the receipt rules are a package of their own (packages/receipt-rules), with the receipt in words. |
| v0 working draft | 30 November 2026 | Clauses 9 and 10: security and privacy considerations (Part 0 principle E2). |
| v0 working draft | 30 November 2026 | First text, from what is built: the verdicts and the steps with their codes (clause 5), the three sets of test vectors and the legal reference's (clause 6), the VAT packs, how a case is judged, the signed report and the levels (clause 7), conformance (clause 8). Open: the Business Key's check, Level 2, a level's country packs, an issuer's end-to-end test. |
| v0 working draft | 2 December 2026 | OBT-CHK-7.1-01 and the executive summary name the second source of expected answers that the packs use: the European Commission's own worked examples (the pack eu-commission). A threat row says what a call home would show the issuer, instead of "who checks". |
| v0 working draft | 2 December 2026 | Published as a public working draft, open for comment (the status line; it said "not published"). |