You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The domainSeparator allows dApp developers be guaranteed that there can be no signature collision between multiple DApps.
Having said that, there's no need to include it as part of the Relay Data of the Request
Right now the included domainSeparator is only used on the signature verification, the RIF Relay system is not filtering nor registering specific domains (which could be used to allowing only specific registered domainSeparators to participate on RIF Relay). The specific SmartWallet Template in use for the invoked SmartWallet instance is the one that knows what domainSeparator to accept
For that reason, including the domainSeparator on the request is only making the relay call more expensive.
The default SmartWallet template included in our repo already has all the information to calculate the domainSeparator as a constant value:
The
domainSeparator
allows dApp developers be guaranteed that there can be no signature collision between multiple DApps.Having said that, there's no need to include it as part of the Relay Data of the Request
Right now the included
domainSeparator
is only used on the signature verification, the RIF Relay system is not filtering nor registering specific domains (which could be used to allowing only specific registered domainSeparators to participate on RIF Relay). The specific SmartWallet Template in use for the invoked SmartWallet instance is the one that knows whatdomainSeparator
to acceptFor that reason, including the
domainSeparator
on the request is only making the relay call more expensive.The default SmartWallet template included in our repo already has all the information to calculate the
domainSeparator
as a constant value:require( keccak256(abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256("RSK Enveloping Transaction"), //DOMAIN_NAME DATA_VERSION_HASH, getChainID(), address(this))) == domainSeparator, "Invalid domain separator" );
Once the
domainSeparator
attribute is removed from the request, this verification can be deleted. That won't affect the signature verificationrequire( RSKAddrValidator.safeEquals( keccak256(abi.encodePacked( "\x19\x01", domainSeparator, keccak256(_getEncoded(suffixData, req))) ).recover(sig), req.from), "signature mismatch" );
We just need to replace
domainSeparator
attribute which was received as an input parameter with the constant value that we already know:bytes32 private constant domainSeparator = keccak256(abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256("RSK Enveloping Transaction"), //DOMAIN_NAME DATA_VERSION_HASH, getChainID(), address(this)))
Just in case background information regarding EIP712 and how to use it is needed, I leave a link to a medium article from Metamask on how to use EIP712
The text was updated successfully, but these errors were encountered: