| Internet-Draft | Quantity Verification | November 2026 |
| Watts | Expires 20 May 2027 | [Page] |
This document defines a JSON representation for scientific quantities (a decimal value, a unit, and an optional measurement uncertainty) and a binding by which a computed quantity names, by cryptographic digest, the exact input quantities, operation and arithmetic rules it was derived with. It also defines a fail-closed procedure by which a verifier recomputes the value, checks the unit relationship and, for one named method, recomputes the uncertainty, and reports a separate verdict for each aspect. A passing result means only that the stated numbers follow from the stated inputs under the stated rules. It does not establish that a measurement was valid, that the inputs are true, or that any scientific conclusion follows.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 20 May 2027.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
Scientific results are routinely produced by chains of small calculations: lengths are summed, a mass is divided by a volume, uncertainties are combined. When such results are exchanged as JSON, the numbers usually travel as JSON numbers (which many parsers read as IEEE 754 binary64), units travel as free text, uncertainty is absent or informal, and the derivation lives in prose or in code that is not tied to the data it ran on.¶
Three problems follow. A derived number cannot be rechecked mechanically against its inputs, because the inputs are named but not pinned. An input that changes after the derivation cannot be detected. And where a result carries a "verified" flag, the flag rarely says what was verified: a record that is well formed, a record whose arithmetic reproduces, and a record that is scientifically sound are three different claims, and a single flag that merges them overstates what was checked.¶
In short, the value, unit and uncertainty members are not new, and a deployment with an existing representation should keep it. The contribution of this document is narrower: (1) a digest-bound trace for a single numeric derivation; (2) a verification procedure with per-aspect, fail-closed verdicts, including an explicit NOT_VERIFIABLE; and (3) the rule in Section 7.7 that a numeric verdict is not a claim about the science.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
ref. It is outside this document.¶
Several members hold identifiers: operation identifiers, method identifiers and unit schemes. An identifier is a non-empty string. An identifier without a colon is defined by this document or a successor and MUST be one of the values it defines. An identifier containing a colon MUST be an absolute URI [RFC3986] and is an extension point. Identifiers are compared octet for octet.¶
A Quantity Record is a JSON object [RFC8259] that conforms to I-JSON [RFC7493]; in particular it MUST NOT contain duplicate member names. The members are:¶
| Member | Presence | Value |
|---|---|---|
| version | REQUIRED | The string "0.1". |
| quantity_id | REQUIRED | Non-empty string identifying the quantity. Uniqueness is not checked by this document. |
| quantity_kind | OPTIONAL | String naming the kind of quantity, such as "length". Informational. |
| basis | REQUIRED | One of "measured", "computed", "assumed", "reference" (Section 4.6). |
| value | REQUIRED | Decimal numeral held in a string (Section 4.2). |
| unit | REQUIRED | Object (Section 4.3). |
| uncertainty | OPTIONAL | Object (Section 4.4). |
| trace | REQUIRED if basis is "computed", otherwise MUST NOT be present | Trace Binding (Section 5). |
| annotations | OPTIONAL | Any JSON object. Informational. |
A Quantity Record MUST NOT contain a member that is not listed above. The same closed-member rule applies to every nested object defined in this document except annotations. Extension data belongs in annotations, whose content is covered by the digest (Section 6) but MUST NOT influence any verdict. Changes to the set of members, or to the meaning of any member, are made by changing version.¶
The members quantity_kind and role (Section 5.3), and the content of annotations, MUST NOT be used to decide any verdict.¶
A decimal numeral is a string matching the following ABNF [RFC5234], which is the JSON number grammar of [RFC8259] held in a string:¶
decimal = [ "-" ] nonneg nonneg = int [ frac ] [ exp ] int = "0" / ( %x31-39 *DIGIT ) frac = "." 1*DIGIT exp = ( %x65 / %x45 ) [ "-" / "+" ] 1*DIGIT¶
A leading "+", leading zeros, a leading or trailing ".", hexadecimal, "NaN" and "Infinity" are not decimal numerals. The value of a decimal numeral is the exact rational number it denotes; "-0" denotes zero. Members documented as "non-negative" take the nonneg form; members documented as "positive" take the nonneg form with a value greater than zero.¶
Numbers are held in strings for three reasons:¶
The only JSON number in a Quantity Record is the integer precision (Section 5.4).¶
unit is an object with two members, both non-empty strings: scheme and code. This document defines one scheme, "ucum", for which code is a case-sensitive expression of [UCUM] (for example "mm", "g/cm3" or "1"). Any other scheme MUST be an absolute URI (Section 3.3).¶
Two units are identical if and only if their scheme and code are equal octet for octet. No normalization is applied: "mm" and "mm " are different units. The unit describes the value; it is not checked against quantity_kind.¶
uncertainty is an object with these members:¶
value is a standard uncertainty (GUM 2.3.1). "expanded": value is an expanded uncertainty U = k u (GUM 2.3.5), with k given by coverage_factor. No coverage probability is asserted.¶
form is "expanded"; MUST NOT be present otherwise.¶
value was derived from the inputs' uncertainties. Permitted only when basis is "computed". This document defines "gum-first-order-independent" (Section 7.5). If method is absent the record makes no claim about how the uncertainty was obtained, and the uncertainty aspect is NOT_CLAIMED.¶
value with the recomputed uncertainty. If absent the comparison is exact.¶
An uncertainty obtained by measurement or by judgement (Type A or Type B evaluation in GUM terms) has no method in this version, because nothing here can recompute it.¶
A tolerance object has a mode and, for two modes, a value that is a non-negative decimal numeral tau:¶
value MUST be absent. The declared and recomputed numbers must be equal.¶
A tolerance is chosen by the producer of the record. A consumer that relies on a bounded tolerance needs its own policy (Section 10).¶
trace.¶
basis is a statement by the producer. This document does not verify it, except that "computed" selects the recomputation of Section 7.¶
The trace of a computed quantity is an object with these members: operation (REQUIRED, Section 5.2), inputs (REQUIRED, Section 5.3), arithmetic (REQUIRED, Section 5.4) and tolerance (OPTIONAL, Section 4.5, applied to the value; if absent the comparison is exact).¶
operation is an object with id and, for extension operations, digest. The core operations are binary and take their operands in the order of inputs:¶
| id | Result |
|---|---|
| add | inputs[0] + inputs[1] |
| sub | inputs[0] - inputs[1] |
| mul | inputs[0] * inputs[1] |
| div | inputs[0] / inputs[1] |
An extension operation is identified by an absolute URI and MUST carry a digest (Section 6) of the artifact that defines it, such as a specification or an executable. Core operations MUST NOT carry a digest. The digest pins which definition the producer meant; it does not give a verifier the ability to run it. A verifier executes only operations it already implements, selected by the pair (id, digest), reports NOT_VERIFIABLE for any other, and MUST NOT fetch and run code named by a record.¶
inputs is a non-empty array of objects; for core operations it has exactly two elements. Each element has:¶
{"alg", "value"} (Section 6) holding the digest of the input Quantity Record.¶
arithmetic states how the recomputed value is formed from the exact values of the inputs. It has a domain:¶
precision and rounding MUST be absent.¶
precision significant decimal digits, using rounding. precision is an integer from 1 to 2^53 - 1. rounding is one of "half-even" (nearest, ties to the even digit), "half-up" (nearest, ties away from zero), "down" (toward zero) or "up" (away from zero).¶
Each core operation is a single step, so there is no intermediate rounding. The exponent range is unbounded in the definition; implementations impose limits (Section 7.6). Binary floating-point arithmetic is not defined in this version (Section 14).¶
The canonical form of a Quantity Record is its serialization under the JSON Canonicalization Scheme [RFC8785]. Because the only JSON number in a Quantity Record is the integer precision, differences in number serialization cannot arise. Member names and string values are serialized as UTF-8 text; no Unicode normalization is applied.¶
The digest of a Quantity Record is SHA-256 [RFC6234] over the UTF-8 octets of its canonical form. A digest object has two members: alg, identifying the hash algorithm, and value. This document defines the alg value "sha-256", for which value is the 32 octets of the digest as 64 lowercase hexadecimal characters:¶
hexdigest = 64( %x30-39 / %x61-66 )¶
A verifier that does not support the algorithm named MUST NOT substitute another algorithm. It reports NOT_VERIFIABLE (DIGEST_ALG_UNSUPPORTED). Later versions may define further algorithms.¶
A digest binds the content of a record. It does not authenticate who produced it (Section 10).¶
A verifier reports a verdict for each of six aspects: schema, basis, inputs, unit, value and uncertainty.¶
| Verdict | Meaning |
|---|---|
| PASS | The aspect was checked and holds. |
| FAIL | The aspect was checked and does not hold, or the record is malformed. |
| NOT_VERIFIABLE | The verifier could not decide: an input is unavailable, a feature is unsupported, or a resource limit was reached. |
| NOT_CLAIMED | The record makes no assertion that this aspect could check. Used only for the uncertainty aspect. |
The overall verdict is FAILED if any aspect is FAIL; otherwise NOT_VERIFIABLE if any aspect is NOT_VERIFIABLE; otherwise VERIFIED. An aspect that is NOT_CLAIMED does not prevent VERIFIED, so a consumer MUST read the per-aspect verdicts and MUST NOT read VERIFIED as covering an aspect reported as NOT_CLAIMED.¶
The procedure fails closed: VERIFIED is produced only when every aspect that applies was positively decided PASS. Any inability to decide yields NOT_VERIFIABLE, never PASS.¶
The inputs to a verifier are the octets of the subject and a resolver. The verifier performs the following steps in order. An aspect that cannot be decided because an earlier aspect was not PASS is reported NOT_VERIFIABLE with reason PREREQUISITE_NOT_MET. Once the inputs have been resolved, the unit, value and uncertainty aspects are evaluated independently: a FAIL in one MUST NOT prevent the others from being evaluated.¶
Parse. Parse the octets as JSON. If any object contains a duplicate member name, the schema aspect is FAIL (DUPLICATE_MEMBER). If parsing fails for any other reason, if the text contains a JSON number that is not an integer, or if it contains NaN or Infinity, the schema aspect is FAIL (SCHEMA_INVALID). In both cases the verifier computes the subject digest over the received octets and marks the subject as not canonical (Section 8), and the remaining aspects are PREREQUISITE_NOT_MET.¶
Version. If version is a string other than one the verifier supports, the schema aspect is NOT_VERIFIABLE (VERSION_UNSUPPORTED).¶
Schema. Check the record against Section 4 and Section 5, including the closed-member rule. Failure is FAIL (SCHEMA_INVALID); otherwise PASS.¶
Basis. If basis is not "computed", the basis aspect is NOT_VERIFIABLE (BASIS_NOT_COMPUTED): nothing is recomputed, so the verifier MUST NOT report VERIFIED. Otherwise PASS.¶
Inputs. For each input in order: obtain its octets from the resolver (if unavailable, NOT_VERIFIABLE with INPUT_UNAVAILABLE); if the digest alg is unsupported, NOT_VERIFIABLE with DIGEST_ALG_UNSUPPORTED; parse the octets and compute the digest of the result's canonical form (if the octets do not parse as an I-JSON object, or the digest differs from the pinned value, FAIL with INPUT_DIGEST_MISMATCH); if the input's version is unsupported, NOT_VERIFIABLE with VERSION_UNSUPPORTED; if the input is not a valid Quantity Record, FAIL with INPUT_SCHEMA_INVALID. The aspect is FAIL if any input is FAIL, otherwise NOT_VERIFIABLE if any is NOT_VERIFIABLE, otherwise PASS; the reason reported is the first of the deciding kind in input order. The verifier MUST compute the digest over exactly the content it then uses.¶
Operation. If the operation is an extension operation that the verifier does not implement for the given (id, digest), the unit and value aspects are NOT_VERIFIABLE (OPERATION_UNSUPPORTED). The uncertainty aspect is NOT_VERIFIABLE (OPERATION_UNSUPPORTED) if the subject declares an uncertainty method, otherwise NOT_CLAIMED. The procedure ends.¶
Unit, value and uncertainty. Evaluate Section 7.3, Section 7.4 and Section 7.5.¶
Verification is one hop. The verifier does not verify the inputs' own traces, and the verdict for a subject does not depend on whether its inputs are themselves computed correctly (Section 7.7).¶
For add and sub, the subject and both inputs MUST carry identical units (Section 4.3). Otherwise the aspect is FAIL (UNIT_MISMATCH). This version defines no unit conversion: a conversion is its own computed quantity under an extension operation.¶
For mul and div, the verifier needs unit algebra. If the three units all use the scheme "ucum" and the verifier supports the expressions involved, it reduces each unit to a pair (dimension vector, scale factor) relative to the UCUM base units. For mul the subject's pair MUST equal the product of the inputs' pairs (dimension vectors added, scale factors multiplied); for div, the quotient (dimension vectors subtracted, scale factors divided). Scale factors are compared exactly. Equality gives PASS and inequality gives FAIL (UNIT_MISMATCH). Comparing scale factors, and not only dimensions, is essential: the value recomputation applies no conversion, so a result whose unit differs from the combined input units by a power of ten is wrong even when its dimension is right (see vector QV-24 in Appendix A.3).¶
If any unit uses another scheme, or an expression the verifier cannot reduce exactly (for example a non-multiplicative unit such as a temperature on the Celsius scale, an arbitrary unit, or a unit whose definition involves an irrational constant), the aspect is NOT_VERIFIABLE (UNIT_ALGEBRA_UNSUPPORTED). A verifier MUST NOT approximate.¶
Let a and b be the exact values of inputs[0] and inputs[1], and let r be the recomputed value defined by Section 5.4:¶
If the subject has no uncertainty member, or its uncertainty has no method, the aspect is NOT_CLAIMED. If the method is not one the verifier implements, the aspect is NOT_VERIFIABLE (METHOD_UNSUPPORTED). If an input has no uncertainty member, the aspect is NOT_VERIFIABLE (INPUT_UNCERTAINTY_MISSING). If an input's value makes the method undefined (div with a zero divisor), the aspect is NOT_VERIFIABLE (PREREQUISITE_NOT_MET).¶
This document defines one method, "gum-first-order-independent". It is the first-order law of propagation of uncertainty (GUM 5.1.2) for uncorrelated inputs. Let x1 and x2 be the values of the inputs, and u1 and u2 their standard uncertainties (an expanded uncertainty is divided by its coverage factor). Define S exactly, in rational arithmetic, as the sum of the squared products of each sensitivity coefficient and its standard uncertainty:¶
add, sub: S = u1^2 + u2^2 mul: S = (x2*u1)^2 + (x1*u2)^2 div: S = (u1/x2)^2 + (x1*u2/x2^2)^2¶
The reference uncertainty on the scale of the declared uncertainty is R = k * sqrt(S), with k = 1 for form "standard" and k equal to the coverage factor for form "expanded". Let D be the declared uncertainty value. The verifier decides whether D matches R under the uncertainty's tolerance exactly, without evaluating the square root in finite precision. Because D and R are non-negative, each comparison is equivalent to one on squares, with K = k^2 * S:¶
A match gives PASS, with match "exact" if D^2 = K and "within_tolerance" otherwise; no match gives FAIL (UNCERTAINTY_MISMATCH). A square root is generally irrational, so an exact comparison succeeds only when R is a rational number; a producer whose uncertainty is not exactly representable SHOULD declare an explicit tolerance. A verifier MAY report in recomputed a decimal approximation of R; the verdict MUST NOT depend on it.¶
Exact arithmetic on adversarial input can consume unbounded time and memory. A verifier MUST enforce limits on at least the length of any numeral, the magnitude of any exponent, the working precision, and the number of inputs. When a limit is reached the affected aspect is NOT_VERIFIABLE (RESOURCE_LIMIT). A verifier MUST NOT truncate, round or approximate in order to stay within a limit. This document does not fix the limits; a verifier SHOULD document them, and a Verification Result Record is meaningful only relative to them.¶
Schema conformance, numeric reproducibility, empirical support and scientific interpretation are different claims and MUST NOT be collapsed into one. A verdict of this document concerns the second only, and then only for one hop. In particular:¶
A Verification Result Record is a JSON object that conforms to I-JSON with these members:¶
| Member | Value |
|---|---|
| version | The string "0.1". |
| subject | Object with digest (the digest of the subject's canonical form), quantity_id (OPTIONAL; present when the subject parsed to an object with a string quantity_id), and canonical (OPTIONAL; the boolean false, present only when the digest was computed over the received octets because the subject could not be parsed). |
| verifier | Object with string members id and version. |
| checked_at | RFC 3339 [RFC3339] date-time at which the verification ran. |
| aspects | Object with exactly the six members schema, basis, inputs, unit, value and uncertainty, each an aspect object. |
| verdict | "VERIFIED", "FAILED" or "NOT_VERIFIABLE" (Section 7.1). |
An aspect object has verdict (REQUIRED; one of the four aspect verdicts), reason (present if and only if the verdict is FAIL or NOT_VERIFIABLE; one of the codes in Section 8.2), match ("exact" or "within_tolerance"; value and uncertainty aspects when PASS) and recomputed (a decimal numeral; value and uncertainty aspects, when the verifier got far enough to compute it). For the value aspect recomputed is exact; for the uncertainty aspect it is informative (Section 7.5).¶
All six aspects are always present. A Verification Result Record is not a Quantity Record and carries no signature; it can be digested and signed by whatever container carries it.¶
| Code | Verdict | Condition |
|---|---|---|
| DUPLICATE_MEMBER | FAIL | An object in the received text has a duplicate member name. |
| SCHEMA_INVALID | FAIL | The text does not parse as required, or the record violates Section 4 or Section 5. |
| VERSION_UNSUPPORTED | NOT_VERIFIABLE | The record's version is not supported. |
| BASIS_NOT_COMPUTED | NOT_VERIFIABLE | The basis is not "computed"; nothing is recomputed. |
| INPUT_UNAVAILABLE | NOT_VERIFIABLE | The resolver could not supply an input. |
| DIGEST_ALG_UNSUPPORTED | NOT_VERIFIABLE | The digest algorithm is not supported. |
| INPUT_DIGEST_MISMATCH | FAIL | The resolved input does not match its pinned digest. |
| INPUT_SCHEMA_INVALID | FAIL | The resolved input is not a valid Quantity Record. |
| OPERATION_UNSUPPORTED | NOT_VERIFIABLE | An extension operation is not implemented. |
| UNIT_MISMATCH | FAIL | The unit relationship does not hold. |
| UNIT_ALGEBRA_UNSUPPORTED | NOT_VERIFIABLE | The verifier cannot reduce the units exactly. |
| VALUE_MISMATCH | FAIL | The declared value is not within tolerance of the recomputed value. |
| DIVISION_BY_ZERO | FAIL | The divisor is zero. |
| EXACT_DOMAIN_VIOLATION | FAIL | The exact result has no finite decimal expansion. |
| METHOD_UNSUPPORTED | NOT_VERIFIABLE | The uncertainty method is not implemented. |
| INPUT_UNCERTAINTY_MISSING | NOT_VERIFIABLE | An input lacks an uncertainty. |
| UNCERTAINTY_MISMATCH | FAIL | The declared uncertainty does not match the method's result within tolerance. |
| RESOURCE_LIMIT | NOT_VERIFIABLE | A verifier limit was reached (Section 7.6). |
| PREREQUISITE_NOT_MET | NOT_VERIFIABLE | An earlier aspect prevents this one from being decided. |
Two lengths are measured with a caliper and summed. The numbers are chosen so that the root-sum-square of the two standard uncertainties is exact (0.03^2 + 0.04^2 = 0.05^2), which lets the example use exact tolerance throughout.¶
The records are shown formatted for reading. A digest is always computed over the canonical form (Section 6), never over this text. The canonical forms and digests are in Appendix A. Long lines are folded as described in [RFC8792].¶
First input:¶
{
"version": "0.1",
"quantity_id": "urn:example:qr:length-1",
"quantity_kind": "length",
"basis": "measured",
"value": "12.30",
"unit": {"scheme": "ucum", "code": "mm"},
"uncertainty": {"form": "standard", "value": "0.03"}
}¶
Second input:¶
{
"version": "0.1",
"quantity_id": "urn:example:qr:length-2",
"quantity_kind": "length",
"basis": "measured",
"value": "7.80",
"unit": {"scheme": "ucum", "code": "mm"},
"uncertainty": {"form": "standard", "value": "0.04"}
}¶
The computed quantity. The digests in inputs are those of the two records above:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================
{
"version": "0.1",
"quantity_id": "urn:example:qr:length-total",
"quantity_kind": "length",
"basis": "computed",
"value": "20.10",
"unit": {"scheme": "ucum", "code": "mm"},
"uncertainty": {
"form": "standard",
"value": "0.05",
"method": "gum-first-order-independent"
},
"trace": {
"operation": {"id": "add"},
"inputs": [
{
"role": "addend",
"ref": "urn:example:qr:length-1",
"digest": {
"alg": "sha-256",
"value": "8c383922ef0eb4f7934cd847b36fdb82260cbec62eee36c8\
c93b6ee1aca6d348"
}
},
{
"role": "addend",
"ref": "urn:example:qr:length-2",
"digest": {
"alg": "sha-256",
"value": "d6922de0395dbd44198dd8b0075b12b9641840d08c94afdb\
c8a45f6a8d733f0a"
}
}
],
"arithmetic": {
"domain": "decimal",
"precision": 28,
"rounding": "half-even"
},
"tolerance": {"mode": "exact"}
}
}¶
A verifier given the computed quantity and a resolver that returns the two inputs produces:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================
{
"version": "0.1",
"subject": {
"quantity_id": "urn:example:qr:length-total",
"digest": {
"alg": "sha-256",
"value": "9c8d5351e878fceaa8a31725f3391da64631b4e1257ed7817f17\
aa1ed741215e"
}
},
"verifier": {"id": "example-verifier", "version": "0.1"},
"checked_at": "2026-11-16T00:00:00Z",
"aspects": {
"schema": {"verdict": "PASS"},
"basis": {"verdict": "PASS"},
"inputs": {"verdict": "PASS"},
"unit": {"verdict": "PASS"},
"value": {
"verdict": "PASS",
"match": "exact",
"recomputed": "20.1"
},
"uncertainty": {
"verdict": "PASS",
"match": "exact",
"recomputed": "0.05"
}
},
"verdict": "VERIFIED"
}¶
The recomputed value is the numeral 20.1, which denotes the same number as the declared 20.10, so the value aspect passes; comparison is numeric, not textual. The recomputed uncertainty is the square root of 0.0009 + 0.0016 = 0.0025, which is 0.05. Both comparisons are exact.¶
annotations and ref can disclose instruments, locations, people or infrastructure. Verification requires the verifier to see every input, so a verifier operated by another party receives all of them.¶
annotations and use opaque ref values unless there is a reason to disclose more.¶
This document has no IANA actions. Registries for operation identifiers, method identifiers and unit schemes, and a media type, are listed as open issues (Section 14).¶
[Note to the RFC Editor: please remove this section, and the reference to RFC 7942, before publication.]¶
This section records the state of implementation at the time of writing, in the spirit of [RFC7942].¶
A reference verifier exists, written in Python 3 using only its standard library. It implements Section 4 to Section 8, using exact rational arithmetic for every numeric decision and a small UCUM subset (metre, centimetre, millimetre, gram, kilogram, second and the dimensionless unit, with products, quotients and integer exponents) for unit algebra. It generated every digest, verdict and vector in Section 9 and Appendix A. A randomized self-check compares its decimal rounding with Python's decimal module and its uncertainty comparison with a 60-digit square root, and feeds it a few thousand damaged and hostile inputs, each of which must yield a verdict and never an exception; no mismatches or crashes were found in the runs performed.¶
The limits of this evidence are as follows. The verifier has not been publicly released. It has not been run against any independent implementation, so the vectors show internal consistency, not interoperability. The self-check compares two arithmetic back-ends inside one program, which are not independent implementations of this specification. Unit algebra covers only the subset above.¶
[Note to the RFC Editor: please remove this section before publication.]¶
All values in this appendix were produced by the reference verifier described in Section 13. They demonstrate that the procedure is deterministic and self-consistent; they have not been confirmed by a second implementation. Long lines are folded as described in [RFC8792].¶
Each digest below is the SHA-256 of the canonical form of the record with that quantity_id (Section 6), as lowercase hexadecimal. The first three records are those of Section 9.¶
urn:example:qr:length-1 8c383922ef0eb4f7934cd847b36fdb82260cbec62eee36c8c93b6ee1aca6d348 urn:example:qr:length-2 d6922de0395dbd44198dd8b0075b12b9641840d08c94afdbc8a45f6a8d733f0a urn:example:qr:length-total 9c8d5351e878fceaa8a31725f3391da64631b4e1257ed7817f17aa1ed741215e urn:example:qr:mass 5ff8de217c76bd8c749979bfd109b9e693a6058a89f3dc85cfb362d0f2e7924e urn:example:qr:volume 751564fc6f75f0c68d8c49e6766764fdac46ddf2df9cccbbed258199083396f7 urn:example:qr:density 5f4ba284dbfd77c17c27823af7cfe71a163f08020c9731f1eca5609a83fe6e4e urn:example:qr:a 913d56e48a757af9f9d443ef87a37295c96e861a542c866907ac4b158bc02807 urn:example:qr:b 2a8faacaeb444c30f1595adca780992e25cb152e1db3fcbd6ce1b570703ac27e urn:example:qr:ratio 1b3151d819bfc7af106d21c3fc18a90d92687e7f61d910c0c31d417135b92499 urn:example:qr:l a5cb080607ee26f0cf7d3994fa8a7cf3e8f95b281c1e7acf8f624d0314e520d3 urn:example:qr:w 9fdec5f26ae9aeb03732a568ef277d521e0561603740ae0a31e1f511e856ea30 urn:example:qr:area bfb111f1d9cc22fb3c4ad3c91b6d0d295f9a69e99e5baafe95f89fb71288b0eb¶
The canonical form is shown for each record, so that an implementation can check its own canonicalization and digests. The pinned digests inside the computed records are those listed in Appendix A.1.¶
urn:example:qr:length-1:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================
{"basis":"measured","quantity_id":"urn:example:qr:length-1","quantit\
y_kind":"length","uncertainty":{"form":"standard","value":"0.03"},"u\
nit":{"code":"mm","scheme":"ucum"},"value":"12.30","version":"0.1"}¶
urn:example:qr:length-2:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================
{"basis":"measured","quantity_id":"urn:example:qr:length-2","quantit\
y_kind":"length","uncertainty":{"form":"standard","value":"0.04"},"u\
nit":{"code":"mm","scheme":"ucum"},"value":"7.80","version":"0.1"}¶
urn:example:qr:length-total:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================
{"basis":"computed","quantity_id":"urn:example:qr:length-total","qua\
ntity_kind":"length","trace":{"arithmetic":{"domain":"decimal","prec\
ision":28,"rounding":"half-even"},"inputs":[{"digest":{"alg":"sha-25\
6","value":"8c383922ef0eb4f7934cd847b36fdb82260cbec62eee36c8c93b6ee1\
aca6d348"},"ref":"urn:example:qr:length-1","role":"addend"},{"digest\
":{"alg":"sha-256","value":"d6922de0395dbd44198dd8b0075b12b9641840d0\
8c94afdbc8a45f6a8d733f0a"},"ref":"urn:example:qr:length-2","role":"a\
ddend"}],"operation":{"id":"add"},"tolerance":{"mode":"exact"}},"unc\
ertainty":{"form":"standard","method":"gum-first-order-independent",\
"value":"0.05"},"unit":{"code":"mm","scheme":"ucum"},"value":"20.10"\
,"version":"0.1"}¶
urn:example:qr:mass:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================
{"basis":"measured","quantity_id":"urn:example:qr:mass","quantity_ki\
nd":"mass","uncertainty":{"form":"standard","value":"0.05"},"unit":{\
"code":"g","scheme":"ucum"},"value":"12.50","version":"0.1"}¶
urn:example:qr:volume:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================
{"basis":"measured","quantity_id":"urn:example:qr:volume","quantity_\
kind":"volume","uncertainty":{"form":"standard","value":"0.02"},"uni\
t":{"code":"cm3","scheme":"ucum"},"value":"5.00","version":"0.1"}¶
urn:example:qr:density:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================
{"basis":"computed","quantity_id":"urn:example:qr:density","quantity\
_kind":"density","trace":{"arithmetic":{"domain":"decimal","precisio\
n":28,"rounding":"half-even"},"inputs":[{"digest":{"alg":"sha-256","\
value":"5ff8de217c76bd8c749979bfd109b9e693a6058a89f3dc85cfb362d0f2e7\
924e"},"ref":"urn:example:qr:mass","role":"dividend"},{"digest":{"al\
g":"sha-256","value":"751564fc6f75f0c68d8c49e6766764fdac46ddf2df9ccc\
bbed258199083396f7"},"ref":"urn:example:qr:volume","role":"divisor"}\
],"operation":{"id":"div"}},"uncertainty":{"form":"standard","method\
":"gum-first-order-independent","tolerance":{"mode":"relative","valu\
e":"0.001"},"value":"0.01414"},"unit":{"code":"g/cm3","scheme":"ucum\
"},"value":"2.5","version":"0.1"}¶
urn:example:qr:a:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================
{"basis":"measured","quantity_id":"urn:example:qr:a","quantity_kind"\
:"length","unit":{"code":"mm","scheme":"ucum"},"value":"10","version\
":"0.1"}¶
urn:example:qr:b:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================
{"basis":"measured","quantity_id":"urn:example:qr:b","quantity_kind"\
:"length","unit":{"code":"mm","scheme":"ucum"},"value":"3","version"\
:"0.1"}¶
urn:example:qr:ratio:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================
{"basis":"computed","quantity_id":"urn:example:qr:ratio","quantity_k\
ind":"ratio","trace":{"arithmetic":{"domain":"exact"},"inputs":[{"di\
gest":{"alg":"sha-256","value":"913d56e48a757af9f9d443ef87a37295c96e\
861a542c866907ac4b158bc02807"},"ref":"urn:example:qr:a"},{"digest":{\
"alg":"sha-256","value":"2a8faacaeb444c30f1595adca780992e25cb152e1db\
3fcbd6ce1b570703ac27e"},"ref":"urn:example:qr:b"}],"operation":{"id"\
:"div"}},"unit":{"code":"1","scheme":"ucum"},"value":"3.333333333","\
version":"0.1"}¶
urn:example:qr:l:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================
{"basis":"measured","quantity_id":"urn:example:qr:l","quantity_kind"\
:"length","unit":{"code":"m","scheme":"ucum"},"value":"2","version":\
"0.1"}¶
urn:example:qr:w:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================
{"basis":"measured","quantity_id":"urn:example:qr:w","quantity_kind"\
:"length","unit":{"code":"cm","scheme":"ucum"},"value":"3","version"\
:"0.1"}¶
urn:example:qr:area:¶
=============== NOTE: '\' line wrapping per RFC 8792 ================
{"basis":"computed","quantity_id":"urn:example:qr:area","quantity_ki\
nd":"area","trace":{"arithmetic":{"domain":"decimal","precision":28,\
"rounding":"half-even"},"inputs":[{"digest":{"alg":"sha-256","value"\
:"a5cb080607ee26f0cf7d3994fa8a7cf3e8f95b281c1e7acf8f624d0314e520d3"}\
,"ref":"urn:example:qr:l"},{"digest":{"alg":"sha-256","value":"9fdec\
5f26ae9aeb03732a568ef277d521e0561603740ae0a31e1f511e856ea30"},"ref":\
"urn:example:qr:w"}],"operation":{"id":"mul"}},"unit":{"code":"cm2",\
"scheme":"ucum"},"value":"6","version":"0.1"}¶
Each vector verifies one subject with a resolver holding the unmodified fixture inputs, except where the case says otherwise. QV-01 to QV-19 and QV-25 use the records of Section 9; QV-20 to QV-22 use the density records, QV-23 the exact-domain records, and QV-24 the area records.¶
| ID | Case | Overall | Aspects that decide |
|---|---|---|---|
| QV-01 | Section 9 example, unmodified | VERIFIED | all aspects PASS |
| QV-02 | Value written "20.100" instead of "20.10" | VERIFIED | all aspects PASS |
| QV-03 | Value "20.11" | FAILED | value: VALUE_MISMATCH |
| QV-04 | Value "20.14", tolerance absolute 0.05 | VERIFIED | value: within tolerance |
| QV-05 | Value "20.16", tolerance absolute 0.05 | FAILED | value: VALUE_MISMATCH |
| QV-06 | Uncertainty "0.04" instead of "0.05" | FAILED | uncertainty: UNCERTAINTY_MISMATCH |
| QV-07 | Uncertainty without a method member | VERIFIED | uncertainty: NOT_CLAIMED |
| QV-08 | Result unit "cm" with input units "mm" | FAILED | unit: UNIT_MISMATCH |
| QV-09 | First input record changed after its digest was pinned | FAILED | inputs: INPUT_DIGEST_MISMATCH |
| QV-10 | Second input record cannot be resolved | NOT_VERIFIABLE | inputs: INPUT_UNAVAILABLE |
| QV-11 | Extension operation the verifier does not implement | NOT_VERIFIABLE | unit, value, uncertainty: OPERATION_UNSUPPORTED |
| QV-12 | Subject has basis measured (the first input) | NOT_VERIFIABLE | basis: BASIS_NOT_COMPUTED |
| QV-13 | Member name "value" appears twice | FAILED | schema: DUPLICATE_MEMBER |
| QV-14 | "value" is a JSON number | FAILED | schema: SCHEMA_INVALID |
| QV-15 | Working precision 100000 | NOT_VERIFIABLE | value: RESOURCE_LIMIT |
| QV-16 | Input digest algorithm "sha-512" | NOT_VERIFIABLE | inputs: DIGEST_ALG_UNSUPPORTED |
| QV-17 | "version" is "0.2" | NOT_VERIFIABLE | schema: VERSION_UNSUPPORTED |
| QV-18 | Undefined top-level member "comment" | FAILED | schema: SCHEMA_INVALID |
| QV-19 | Added "annotations" member | VERIFIED | all aspects PASS |
| QV-20 | Density m/V, g and cm3, unit algebra available | VERIFIED | uncertainty: within tolerance |
| QV-21 | Density with result unit "kg/m3", value unchanged | FAILED | unit: UNIT_MISMATCH; uncertainty: within tolerance |
| QV-22 | Density with value "2.51" | FAILED | value: VALUE_MISMATCH; uncertainty: within tolerance |
| QV-23 | 10 mm / 3 mm in the exact domain, value declared as a decimal | FAILED | value: EXACT_DOMAIN_VIOLATION; uncertainty: NOT_CLAIMED |
| QV-24 | 2 m times 3 cm declared as "6" cm2 | FAILED | unit: UNIT_MISMATCH; uncertainty: NOT_CLAIMED |
| QV-25 | Declared value "1E+5000" | NOT_VERIFIABLE | value: RESOURCE_LIMIT |
Notes:¶
annotations changes the digest but not the verdict.¶