Skip to content

docs: specify EIP-712 domain separator for voucher signatures - #42

Merged
thiras merged 2 commits into
mainfrom
docs/eip712-domain-separator
Mar 29, 2026
Merged

thiras merged 2 commits into
mainfrom
docs/eip712-domain-separator

Conversation

@thiras

@thiras thiras commented Mar 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add full EIP-712 specification to ADR 003: domain separator (name, version, chainId, verifyingContract), Voucher typehash, signature digest construction, and verification logic
  • Update ADR 003 replay attack section and voucher format section with cross-references to the new specification
  • Update ADR 007 contract integration section to reference ADR 003's EIP-712 domain separator, ensuring watchtower implementations use the same domain for off-chain verification

Closes #8

Test plan

  • Verify markdown renders correctly on GitHub (code blocks, internal links, cross-file links)
  • Confirm #eip-712-voucher-signature anchor link resolves in ADR 003
  • Confirm 003-payments.md#eip-712-voucher-signature cross-reference resolves from ADR 007

🤖 Generated with Claude Code

Without an explicit domain separator, vouchers could be replayed across
different chains, contract deployments, or test vs production environments.
Add the full EIP-712 specification (domain separator, voucher typehash,
signature digest, verification logic) to ADR 003 and cross-reference it
from ADR 007.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings March 29, 2026 19:37

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the architectural decision records for payments and watchtowers to include a formal specification for EIP-712 voucher signatures. It defines the domain separator and voucher structure to mitigate replay attacks across different chains and contract deployments. The review feedback suggests a gas optimization for proxy-deployed contracts, recommending that the domain separator be cached and only recomputed if the chain ID changes to avoid unnecessary overhead.

Comment thread adr/003-payments.md Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the architecture decision records to fully specify the EIP-712 domain separator and digest construction for voucher signatures, and aligns the watchtower ADR to reference that shared signature domain to prevent replay across chains/contract deployments.

Changes:

  • Added an “EIP-712 Voucher Signature” specification section to ADR 003 (domain separator, typehash, digest, verification guidance).
  • Updated ADR 003’s replay-attack and voucher-format sections to cross-reference the new EIP-712 spec.
  • Updated ADR 007’s contract integration section to reference ADR 003’s EIP-712 domain separator for consistent off-chain verification.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
adr/003-payments.md Adds the EIP-712 voucher signing/verification specification and updates related sections to reference it.
adr/007-watchtower.md References ADR 003’s EIP-712 domain separator to ensure watchtowers verify vouchers against the same domain.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread adr/003-payments.md Resolved
Comment thread adr/003-payments.md Resolved
Comment thread adr/003-payments.md Resolved
Comment thread adr/007-watchtower.md Resolved
- Use constructor/immutable pattern in code snippet (consistency)
- Use keccak256(bytes(...)) for modern Solidity compatibility
- Require hardened ECDSA recovery (OZ ECDSA.recover, canonical s)
- Recommend cached domain separator with chainid check for proxies

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@thiras
thiras merged commit d9ca585 into main Mar 29, 2026
@thiras
thiras deleted the docs/eip712-domain-separator branch March 29, 2026 19:49
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.

ADR 003: Specify EIP-712 domain separator for voucher signatures

2 participants