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

Let the user sign an arbitrary message with its keystore #976

Closed
Marketen opened this issue Feb 27, 2024 · 3 comments · Fixed by #982
Closed

Let the user sign an arbitrary message with its keystore #976

Marketen opened this issue Feb 27, 2024 · 3 comments · Fixed by #982
Assignees

Comments

@Marketen
Copy link

Marketen commented Feb 27, 2024

Currently, web3signer only permits signing certain types of data (as body payloads) in the /api/v1/eth2/sign/{identifier} ETH2 endpoint or /api/v1/eth1/sign/{identifier} ETH1 endpoint. See https://consensys.github.io/web3signer/web3signer-eth2.html

It would be nice to add an endpoint (probably in ETH2 mode or both ETH1 & ETH2) that signs an arbitrary payload sent by the user. Something like:

"message": {
    "platform": "dappnode",
    "timestamp": "185921877",
    "pubkey":
    "0xaf294f5663defdba078e0c16b349952ab762f8019f42f45fc0a369666e12d836247e4d7a3e3bd564826dcffcfdc50114"
},

This is outside web3signer main scope, it would let users sign messages not necessarily related to the eth2 protocol

@pablomendezroyo
Copy link

pablomendezroyo commented Mar 13, 2024

To follow best practices and let others benefit from this approach and not only dappnode, how feasible would it be to add to the standard a new type of signing to the existing endpoint /api/v1/eth2/sign/{identifier} to proof validation? something like "type": "PROOF_OF_VALIDATION":

Request:

{
  "type": "PROOF_OF_VALIDATION",
  "platform": "",
  "timestamp": "",
  "pubkey": "",
}

Edit: the pubkey might be omitted in the request as long as it is included as the identifier when doing the request

Response:

  "message": {
    "platform": "",
    "timestamp": "",
    "pubkey": "",
  },
  "signature": ""

@usmansaleem
Copy link
Contributor

@pablomendezroyo It is do-able as we already have DEPOSIT and VALIDATOR_REGISTRATION which doesn't take fork_info as input parameter. The only thing to work out is that all other types attach a "domain" when calculating the signing root. I am assuming this one would be a simple signing?

@pablomendezroyo
Copy link

@usmansaleem you right, it would be a simple signing

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 a pull request may close this issue.

3 participants