fix(evm-charge): remove redundant externalId from Permit2 witness - #313
Closed
chopmob-cloud wants to merge 1 commit into
Closed
fix(evm-charge): remove redundant externalId from Permit2 witness#313chopmob-cloud wants to merge 1 commit into
chopmob-cloud wants to merge 1 commit into
Conversation
…mpoxyz#287) challengeHash already commits to challenge.id, whose HMAC serializes the full request object (JCS/RFC 8785) including externalId. The separate witness field binds nothing new and forced an empty-string special case duplicating the core spec s absent-optional-field handling. Removal preserves binding and drops a cross-implementation encoding divergence; the type=hash unique-externalId mitigation is unaffected (challenge.id layer, not the witness). Signed-off-by: AlgoVoi <chopmob@gmail.com>
This was referenced Aug 8, 2026
Collaborator
|
even if redundant, changing this interface would be breaking. I'm preferential to not do this in the short term |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #287.
@Xeift is right:
externalIdin the Permit2PaymentWitnessis redundant.The witness commits to
challengeHash = keccak256(challenge.id, challenge.realm), andchallenge.idis an HMAC whose slot 3 is the entirerequestobject, JCS-serialized per RFC 8785 (coredraft-httpauth-payment-00). SinceexternalIdis a member ofrequest, it is already bound tochallenge.id(and therefore tochallengeHashand the signature) whenever present. The separate witness field binds nothing new.Removing it is also a small hardening: the old text carried a
PaymentWitness.externalId == ""absent-case rule that duplicated, at the witness layer, the absent-optional-field convention the core spec already resolves deterministically at HMAC slot 3 via JCS. Two separately-specified conventions for the same thing is a needless cross-implementation divergence risk.No regression to the
type="hash"mitigation ("Requiring uniqueexternalIdvalues per challenge") — that operates at thechallenge.idlayer, not the witness, so distinctexternalIdstill yields distinctchallengeHash.Changes (one file):
string externalId;from thePaymentWitnessstruct and from the EIP-712 witness type string.challengeHash->challenge.id(which already commits to every request field, incl.externalId).type="permit2"bullet accordingly.externalIdintentionally remains as the request field, the receipt echo, and the hash-mode mitigation.Validation: builds clean through
kramdown-rfc+xml2rfc(HTML/TXT);rfclint --no-rng --no-spellexit 0;lint_frontmatter.pyclean. DCO signed-off.