Skip to content
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

Add EIP-6077: Invalidation for Signature-Based Operations #6077

Closed
wants to merge 17 commits into from
Closed

Add EIP-6077: Invalidation for Signature-Based Operations #6077

wants to merge 17 commits into from

Conversation

k06a
Copy link
Contributor

@k06a k06a commented Dec 2, 2022

No description provided.

@k06a k06a requested a review from eth-bot as a code owner December 2, 2022 12:52
@github-actions github-actions bot added c-new Creates a brand new proposal e-number Waiting on EIP Number assignment s-draft This EIP is a Draft t-erc labels Dec 2, 2022
@eth-bot
Copy link
Collaborator

eth-bot commented Dec 2, 2022

Hi! I'm a bot, and I wanted to automerge your PR, but couldn't because of the following issue(s):


(fail) eip-6077.md

classification
newEIPFile
  • File with name EIPS/eip-6077.md is new and new files must be reviewed
  • This PR requires review from one of [@axic, @SamWilsn, @Pandapip1]

@frangio
Copy link
Contributor

frangio commented Dec 2, 2022

In the context of permits I think I've seen you suggest that nonces shouldn't be sequential, so that there could be several valid permits created "in parallel". What's your current thinking on that?

@k06a
Copy link
Contributor Author

k06a commented Dec 2, 2022

@frangio maybe we can rename nonce to operationId and make those EIP to support custom invalidation logic. Implementations could use sequential ids or parallel ids however they want.

@frangio
Copy link
Contributor

frangio commented Dec 2, 2022

Can you name use cases that require parallel nonces? Is this common or a good idea? How does a client know which nonce to use? I'm trying to understand what extra complexity it would require and whether it might be worth it.

@k06a
Copy link
Contributor Author

k06a commented Dec 2, 2022

@frangio I discovered these 5 operations in OpenZeppelin/openzeppelin-contracts:

  • ERC20Permit._PERMIT_TYPEHASH (sequential invalidation)
  • Votes._DELEGATION_TYPEHASH (sequential invalidation)
  • Governor.BALLOT_TYPEHASH (parallel invalidation via proposalId or NO invalidation required)
  • Governor.EXTENDED_BALLOT_TYPEHASH (parallel invalidation via proposalId or NO invalidation required)
  • MinimalForwarder._TYPEHASH (sequential invalidation)

@k06a k06a changed the title EIP-TBD: Nonce management for signature-based operations powered by EIP-712 EIP-TBD: Invalidation abstraction for signature-based operations powered by EIP-7127 Dec 2, 2022
@k06a k06a changed the title EIP-TBD: Invalidation abstraction for signature-based operations powered by EIP-7127 EIP-TBD: Invalidation abstraction for signature-based operations powered by EIP-712 Dec 2, 2022
@frangio
Copy link
Contributor

frangio commented Dec 2, 2022

Based on these examples I don't think parallel nonces are needed. proposalId is not a nonce.

@k06a
Copy link
Contributor Author

k06a commented Dec 2, 2022

@frangio I see we probably don’t need parallel operation ids. But maybe we don’t have good invalidation technique, which can be invented later. I suspect there could be some cases where operation id contains spender/delegatee address and rest 96 bits are being used as nonce.

@frangio
Copy link
Contributor

frangio commented Dec 5, 2022

I'd remove IParallelOperations to simplify the EIP.

I think if there is parallelism it will still be sequential but the sequence will depend on more parameters, not just the signer. This could be expressed in the interface by including an additional argument like bytes params, but this is useless without a way to specify the parameters that should be included there.

@k06a
Copy link
Contributor Author

k06a commented Dec 5, 2022

@frangio what about having definition for thread-id? Original sequential behaviour have thread-id = signer, but we could have thread-id = hash(signer, spender). Nonces will still be sequential but one signer could have multiple threads of ids...

@k06a
Copy link
Contributor Author

k06a commented Dec 5, 2022

@Pandapip1 could you help us here with EIP number?

@frangio
Copy link
Contributor

frangio commented Dec 6, 2022

@k06a A thread id would work but it's similar to (though more efficient than) bytes params, and I think there would need to be a way to specify to clients how to create the thread id.

IMO, the ideal end goal for full generality would be the ability to create a function like getNonce(contract: Address, signer: Address, type: EIP712Type, msgWithoutNonce: EIP712Message): Promise<bigint>. I.e., given a contract and an EIP712 typed message with an empty nonce parameter obtain the nonce that should be included in that nonce parameter. Your proposal here allows a less general version of this function where the nonce does not depend on the message or other parameters, only depends on the signer. I do think this is valuable enough to standardize just that. I'm not sure how to design the more general version or if it even makes sense to think about it...

@Pandapip1 Pandapip1 changed the title EIP-TBD: Invalidation abstraction for signature-based operations powered by EIP-712 Add EIP-6077: Invalidation abstraction for signature-based operations powered by EIP-712 Dec 13, 2022
Copy link
Member

@Pandapip1 Pandapip1 left a comment

Choose a reason for hiding this comment

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

Please fix the walidator errors

Co-authored-by: Sam Wilson <[email protected]>
@Pandapip1 Pandapip1 changed the title Add EIP-6077: Invalidation abstraction for signature-based operations powered by EIP-712 Add EIP-6077: Invalidation for Signature-Based Operations Jan 25, 2023

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.
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.


## 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.
Copy link
Member

Choose a reason for hiding this comment

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

This reads like Rationale, not Motivation. Mind moving this to that section?

Comment on lines +18 to +19
- main sequnce of incremental nonces per signer
- sequence of incremental ids per signer per beneficiary
Copy link
Member

Choose a reason for hiding this comment

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

These should be complete sentences

}
```

- Operation EIPs SHOULD use at leat one of the nonces or ids sequences per signer defined by this EIP or both.
Copy link
Member

Choose a reason for hiding this comment

The 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?

k06a and others added 2 commits January 25, 2023 21:17
Co-authored-by: Pandapip1 <[email protected]>
Co-authored-by: Pandapip1 <[email protected]>
@github-actions
Copy link

The commit 911c35b (as a parent of b74e02d) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot added the w-ci Waiting on CI to pass label Jan 25, 2023
@github-actions
Copy link

There has been no activity on this pull request for 2 weeks. It will be closed after 3 months of inactivity. If you would like to move this PR forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review.

@github-actions github-actions bot added the w-stale Waiting on activity label Mar 18, 2023
@k06a
Copy link
Contributor Author

k06a commented Apr 8, 2023

Don't close it, it's still under discussion and consideration

@github-actions github-actions bot removed the w-stale Waiting on activity label Apr 9, 2023
@github-actions
Copy link

There has been no activity on this pull request for 2 weeks. It will be closed after 3 months of inactivity. If you would like to move this PR forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review.

@github-actions github-actions bot added the w-stale Waiting on activity label Apr 23, 2023
@k06a
Copy link
Contributor Author

k06a commented Apr 24, 2023

@frangio what do you think? Is it worth fixing? Do you still consider this kind of functionality in OZ library?

@github-actions github-actions bot removed the w-stale Waiting on activity label Apr 25, 2023
@frangio
Copy link
Contributor

frangio commented Apr 25, 2023

@k06a We're not quite thinking about this at the moment. Personally I have to look into this topic a bit more and it may need more research and discussion, and I don't think this is the place for that, so I would close this and might revisit later.

@github-actions
Copy link

There has been no activity on this pull request for 2 weeks. It will be closed after 3 months of inactivity. If you would like to move this PR forward, please respond to any outstanding feedback or add a comment indicating that you have addressed all required feedback and are ready for a review.

@github-actions github-actions bot added the w-stale Waiting on activity label May 10, 2023
@github-actions
Copy link

This pull request was closed due to inactivity. If you are still pursuing it, feel free to reopen it and respond to any feedback or request a review in a comment.

@github-actions github-actions bot closed this Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-new Creates a brand new proposal s-draft This EIP is a Draft t-erc w-ci Waiting on CI to pass w-stale Waiting on activity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants