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 support for EIP-712 typed data signing in livepeer_cli #2157

Merged
merged 8 commits into from
Dec 27, 2021
Merged

Conversation

yondonfu
Copy link
Member

@yondonfu yondonfu commented Dec 27, 2021

What does this pull request do? Explain your changes. (required)

This PR adds support for EIP-712 typed data signing in livepeer_cli.

Prior to this PR, the "Sign message" option in livepeer_cli sent a request to the /signMessage endpoint on the node's server in order to sign an arbitrary user provided message. The L1Migrator contract for the Confluence LIP allows signature based authorization, but uses the more recent EIP-712 signing standard which describes a standard way to sign the hash of structured data.

Specific updates (required)

In order to support EIP-712 signing in livepeer_cli I've made the following updates:

  • Upgraded the go-ethereum dep in order to use the latest package APIs for EIP-712 signing
  • Added a SignTypedData() method to complement the existing Sign() method in the eth.AccountManager implementation
  • Added support for requesting EIP-712 signing in the /signMessage handler by setting a SigFormat header
  • Added a "Sign typed data" option in livepeer_cli to complement the existing "Sign message" option

How did you test each of these updates (required)

Updated unit tests and manually tested EIP-712 signing with livepeer_cli.

Does this pull request close any open issues?

Fixes #2141

Checklist:

@yondonfu yondonfu marked this pull request as ready for review December 27, 2021 20:21
Copy link
Contributor

@darkdarkdragon darkdarkdragon left a comment

Choose a reason for hiding this comment

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

small typo, otherwise LGTM

server/handlers.go Outdated Show resolved Hide resolved
@yondonfu yondonfu merged commit 1ec6899 into master Dec 27, 2021
@yondonfu yondonfu deleted the yf/eip-712 branch December 27, 2021 22:10
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.

Support EIP-712 signing
2 participants