Skip to content

Commit c33ca98

Browse files
committed
Add docs
1 parent 1e3f120 commit c33ca98

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/modules/ROOT/pages/utilities.adoc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,28 @@ In case your smart contract validates signatures, using xref:api:utils.adoc#ERC7
3434
----
3535
include::api:example$utils/cryptography/ERC7739SignerECDSA.sol[]
3636
----
37+
38+
==== ERC-7913 Signature Verifiers
39+
40+
ERC-7913 extends the concept of signature verification to support keys that don't have their own Ethereum address. This is particularly useful for integrating non-Ethereum cryptographic curves, hardware devices, or other identity systems into smart accounts.
41+
42+
The standard defines a verifier interface that can be implemented to support different types of keys. A signer is represented as a `bytes` object that concatenates a verifier address and a key: `verifier || key`.
43+
44+
xref:api:utils.adoc#ERC7913Utils[`ERC7913Utils`] provides functions for verifying signatures using ERC-7913 compatible verifiers:
45+
46+
[source,solidity]
47+
----
48+
using ERC7913Utils for bytes;
49+
50+
function _verify(bytes memory signer, bytes32 hash, bytes memory signature) internal view returns (bool) {
51+
return signer.isValidSignatureNow(hash, signature);
52+
}
53+
----
54+
55+
The verification process works as follows:
56+
57+
* If `signer.length < 20`: verification fails
58+
* If `signer.length == 20`: verification is done using https://docs.openzeppelin.com/contracts/5.x/api/utils#SignatureChecker[SignatureChecker]
59+
* Otherwise: verification is done using an ERC-7913 verifier.
60+
61+
This allows for backward compatibility with EOAs and ERC-1271 contracts while supporting new types of keys.

0 commit comments

Comments
 (0)