feat(tempo): add sender scoped transaction hashes#4607
Draft
0xrusowsky wants to merge 2 commits into
Draft
Conversation
|
@0xrusowsky is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 8a4d773 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Motivation
Tempo's TIP-1034 channel opens bind channel identity to the tx via an
expiringNonceHash:this gives the precompile its replay/same-transaction semantics, but it means viem clients need a way to compute the exact sender-scoped hash before signing the initial voucher.
this depends on wevm/ox#246, which exposes the Tempo transaction signing preimage from ox.
Solution
add Tempo helpers for deriving the sender-scoped transaction hash:
getSenderScopedHashhashes the Tempo signing preimage together with the resolved sender address.getExpiringNonceHashandgetChannelOpenContextHashare exported as aliases for the same TIP-1034-derived value.this also refactors Tempo serialization to share the same internal envelope normalization used by
encodeForSigning, preserving the existing fee-payer behavior wherefeePayer: trueleaves fee token selection to the fee payer.Tests
keccak256(encodeForSigning(tx))matches the ox Tempo sender signing payload.encodeForSigningis stable across sender/fee-payer signatures and fee-payer-selected fee token changes when the sender does not commit to the fee token.getSenderScopedHash/getExpiringNonceHash/getChannelOpenContextHashmatchkeccak256(encodeForSigning(tx) || sender).Notes
opened as draft because this branch uses a local
ox@0.14.20patch containing wevm/ox#246, so CI is expected to fail until the ox change lands and viem can depend on the published version.