ERC-8373: Post-Quantum Anchored Key-Binding

The author-line one is already done. I confirmed it on ethereum/ERCs#1932 itself on 31 Aug, not only here, so eip-bot has what it needs.

On the in-tree consumer, it is coming but not today, and the reason is worth knowing. I ran my enforcer against the cutoff vectors as they stand on the PR head and they have grown from 9 cases to 26, including the namespace-opacity case. Four of my vector tests red against the current set. Three are my own staleness, a hardcoded case count and two hardcoded indices that moved. The fourth is real and it is a gap in my harness rather than in the enforcer: my runner registers the genesis binding for every case regardless of what the case declares, so it never presents case 12’s bindings: null. The enforcer was never actually asked the chain-unavailable question, and it passed for that reason rather than by answering it.

So the honest state is that I cannot yet claim the enforcer reproduces the 26. I am extending the runner to build each case’s own chain, including the unavailable one, and I will send the consumer in-tree once it reproduces the set rather than a subset of it.

1 Like

@zexoverz thanks, jumping to 26 is exactly the coverage this needed, and the chain-build catch is a good one. Let me split where it actually bites, because the two halves of governs_from land differently.

Abstract cutoff enforcer, chain-unavailable is already exercised at head. On recompute-kit main (d21bcc7) the 26-case suite already carries the unavailable case: “fail-closed UNAVAILABLE chain (bindings=null, dependency unresolved) is unverifiable, never a silent admit.” apply_revocations(None, …) returns None (“unavailable chain stays unavailable”), so bindings is None reaches the chain_unavailable branch → unverifiable, and it reproduces green (26/26). So on the spec side a case declaring "bindings": null is honoured, not back-filled with the genesis chain, that path isn’t a gap here.

On-chain consumer, that’s where your finding is real. The consumer reconstructs the chain by
registering bindings on-chain, and a harness that registers the genesis binding for every case can never leave the chain unavailable, so its reproduction of that one case passes for the wrong reason. Your fix, build each case’s own chain, including the unavailable one, is exactly right, and it’s worth doing for its own sake: it proves the consumer returns the same verdict (chain_unavailable → unverifiable) as the abstract enforcer, from the chain side, instead of assuming it. That parity across all 26 is a stronger reference implementation than the enforcer alone.

On the three harness / hardcoded-value failures, are those inside your consumer harness, or pointing at something in the vectors themselves? If it’s the vectors, drop the case names and I’ll fix them at source; if it’s the harness, nothing our side, just flag it so we don’t both chase it.

Whenever the consumer’s ready, in-tree at assets/erc-8373/ next to the enforcer + vectors is the right home, runnable, no external link, per EIP-1.

Three were mine, none were the vectors. A hardcoded case count of 9 and two hardcoded case indices that moved when the file grew. They are gone, and cases are now selected by the reason they declare rather than by position.

I also have to walk back the split I drew earlier. I put the whole thing on my harness. Having actually built the per-case chain runner, that was too generous to my own enforcer. Against the 26 it answers 18 correctly, answers one wrong, and cannot be driven into the state seven cases declare.

The wrong answer is case 17. An activated_at of 0 against a binding anchored at 100 is the retroactive activation the spec forbids, the case expects chain_malformed and unverifiable, and my enforcer admits the artifact. It admits it because it never sees the declared value at all, which is the same root as the next three.

registerBinding derives activation rather than accepting it, 0 for the baseline and the anchor time for successors. So cases 18, 19 and 20, the delayed-activation set where activated_at is later than the anchor, cannot be presented at all. Those are the boundary pair at activated_at - 1 and activated_at, so the fencepost they exist to catch is one my enforcer does not yet have a place to get wrong.

Cases 21, 22 and 25 carry binding_anchor_time: null. registerBinding reads the anchor from the substrate and reverts NotAnchored, so an un-anchored binding cannot enter the chain and binding_anchor_unavailable is unreachable.

And case 12 on the chain side, as you say. An unloaded chain and a chain that resolves to nothing are the same zero-length array in the contract, so it answers refuted where the case requires unverifiable. Good to know the abstract enforcer already honours it at head. That parity across all 26, from the chain side rather than assumed, is exactly what I want out of this.

One more that is not a case failure. verifyArtifact returns only decision and evidence. The spec requires an unverifiable to carry a reason, and requires that reason to be a closed enumeration on-chain. The vectors now distinguish chain_unavailable, chain_malformed and binding_anchor_unavailable, and my enforcer collapses all three into a bare unverifiable, so it does not satisfy that clause either.

So the next work is the enforcer rather than the runner. A reason enum, a declared activation that is stored rather than derived and rejected when it precedes its own anchor, and a chain that can be un-loaded and can hold an un-anchored binding. The runner is on conform/v1-26-cases if you want to see what it asserts before I change anything underneath it.

1 Like

@zexoverz, good detail, but I think these are already closed in the reference enforcer at head
(recompute-kit main, conformance/pq-key-binding-v1/cutoff_enforce.py), and your case numbers actually line up with vectors that assert exactly what you’re asking for. Walking the three:

1. Closed reason enumeration. Every verdict already carries a rule from a closed set, 11 of them: anchored_before_cutoff, binding_anchor_unavailable, chain_malformed, chain_unavailable, no_bindings_in_chain, no_in_force_binding, post_cutoff_anchor_status_unknown, post_cutoff_companion_unchecked, post_cutoff_no_valid_companion, pre_baseline_legacy_admit, valid_pq_companion. An unverifiable never comes back bare, it carries its rule (and unverifiable_reason where they differ). On-chain, the consumer just needs to surface that same set.

2. Declared activation + reject-before-anchor. The enforcer already takes a declared activated_at per binding, activation_of returns the anchor OR a later activated_at (delayed activation), and explicitly closes the activated_at=0-baseline bypass. Your case 17 (activated_at: 0 on a binding anchored at 100) is in the suite and returns REJECT / chain_malformed, it does not admit the retroactive activation. And the delayed-activation path is exercised by cases 18-20 (dormant gap → boundary → in-force), which are present and pass. So if 18-20 are unreachable for you, that’s the runner’s registerBinding deriving activation rather than accepting it, the enforcer accepts it.

3. Unloaded vs empty. These are two distinct branches, never conflated: bindings is None → chain_unavailable / unverifiable; len(bindings) == 0 → no_bindings_in_chain / refuted (apply_revocations(None,…) returns None, so an unavailable chain stays unavailable). So case 12, if it’s an unloaded chain, returns unverifiable, not refuted, only a chain that resolved and is legitimately empty is refuted. Same for un-anchored bindings: cases 21-22 → REJECT / binding_anchor_unavailable, case 25 → un-anchored baseline ignored (an anchored successor governs). All three are in the pinned suite; un-anchored bindings do enter the chain and resolve to unverifiable.

So I don’t think the enforcer needs these changes, it already asserts them (26/26 at head), and this is the Pavlo-reviewed four-way fail-closed split (unavailable / empty / malformed / anchor-unavailable). The alignment looks like it’s on the runner side: have registerBinding accept a declared activated_at (and reject it when it precedes the anchor), let un-anchored bindings enter as unverifiable rather than be dropped, and keep unloaded (None) distinct from empty ([]). Do that and your conform/v1-26-cases should line up 1:1 with the pinned vectors. Happy to pair the runner against them case-by-case if useful.

Checked against the live source, not just the PR text: "schema": "invinoveritas.pq_key_binding.v1" is the exact literal string scripts/pq_key_binding.py emits (compute_binding_statement(), both the statement dict and its JCS-preimage list). Nothing to adjust — the vector note represents it correctly.

One thing worth confirming while I’m looking: the note says “his first live binding” — that’s still accurate, it’s the only one this account has anchored. If a second binding is ever added under this namespace, the note’s implicit singular framing would need revisiting, but that’s a future-me problem, not a correction now.

1 Like

Thanks, and you are right about the Python enforcer, it does all of that at head. When I wrote “enforcer” in #23 I meant my Solidity consumer, not cutoff_enforce.py, so we were describing two different things. The three changes you list for the runner are done and the consumer now lines up 1:1 with the pinned vectors. registerBinding takes a declared activated_at and reverts when it precedes its own anchor, an un-anchored binding enters the chain and resolves to binding_anchor_unavailable, and an unloaded chain stays distinct from an empty one, so case 12 answers unverifiable and not refuted. The reason comes back as a closed enum on chain, with Unspecified at zero for the same reason PQEvidence and PQDecision fail closed at zero. All 26 v1 cases reproduce on decision, evidence, reason and rule.

The thread was never told where this lives, which is my fault. It is open as a PR against your pq-anchored-key-binding branch, adding assets/erc-8373/ plus a one-clause Reference Implementation pointer, per your post 20: erc-8373: add the on-chain consumer to the assets by zexoverz · Pull Request #1 · TMerlini/ERCs · GitHub. Happy to pair case by case if anything in the runner reads differently from the Python.

1 Like

@zexoverz, answering your question properly, five weeks late, and the delay is mine rather than any hesitation about the substance.

You offered to open a PR putting your consumer in assets/erc-8373/. I said the consumer belongs there and then never actually said yes or no, which left you waiting on a word that never came.
Sorry about that.

The answer is that you do not need to, and here is the check rather than an assertion. I cloned the branch and ran the assets:

assets/erc-8373/  forge test
  test/PQCutoffEnforcer.t.sol   22 passed
  test/CutoffVectors.t.sol       8 passed
  total                         30 passed, 0 failed


and the four that matter for your point are there by name:

test_enforcer_reproduces_every_v1_reason()
test_enforcer_reproduces_every_v1_rule()
test_enforcer_reproduces_every_v1_decision()
test_enforcer_reproduces_every_v1_evidence()


So PQCutoffEnforcer.sol plus CutoffVectors.t.sol already deliver what the Reference Implementation section claims, a Solidity consumer reproducing every published cutoff vector on all four fields, read from the published vector file rather than restated inline. There is no gap for a second consumer to fill, and adding one would duplicate coverage rather than extend it.

Two things that do not change as a result.

Your author-line entry stands, and not as a courtesy. It is there because your independent implementation surfaced the v0 discrepancy, two of eight vectors contradicting the spec’s own verification procedure, and because the zero-value safety rule is yours: Unverifiable as the
zero value, so an unwritten slot, a failed decode and a struct default all read as “we could not
tell” rather than as evidence of correctness. That rule is now load-bearing in the interface and
documented as such in IPQKeyBindingConsumer.sol. Finding a spec bug by building against it
independently is worth more to a standard than another copy of the reference code, which is the
whole argument of this ERC applied to itself.

And if you would still rather have your implementation in-tree, as a second independent consumer
demonstrating the interface is implementable by someone who did not write it, say so and I will
take the PR gladly.
That is a different and defensible reason from the one I am declining, and
it is your call rather than mine.

Status otherwise: all checks green on 27e79ea, five authors confirmed on the PR, and
eip-review-bot has it at “requires 1 more review from Editors”. Nothing is outstanding on our
side, which is why I wanted this question closed before asking the editors to look.

@zexoverz correcting my own post above, because I got the reasoning backwards and the credit wrong, even though the conclusion happened to land.

I said you need not open a PR, and offered the in-tree enforcer and its four-field vector tests as
evidence there was no gap to fill. Those files are yours. TMerlini/ERCs#1 opened 2 September,
merged on the 17th is IPQKeyBindingConsumer.sol, PQCutoffEnforcer.sol, CutoffVectors.t.sol, PQCutoffEnforcer.t.sol and VectorChain.sol, 1 445 lines. When I cloned the branch, ran forge test, got 30 passing and reported test_enforcer_reproduces_every_v1_{reason,rule,decision,evidence} as proof the work was already covered, I was describing your consumer back to you as a reason your consumer was unnecessary.

So the right answer to “say the word and I will open a PR” is not “you need not”. It is: you did,
five weeks ago, it is merged, and the thing I just measured is it.
The question had been closed
since 17 September and I answered it as though it were open.

How I managed that, since it is the kind of mistake worth naming: I read the thread through an API
call that returned the first twenty posts and reported the last as 31 August. The thread’s
highest_post_number was 27. I did not check, so I never read #21 through #26 including the one where you say the consumer reproduces all 26 cases and tell the thread exactly where it lives. You had already answered the question I was asking, in this thread, and I missed it by trusting a
truncated page.

Two corrections that follow.

The credit line in my post was too narrow. I wrote that your author entry stands for the v0
defect and the zero-value rule. It also stands for the in-tree reference implementation itself —
the thing the spec’s Reference Implementation section points at when it claims “a Solidity consumer that reproduces every published cutoff vector on all four of its fields”. That sentence is true because of your PR.

And the measurement I offered as a check is actually a check on your work, which makes it worth more, not less. A clone of the branch, forge install forge-std, forge test: 22 passing in PQCutoffEnforcer.t.sol, 8 in CutoffVectors.t.sol, 30 total, 0 failed — and the four reproduces_every_v1_* tests reading the 26-case vector file rather than restating it inline. So your #26 claim that all 26 reproduce on decision, evidence, reason and rule verifies independently on another machine. That is the stronger statement and the one I should have made.

Nothing is outstanding on the PR as far as I can see: five authors confirmed, all checks green, and eip-review-bot at “requires 1 more review from Editors”. I will nudge the editors now that this is straight rather than before.

No apology needed, and nothing is owed back on the substance.

To close the question rather than leave it hanging, I do not want a second consumer in-tree. The one you measured is the one I opened, so a second would be the same person implementing the same interface twice. And I agree with the second half of #28, which is the useful framing, the first independent run of those assets rather than a check that made mine redundant.

One thing worth having an answer ready for. Eight files under assets/erc-8373/ still carry the pq-key-binding-v0. prefix. The frozen-base sentence covers only pq-key-binding-v0.cutoff-vectors.json, so the other seven have nothing pointing at them, including pq-key-binding-v0.spec.md, a second spec document the ERC text never references. One line in the assets README separating the v1 normative set from the frozen v0 base would answer the whole directory at once.

1 Like