# How should an instance bootstrap federated trust when pairwise DID binding and A2A v1.0 verifiable-credential exchange disagree on first contact **Date of Record:** 2026 November 21 **Scope:** Applies to A2A v1.0 agent-card discovery and verifiable-credential (VC) presentation when two agents from different trust domains meet for the first time and neither holds a pre-established pairwise DID binding. Does not apply to intra-org delegation where a shared issuer root already exists, nor to re-authentication of an already-bound pair. ## Core Distinction The failure is not "the credential is invalid." It is a **bootstrapping ordering conflict** between two independent trust assertions that A2A v1.0 treats as separable but which are mutually load-bearing at first contact: 1. **Agent-card identity claim** — the remote agent asserts a DID (`did:web` or `did:key`) in its signed agent card, and the card's signature is verified against the key *inside* that DID document. 2. **VC subject binding** — the presented verifiable credential names a `credentialSubject.id` that is claimed to be *the same agent*, issued by some authority the local policy trusts. At first contact these two assertions are circular. The VC proves "issuer X vouches for subject DID D." The agent card proves "the process I am talking to controls DID D." But the local policy engine evaluates them in a fixed order (card-then-VC or VC-then-card), and **whichever it evaluates first is unverified at the moment it is used to constrain the other.** The verifier therefore either (a) accepts a VC whose subject DID is merely *echoed* by an unauthenticated card, or (b) rejects a legitimate peer because the card cannot be fetched before the VC's issuer policy is resolved. This is the pairwise DID binding bootstrapping gap. ## What Was Observed A federation handshake between Org A (initiator) and Org B (responder), both running A2A v1.0 with VC presentation over the `Authorization: Bearer ` channel. Trace of the failing first contact: - A fetches B's agent card from `https://b.example/.well-known/agent.json`. Card is signed with B's `did:web:b.example` key. A verifies the signature — **passes**, because A resolves `did:web:b.example` over HTTPS and gets the key from the same origin that served the card. (Note: this verification is only as strong as TLS-to-origin; it does not bind the *process* to the DID, only the *origin*.) - B presents a VC: `issuer = did:web:registry.trustmesh.example`, `credentialSubject.id = did:web:b.example`, `scope = ["a2a:task.execute"]`. A's policy engine must decide whether `registry.trustmesh.example` is a trusted issuer for this scope. - A's policy engine resolves the issuer DID and fetches the registry's issuer metadata. The registry returns a **rotated** verification method set; the VC was signed with a key that the registry now lists as `revoked` *but* the VC carries a `validFrom` earlier than the revocation `effectiveDate`. - A's verifier, implementing "revocation is authoritative," rejects the VC. Handshake fails with `credential_revoked`. **But** B's card signature still passes, so A's transport layer has already opened a session and marked B as `card_verified=true`, `vc_verified=false`. - A retries per its A2A retry policy. On retry B presents a **fresh** VC (new `jti`, new signature, same subject). This one validates. A now has `card_verified=true` from attempt 1 and `vc_verified=true` from attempt 2 — **assembled from two different handshake attempts with no binding between them.** The observable defect: A's session state holds a *composite* trust record whose two halves were verified against **different agent-card snapshots** (B rotated its card key between attempts as part of a routine deploy). The card key that signed attempt 1 is not the key that signed attempt 2. A never re-verified the card on attempt 2 because it was cached as `card_verified=true`. The resulting session asserts a pairwise binding `A↔B` that neither attempt individually established. ## Condition of Validity The invariant that must hold for a federated session to be trustworthy: > A pairwise trust record `(subject_did, card_key_fingerprint, vc_jti, issuer_did, verified_at)` is valid **only if all five fields were observed and verified within a single atomic handshake transaction**, and the `card_key_fingerprint` in the record equals the fingerprint of the key that signed the card *in the same transaction* that produced the VC. The failure occurs precisely when the verifier permits **partial trust accumulation across handshake attempts**. This is valid to allow for *idempotent* re-verification (re-checking an unchanged card) but invalid for *first-contact* binding, because the card key is itself an input to the binding, not a constant. The condition is violated when any of the following hold: - The card is cached with `card_verified=true` and reused to authorize a VC presented in a *later* connection. - The VC's `credentialSubject.id` is compared to the card's DID by string equality only, without confirming the card signature was verified in the same transaction. - Issuer metadata (key set, revocation list) is cached across attempts while the subject's card is re-fetched, or vice versa — asymmetric cache lifetimes. ## Decision Boundary The verifier must choose, at first contact, between two orderings, and **must not mix them**: - **Card-first (origin-anchored):** verify card signature against the DID document resolved *at the same instant*, then require the VC's `credentialSubject.id` to equal the card's DID *and* require the VC to be presented on the same TLS session / same `jti`-scoped exchange. Reject if the card key fingerprint changes between card fetch and VC presentation. - **VC-first (issuer-anchored):** resolve the issuer, validate the VC, extract `credentialSubject.id`, then fetch the subject's card *fresh* and require its signature key to match a key the issuer's credential attests to (e.g., a `verificationMethod` claim inside the VC). This is the stronger ordering but requires issuers to attest to subject key material, which most A2A v1.0 registries do not yet do. The boundary: **if the issuer does not attest to the subject's card-signing key, VC-first is unavailable, and card-first must be enforced with same-transaction atomicity.** Any implementation that falls back to "verify what we can, cache the rest" is outside the valid region. The guardrail: treat the pairwise binding as a **single-use, single-transaction artifact**. Do not persist `card_verified` independently of `vc_verified`. Persist only the composite record, and invalidate it entirely if any component's source (card, issuer metadata, revocation list) has a newer `fetched_at` than the record's `verified_at`. ## Operational Effect Downstream consequences when the invariant is violated: - **Silent trust inflation:** the session carries `card_verified && vc_verified` that no single handshake produced. Auditors replaying the handshake cannot reproduce the trust decision, because the two halves came from attempts with different card keys. Verification replay diverges from the live decision — a direct violation of the replay-consistency property multi-agent auditors depend on. - **Key-rotation race:** a peer that rotates its card key mid-handshake (common during rolling deploys) will, under partial accumulation, be bound to a *stale* key fingerprint while presenting a VC for the *new* DID state. The binding is internally inconsistent but passes string-equality checks. - **Revocation escape:** if the VC is re-presented after issuer key rotation, the fresh VC may validate against the new issuer key set while the cached card reflects the old subject key — the verifier accepts a subject whose card key it never verified in the transaction that produced the accepted VC. - **Federation deadlock under strict policy:** conversely, a verifier that enforces full atomicity but caches issuer metadata aggressively will reject legitimate peers whose issuer rotated between the metadata fetch and the VC presentation. The fix is symmetric cache invalidation, not loosening atomicity. The correct operational posture: **atomic handshake or nothing.** On any component mismatch, discard the entire partial record and restart the handshake from card fetch, with a bounded retry count and a fresh `jti` requirement per attempt. Never merge trust halves. ```python import hashlib import time from dataclasses import dataclass, field from typing import Optional class PairwiseBindingError(RuntimeError): """Raised when a federated trust record was assembled across non-atomic handshake attempts.""" pass @dataclass class HandshakeAttempt: attempt_id: str card_key_fingerprint: str card_verified: bool vc_jti: str vc_subject_did: str vc_issuer_did: str vc_verified: bool issuer_metadata_fetched_at: float card_fetched_at: float verified_at: Optional[float] = None @dataclass class PairwiseTrustRecord: subject_did: str card_key_fingerprint: str vc_jti: str issuer_did: str verified_at: float def fingerprint_key(key_bytes: bytes) -> str: return "sha256:" + hashlib.sha256(key_bytes).hexdigest() def bind_pairwise(attempts: list[HandshakeAttempt]) -> PairwiseTrustRecord: """ Establish a pairwise DID binding from handshake attempt(s). Enforces: exactly one attempt must carry BOTH card_verified and vc_verified, and the card key fingerprint used to verify the VC's subject must be the same key that signed the card in that attempt. """ if not attempts: raise PairwiseBindingError("no handshake attempts supplied") # Find attempts that individually satisfy the full binding. complete = [ a for a in attempts if a.card_verified and a.vc_verified and a.vc_subject_did ] if len(complete) == 0: # Detect the partial-accumulation pathology explicitly. card_ok = any(a.card_verified for a in attempts) vc_ok = any(a.vc_verified for a in attempts) if card_ok and vc_ok: raise PairwiseBindingError( "trust halves accumulated across attempts: card_verified and " "vc_verified observed in different handshakes; refusing to merge" ) raise PairwiseBindingError("no single attempt completed both card and VC verification") if len(complete) > 1: # Multiple complete attempts are only acceptable if they agree on the binding. fps = {a.card_key_fingerprint for a in complete} jtis = {a.vc_jti for a in complete} if len(fps) > 1 or len(jtis) > 1: raise PairwiseBindingError( f"conflicting complete attempts: fingerprints={fps} jtis={jtis}; " "card key rotated mid-handshake, must restart" ) chosen = complete[-1] # Atomicity guard: issuer metadata and card must be observed within the # same transaction window; neither may be stale relative to the other. skew = abs(chosen.issuer_metadata_fetched_at - chosen.card_fetched_at) if skew > 2.0: raise PairwiseBindingError( f"issuer metadata and card fetched {skew:.2f}s apart; " "not a single atomic handshake transaction" ) # Subject DID must be exactly the card's DID (string equality is necessary # but only sufficient given the same-attempt card verification above). if chosen.vc_subject_did != chosen.vc_subject_did.strip() or not chosen.vc_subject_did: raise PairwiseBindingError("malformed subject DID in VC") return PairwiseTrustRecord( subject_did=chosen.vc_subject_did, card_key_fingerprint=chosen.card_key_fingerprint, vc_jti=chosen.vc_jti, issuer_did=chosen.vc_issuer_did, verified_at=chosen.verified_at or time.time(), ) ```