Skip to content

feat(tempo): add sender scoped transaction hashes#4607

Draft
0xrusowsky wants to merge 2 commits into
wevm:mainfrom
0xrusowsky:rus/tempo-sender-scoped-hash
Draft

feat(tempo): add sender scoped transaction hashes#4607
0xrusowsky wants to merge 2 commits into
wevm:mainfrom
0xrusowsky:rus/tempo-sender-scoped-hash

Conversation

@0xrusowsky
Copy link
Copy Markdown

Motivation

Tempo's TIP-1034 channel opens bind channel identity to the tx via an expiringNonceHash:

keccak256(encodeForSigning || sender)

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:

Transaction.encodeForSigning(transaction): Hex
Transaction.getSenderScopedHash(transaction, { sender }): Hex

getSenderScopedHash hashes the Tempo signing preimage together with the resolved sender address. getExpiringNonceHash and getChannelOpenContextHash are 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 where feePayer: true leaves fee token selection to the fee payer.

Tests

  • keccak256(encodeForSigning(tx)) matches the ox Tempo sender signing payload.
  • encodeForSigning is 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 / getChannelOpenContextHash match keccak256(encodeForSigning(tx) || sender).

Notes

opened as draft because this branch uses a local ox@0.14.20 patch containing wevm/ox#246, so CI is expected to fail until the ox change lands and viem can depend on the published version.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

@0xrusowsky is attempting to deploy a commit to the Wevm Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 13, 2026

🦋 Changeset detected

Latest commit: 8a4d773

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant