SDK
Guides
Signatures

Safe Signatures

This guide shows how Safe signatures work and how to generate them using the Protocol Kit.

Prerequisites

Install dependencies

yarn install @safe-global/protocol-kit

Setup

Safe accounts can be configured with different threshold values and types of owners. Safe owners can be any Ethereum address, such as:

  • Externally-owned accounts (EOAs). They generate an ECDSA signature to approve Safe transactions.
  • Smart accounts that implement the EIP-1271 (opens in a new tab) for signature validation, like Safe does. They use a different signature algorithm depending on the implementation of the smart account.

In the following guides, there are different accounts involved that will be used as an example:

WhoDescriptionAddress for this example
safe3_43/4 Safe (3 signatures required out of 4 owners)0xb3b3862D8e38a1E965eb350B09f2167B2371D652
owner1EOA and owner of safe3_40x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1
owner2EOA and owner of safe3_40xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0
safe1_11/1 Safe and owner of safe3_40x215033cdE0619D60B7352348F4598316Cc39bC6E
owner3EOA and owner of safe1_10x22d491Bde2303f2f43325b2108D26f1eAbA1e32b
safe2_32/3 Safe and owner of safe3_40xf75D61D6C27a7CC5788E633c1FC130f0F4a62D33
owner4EOA and owner of safe2_30xE11BA2b4D45Eaed5996Cd0823791E0C93114882d
owner5EOA and owner of safe2_30xd03ea8624C8C5987235048901fB614fDcA89b117

Each EOA owner described above is bound to an EthAdapter instance that should also be initialized.

AdapterSigner
ethAdapter1owner1
ethAdapter2owner2
ethAdapter3owner3
ethAdapter4owner4
ethAdapter5owner5

Guides

Transaction signatures

  • The Transaction signatures guide explains how transactions are signed by Safe owners using the Protocol Kit.

Message signatures

  • Using the Protocol Kit, the Message signatures guide explains how to generate and sign messages, including plain string messages and EIP-712 JSON messages.

Was this page helpful?