Skip to content

Commit dae4312

Browse files
a1111198ernestognw
andauthored
Update ECDSA documentation to reference ethers and viem libraries
This commit updates the ECDSA documentation to reference the more current `ethers` and `viem` libraries for generating Ethereum account ECDSA signatures. Changes made: - Updated reference from `web3.eth.sign` to `signMessage` function in the ethers library and viem documentation. These changes provide more relevant and up-to-date information for developers using the ECDSA functions. I have ensured that the updated links point to the correct sections of the ethers and viem documentation. Co-authored-by: Ernesto García <ernestognw@gmail.com>
1 parent cbadbb4 commit dae4312

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/modules/ROOT/pages/utilities.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ At a high level, signatures are a set of cryptographic algorithms that allow for
1212

1313
==== Ethereum Signatures (secp256k1)
1414

15-
xref:api:utils.adoc#ECDSA[`ECDSA`] provides functions for recovering and managing Ethereum account ECDSA signatures. These are often generated through https://web3js.readthedocs.io/en/v1.7.3/web3-eth.html#sign[`web3.eth.sign`], and are a 65 byte array (of type `bytes` in Solidity) arranged the following way: `[[v (1)], [r (32)], [s (32)]]`.
15+
xref:api:utils.adoc#ECDSA[`ECDSA`] provides functions for recovering and managing Ethereum account ECDSA signatures. These are often generated through the https://docs.ethers.org/v6/api/providers/#Signer-signMessage[`signMessage`] function in the ethers library (https://viem.sh/docs/accounts/custom#signmessage[available for viem users] as well), and are a 65 byte array (of type `bytes` in Solidity) arranged the following way: `[[v (1)], [r (32)], [s (32)]]`.
1616

1717
The data signer can be recovered with xref:api:utils.adoc#ECDSA-recover-bytes32-bytes-[`ECDSA.recover`], and its address compared to verify the signature. Most wallets will hash the data to sign and add the prefix `\x19Ethereum Signed Message:\n`, so when attempting to recover the signer of an Ethereum signed message hash, you'll want to use xref:api:utils.adoc#MessageHashUtils-toEthSignedMessageHash-bytes32-[`toEthSignedMessageHash`].
1818

0 commit comments

Comments
 (0)