-
Notifications
You must be signed in to change notification settings - Fork 6k
Add EIP-6077: Invalidation for Signature-Based Operations #6077
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
Changes from 15 commits
c5bd66d
aa01545
b751296
7a211fd
8a970f1
1aeb60b
c54471c
dda6b4c
ea37dcd
4005a72
a1ac452
5c17d7c
651431e
02e4ad6
8429d31
d3cf7a4
911c35b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| --- | ||
| eip: 6077 | ||
| title: Invalidation for Signature-Based Operations | ||
| description: Extends EIP-712 and unifies EIP-2612 with many others | ||
| author: Anton Bukov (@k06a), Mikhail Melnik (@zumzoom) | ||
| discussions-to: https://ethereum-magicians.org/t/eip-6077-invalidation-abstraction-for-signature-based-operations/12162 | ||
| status: Draft | ||
| type: Standards Track | ||
| category: ERC | ||
| created: 2022-12-02 | ||
| requires: 712, 2612 | ||
| --- | ||
|
|
||
| ## Abstract | ||
|
|
||
| This EIP extends [EIP-712](./eip-712.md) and defines two methods to validate and invalidate signature-based operations, such as [EIP-2612](./eip-20.md)'s permit operation. This EIP provides two ways to track such operations and invalidate them: | ||
|
|
||
| - main sequnce of incremental nonces per signer | ||
| - sequence of incremental ids per signer per beneficiary | ||
|
Comment on lines
+18
to
+19
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should be complete sentences |
||
|
|
||
| ## Motivation | ||
|
|
||
| Same abstraction could be utilized by mutilple signature-based operations, moreover existing EIPs like [EIP-2612](./eip-2612.md) could be considered as fully compatible with the EIP. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This reads like Rationale, not Motivation. Mind moving this to that section? |
||
|
|
||
| Multiple EIPs define operations that can be executed in behalf of signer and sometime introduce method naming collisions and other. For example, [EIP-2612](./eip-2612.md) defines both `permit` and `nonces` methods, but gives no clue that `nonces` is related to permit operation. In case of multiple same-level EIPs implemented within one smart contract (for example: permit, delegate, vote) it's obvious that they should use different nonces. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't understand what you're trying to say here. Mind explaining?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trying to create abstraction for signature-based operations, and this abstraction also covers existing EIP-2612 somehow. |
||
|
|
||
| ## Specification | ||
|
|
||
| The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. | ||
|
|
||
| - Smart contract implementing EIP-712 MUST also implement the following interface: | ||
|
|
||
| ```solidity | ||
k06a marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| interface ISignatureOperations { | ||
| /// @dev Returns next nonce for the signer in the context of the operation typehash and operation beneficiary | ||
| /// @param typehash The operation typehash | ||
| /// @param signer The signer address | ||
| function operationNonces(bytes32 typehash, address signer) external view returns (uint256); | ||
|
|
||
| /// @dev Returns next id for the signer in the context of the operation typehash and operation beneficiary | ||
| /// @param typehash The operation typehash | ||
| /// @param signer The signer address | ||
| /// @param beneficiary The address of the spender, delegate, or other beneficiary of the transaction | ||
| function operationIds(bytes32 typehash, address signer, address beneficiary) external view returns (uint256); | ||
|
|
||
| /// @dev Increments nonce for the caller in the context of the operation typehash and operation beneficiary | ||
| /// @param typehash The operation typehash | ||
| /// @param nonce The operation nonce | ||
| function useOperationNonce(bytes32 typehash, uint256 nonce) external; | ||
|
|
||
| /// @dev Increments id for the caller in the context of the operation typehash and operation beneficiary | ||
| /// @param typehash The operation typehash | ||
| /// @param beneficiary The address of the spender, delegate, or other beneficiary of the transaction | ||
| /// @param id The operation nonce | ||
| function useOperationIds(bytes32 typehash, address beneficiary, uint256 id) external; | ||
| } | ||
| ``` | ||
|
|
||
| - Operation EIPs SHOULD use at leat one of the nonces or ids sequences per signer defined by this EIP or both. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not make this a MUST? Also, the phrasing here is a bit odd. Mind explaining? |
||
|
|
||
| ## Rationale | ||
|
|
||
| TBD | ||
|
|
||
| ## Backwards Compatibility | ||
|
|
||
| Fully backward compatibile with EIP-712. | ||
k06a marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Security Considerations | ||
|
|
||
| TBD | ||
|
|
||
| ## Copyright | ||
|
|
||
| Copyright and related rights waived via [CC0](../LICENSE.md). | ||
Uh oh!
There was an error while loading. Please reload this page.