fix(server): use unwrapped signature for root EOA merchant key#1054
Open
fix(server): use unwrapped signature for root EOA merchant key#1054
Conversation
Route.merchant always signed feePayerDigest with wrap:true, producing a 98-byte wrapped signature. On-chain, IthacaAccount validates wrapped signatures via keyHash lookup, which fails when the merchant's root EOA key is not registered as a named key on their account. Now, when the signing key is secp256k1 and its derived address matches the merchant address (i.e. it is the root EOA), sign with wrap:false to produce a 65-byte raw ECDSA signature that goes through the ecrecover path — always valid for the root EOA without key registration. Closes ithacaxyz/relay#1516 Amp-Thread-ID: https://ampcode.com/threads/T-019c6121-e174-7506-8cd1-ca4204b31df0 Co-authored-by: Amp <amp@ampcode.com>
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
commit: |
Contributor
size-limit report 📦
|
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.
Summary
Fix
Route.merchantfee signature validation failure when the merchant uses their root EOA private key directly.Closes ithacaxyz/relay#1516
Details
Route.merchantalways signedfeePayerDigestwithwrap: true(default), producing a 98-byte wrapped signatureIthacaAccount.unwrapAndValidateSignaturehandles wrapped sigs viagetKey(keyHash)lookup — which fails if the key is not explicitly registered on the accountRoute.merchant(the common case for simple setups), the root EOA is implicitly valid via the 65-byteecrecoverpath but is typically not registered as a named keyKey.signuseswrap: falseto produce a 65-byte raw ECDSA signaturewrap: trueAreas Touched
portoLibrary (src/server)Prompted by: joshie