-
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
Closed
Closed
Changes from 7 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c5bd66d
New EIP: Nonce management for signature-based operations powered on E…
k06a aa01545
Rename methods to avoid collision with EIP-2612 (aka Permit)
k06a b751296
Fix typo
k06a 7a211fd
Fix bug
k06a 8a970f1
Changes and fixes
k06a 1aeb60b
Change title
k06a c54471c
Introduce threads of ids per signer per beneficiary
k06a dda6b4c
Update EIPS/eip-X.md
k06a ea37dcd
Rename file
k06a 4005a72
Update EIPS/eip-6077.md
k06a a1ac452
Update EIPS/eip-6077.md
k06a 5c17d7c
Update EIPS/eip-6077.md
k06a 651431e
Add discussion link
k06a 02e4ad6
Update EIPS/eip-6077.md
k06a 8429d31
Update EIPS/eip-6077.md
k06a d3cf7a4
Update EIPS/eip-6077.md
k06a 911c35b
Update EIPS/eip-6077.md
k06a File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| --- | ||
| eip: TBD | ||
| title: Invalidation abstraction for signature-based operations powered by EIP-712 | ||
| description: Extends EIP-712 and unifies EIP-2612 with many others | ||
| author: Anton Bukov (@k06a), Mikhail Melnik (@zumzoom) | ||
| discussions-to: TBD | ||
| status: Draft | ||
| type: Standards Track | ||
| category: ERC | ||
| created: 2022-12-02 | ||
| requires: 712 | ||
| --- | ||
|
|
||
| ## Abstract | ||
|
|
||
| This EIP extends [EIP-712](./eip-712.md) and defines two ways to validate and invalidate signature-based operations. Such operations as [EIP-20](./eip-20.md) permit operation defined in [EIP-2612](./eip-2612.md). 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 | ||
|
|
||
| ## 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. | ||
|
|
||
| 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. | ||
|
|
||
| ## 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 | ||
| 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. | ||
|
|
||
| ## Rationale | ||
|
|
||
| TBD | ||
|
|
||
| ## Backwards Compatibility | ||
|
|
||
| Fully backward compatibile with EIP-712. | ||
|
|
||
| ## Security Considerations | ||
|
|
||
| TBD | ||
|
|
||
| ## Copyright | ||
|
|
||
| Copyright and related rights waived via [CC0](../LICENSE.md). | ||
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.
Uh oh!
There was an error while loading. Please reload this page.