# Use Cryptographic Libraries

In Solidity, verifying signatures is a crucial part of ensuring that only authorized parties can perform specific actions in a smart contract. Instead of writing custom signature verification logic, developers should rely on well-established [cryptography libraries](https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/utils/cryptography).

These libraries have been thoroughly tested and are less likely to contain critical bugs that could lead to exploits, such as unauthorized access or fraudulent transactions. Issues around `ecrecover`, like signature malleability or improper error handling, as well as potential integration bugs with ERC-1271 signatures, are also addressed by these libraries.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.optimumsec.xyz/coding/use-cryptographic-libs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
