0

I would like to connect to a dApp with my gnosis safe and sign a welcome message to prove my identity to the dApp (my backend needs to know about the user).

  1. How are we supposed to handle the signature with a gnosis safe ?

  2. When i try using wallet connect to connect to the gnosis safe, I can then successfully sign the message through gnosis UI but the dApp doesn't know about it. Does it mean all the owners of the safe have to sign every time you log in the dApp ?

  3. Then, is it possible to sign the message offchain ? and how do you apply it ?

  4. I want the dApp still to be compatible with metamask, wallet connect. Do I need specific code for the signatures for gnosis ?

An full example would be very welcomed.

Thanks for your help !

PS: This example is basically what I'm trying to do but I need it to be compatible with gnosis https://github.com/vanbexlabs/ethereum-auth-demo

1 Answer 1

0

The work to sign and communicate with the smart contract needs to be done by a wallet not by your dapp, your dapp connects directly to the smart contract and just exposes which functions need to be signed by the wallet and sent to the blockchain, and read values from the smart contract to show information to the user.

Using an injected web3 is a way to solve for this, although I like better how WalletConnect does it: https://docs.walletconnect.com/

The specific way to handle the signature is explained by the EIP712 standard: https://eips.ethereum.org/EIPS/eip-712 But you shouldn't worry about the specific way if you are using something like WalletConnect, as you just need to tell the wallet that it needs to sign a 712 message: https://docs.walletconnect.com/json-rpc-api-methods/ethereum#eth_signtypeddata

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.