This pr adds a new optional eths field to the grant token.
This field is used to signal that a token was signed with ethereum. Right now the only supported value is personal that should be used when signing a token with web3.eth.personal.sign. When using this sign method the message to sign is prefixed with :
eth_signature_input = ('\u0019Ethereum Signed Message:\n' + str(len(signature_input)) + signature_input.decode()).encode()
eths: 'personal' signals the gateway to add this prefix to the payload of the token before verifying the signature.
Since there is no standard way of producing ethereum signatures other tools may use a different prefix for the message (e.g. metamask). We can in the future add support for other tools by allowing other values for eths (e.g. eths: 'metamask')
Is this PR related with an open issue?
Related to Issue #
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Description
This pr adds a new optional
eths
field to the grant token.This field is used to signal that a token was signed with ethereum. Right now the only supported value is
personal
that should be used when signing a token withweb3.eth.personal.sign
. When using this sign method the message to sign is prefixed with :eths: 'personal'
signals the gateway to add this prefix to the payload of the token before verifying the signature.Since there is no standard way of producing ethereum signatures other tools may use a different prefix for the message (e.g. metamask). We can in the future add support for other tools by allowing other values for
eths
(e.g.eths: 'metamask'
)Is this PR related with an open issue?
Related to Issue #
Types of changes
Checklist: