Cosigners and multi-signature verification
Providing multi-signature verification support for dApps
A guardian is a trusted party, added by the user, that acts as a cosigner/co-validator for the user's account when carrying out typical wallet operations or for recovery purposes.
For most of Argent's products e.g Web Wallet, Argent Shield etc, the guardian is usually Argent's backend. In the next section, let's take a look at how you can verify multi-signatures for accounts with an active guardian.
Verifying multi-signatures
From a dApp's end, explicit support has to be provided for verifying multi-signatures, or account owners with 2FA enabled will be unable to sign transactions. This could be done in a few lines of codes.
Given a message to sign:
The user connects his account to sign the message, after which the signature and account address will be returned.
For a normal account without 2FA, you should get a single signature pair [r1, s1]
, but for shield accounts, you should get a concatenated array of the owner and guardian signatures [r1, s1, r2, s2]
, which could be verified by simply calling the isValidSignature
or is_valid_signature
method of the account contract:
Last updated