Skip to content

Add ERC: Composite EIP-712 Signatures #993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open

Conversation

sola92
Copy link

@sola92 sola92 commented Mar 25, 2025

This EIP provides a standard for signing multiple typed-data messages with a single signature by encoding them into a Merkle tree. Allowing individual messages to be verified without requiring full knowledge of the others.

eip-tbd

@eip-review-bot
Copy link
Collaborator

eip-review-bot commented Mar 25, 2025

File ERCS/erc-7920.md

Requires 1 more reviewers from @g11tech, @SamWilsn, @xinbenlv

@sola92 sola92 marked this pull request as draft March 25, 2025 17:04
@sola92 sola92 changed the title Add ERC-XXXX: Composite EIP-712 Signatures Add ERC: Composite EIP-712 Signatures Mar 25, 2025
@github-actions github-actions bot added w-ci and removed w-ci labels Mar 28, 2025
@github-actions github-actions bot removed the w-ci label Mar 28, 2025
@github-actions github-actions bot added the w-ci label Mar 28, 2025
@sola92 sola92 marked this pull request as ready for review March 31, 2025 02:33
@sola92
Copy link
Author

sola92 commented Apr 2, 2025

Ready for review @g11tech, @SamWilsn, @xinbenlv

Copy link
Collaborator

@xinbenlv xinbenlv left a comment

Choose a reason for hiding this comment

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

Dear sola92,

Thank you for proposing ERC-7920. The composite signature approach via Merkle trees addresses a critical UX gap in multi-message workflows. Below is concise technical feedback to strengthen the proposal:

Critical Revisions

  1. Security Fix (Line 100):

    // Replace encodePacked with encode to prevent collisions
    - abi.encodePacked("\x19\x01", ...)  
    + abi.encode("\x19\x01", ...)  
  2. Merkle Tree Specs (Lines 45-47):

    • Add explicit requirements for:
      • Single-message roots (root = leaf)
      • Leaf ordering (lexicographical sort)
      • Zero-padding for unbalanced trees
    • Reference RFC 6962 for tree construction.
  3. Wallet Requirements (Lines 303-305):

    • Mandate display of all message types before signing
    • Recommend max message count (e.g., ≤10)

Implementation Notes

  • Reference Code (Line 309): Include test vectors for:
    • Odd/even leaf counts
    • Cross-implementation root consistency
  • Typo Fix: "marketRoot" → "merkleRoot" (Lines 88, 255)

Conclusion

ERC-7920 has strong potential to standardize composite signatures. Addressing these points will ensure safe adoption across wallets and dapps. I’m available to collaborate on test vectors or implementation details.

Respectfully,
xinbenlv

- Replace merkletreejs with reference implementation that follows ERC-7920 specification.                                                                                                                             - `abi.encodePacked` -> `abi.encode`
- Add tests for the Merkle reference implementation
- update spec to harden N=1 case
@sola92
Copy link
Author

sola92 commented Apr 12, 2025

@xinbenlv thanks a lot for review. Very helpful. I pushed the follow changes:

- Fix typos
- Hardened tree construction specification and added a reference implementation
- Add tests for the Merkle reference implementation, with cases for even/odd messages
-`abi.encodePacked` -> `abi.encode`
- Update specification to harden N=1 case

Happy to collaborate and make any more changes need. Thanks in advance!

Copy link

github-actions bot commented May 5, 2025

The commit 5beb332 (as a parent of 2eae175) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot added the w-ci label May 5, 2025
@sola92
Copy link
Author

sola92 commented May 5, 2025

Thanks @SamWilsn. Changes pushed.

@poojaranjan could we add this to agenda for EIP Editing Office Hour Meeting 60

@github-actions github-actions bot removed the w-ci label May 5, 2025
@sola92 sola92 requested a review from xinbenlv May 5, 2025 05:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants