We're using Relayer (Defender 2) to sign messages that are sent to an old contract (github > opengsn/gsn/tree/releases/v2.2.x).
This contract internally verifies the signature is valid according to the legacy constraints:
length == 65 bytes
v == 27 || 28
It's normal that the Relayer uses the latest method to sign the message, using the chain id and leading to longer signatures and specific v values per chain.
The problem is we cannot modify the already deployed [old] contract so we would need to, somehow, generate a legacy signature.
Is it possible to get a legacy signature (65 bytes long && v equal to 27 || 28) from the Relayer?
If there's no way to get it now, would it be possible to add a parameter to the /sign & /sign-typed-data endpoints to generate a legacy signature for backwards compatibility?
Related topics, that don't include any solution to that but bringing more info about newer method to sign and validate the signature are:
To reproduce, just call the /sign endpoint of the relayer and see the json response has a v different than 27 or 28:
import { Defender } from '@openzeppelin/defender-sdk';
const creds = { relayerApiKey: 'YOUR_RELAYER_API_KEY', relayerApiSecret: 'YOUR_RELAYER_API_SECRET' };
const client = new Defender(creds);
const result = await client.relaySigner.sign({ "message": "0x0" });
console.log(result);
Response for a mainnet relayer:
{
r: '0x123...',
s: '0x456...',
v: 37,
sig: '0x678...'
}