The following only represents the author’s current understanding
========
This is more or less a theoretical supplement to the previous article. It roughly sorts out the process and theoretical proof of a signature verification, and also fills in some knowledge about groups along the way (

Prerequisites: secp256k1, Finite Fields, and Elliptic Curve Point Operations
Because this involves a lot of modular arithmetic and elliptic curve point operations, I prepared a bit of prerequisite knowledge (and put up what I learned myself as well www. Of course, if you already know this, you can skip it.
Prerequisites
Ethereum wallet signatures use ECDSA, and the underlying curve is secp256k1. Before understanding r/s/v, public key recovery, and address generation, you need to understand three objects first:
- Finite field F_p
- Elliptic curve point group E(F_p)
- Base point G and its order n
1. The secp256k1 Curve
secp256k1 is defined over a finite field F_p. Its curve equation is:
where:
That is, the coordinates of points are not ordinary real numbers, but integers modulo p:
So the set of points on the curve is:
Here, O is the point at infinity, which can be understood as the zero element in point addition.
2. Point Addition on an Elliptic Curve
A kind of “addition” can be defined between elliptic curve points:
Note that this is not direct coordinate addition. In other words:
Instead, another point on the curve is computed through the elliptic curve group rules.
Let:
When P != Q, first compute the slope:
The division here is division modulo p, which means multiplying by the modular inverse.
Then:
We get:
When P = Q, this is called point doubling:
Tip: note that the current addition is also elliptic curve addition, not scalar-field addition.
At this point, the slope is:
Because the curve of secp256k1 is:
There is no ax term, so there is no additional a here.
3. Scalar Multiplication
Scalar multiplication is repeated point addition:
For example:
The most important relationship in a wallet is:
where:
- d: private key, a scalar
- G: the base point specified by secp256k1
- Q: public key, a curve point
It is fast to compute the public key Q from the private key d, but extremely difficult to derive the private key d from the public key Q. This is the elliptic curve discrete logarithm problem.
4. Base Point G and Order n
G is the generator point selected in the secp256k1 standard, also called the base point. Its order is n, meaning:
And:
Here, n is a large prime close to 2^256.
For secp256k1, there is an important property:
That is, the cofactor is 1. Therefore, the cyclic group of order n generated by G is the entire point group of the curve:
5. The Difference Between p and n
The easiest thing to confuse here is p and n.
p is the size of the coordinate field:
Coordinate calculations in point addition and point doubling are all performed under mod p.
n is the order of the base point G:
Scalar computations such as private keys, nonces, and r/s in signatures are all performed under mod n.
So you can remember it like this:
- Point coordinate calculations: mod p
- Scalar calculations: mod n
The private key in an Ethereum wallet satisfies:
The public key is:
The random number or deterministic nonce k used during signing also satisfies:
This structure is the mathematical foundation for the subsequent ECDSA signature formulas, public key recovery, and Ethereum address generation.
Alternatively, you can also look at my conversation with Gemini as a supplement (honestly, with AI, learning has sped up a lot
About an EOA Wallet Signature and Verification
As described in the previous article, when an address ownership verification requiring an EOA wallet occurs, the following process takes place:
-
A message conforming to SIWE is sent by the frontend to the wallet to request a signature
-
For such a signature request, after the wallet receives it, it pops up a prompt asking for the user’s approval
-
After the user confirms, the wallet signing process begins
-
First, the SIWE message is computed with keccak-256 to obtain a 32-byte hash for the following calculations
-
Then, using the wallet private key , the finite field of secp256k1, its standard selected base point , and the order of , the wallet generates a random number in the range [1,n-1] for the subsequent verification calculation (note here that because only [1,n-1] within n are usable non-repeating results, calculations such as point selection use mod n, while calculations over the whole secp256k1 range are performed within its own specified range p, i.e. mod p
-
The final generated signature is actually the concatenation of the three computed results , which are 32-byte/32-byte/1-byte respectively. Their calculations are:
-
-
-
-
exists because for a secp256k1 elliptic curve
at , besides the point at infinity , there are two solutions symmetric about the x-axis. specifies which solution should be chosen by providing the yParity 0/1 here (of course, for secp256k1, there may also be a case where , but because the probability is too small, the EVM does not consider this case during actual recovery
-
-
In this way, the final signature returned by the wallet to the server is generated
-
-
Next is the server’s verification of the obtained . At this point, the server knows the secp256k1 base point / the SIWE message sent to the wallet and its keccak-256-computed hash / the signature returned from the wallet
-
Then the server begins verification:
-
For the server, it already has / / / / . At this point, it needs to know whether the wallet address computed from this data is the same as the wallet address received at the beginning. According to
(that is, the address is the last 20 bytes of the keccak-256 hash result of the public key ), we can know that the current goal is to compute the public key from the current conditions
-
Besides the above data, what we can also know is the transformation process of (an integer computation in the scalar field), namely
So we can likewise obtain a transformed form:
Then the calculation enters the realm of elliptic curve point operations. Multiply both sides of the above equation by the base point
At the same time, we know that the public key , , and we know . Through , we can recover . Therefore, we can convert the above into a formula for solving the public key composed of known quantities
Thus, we obtain the public key of the signing wallet through computation
-
Then compute keccak-256 on the solved public key and take the last 20 bytes to obtain the wallet address used for verification. Then compare this address with the previously provided address. If the two are the same, the control over the current wallet can be verified using only the existing information, without knowing the private key . At the same time, since as an elliptic curve (under mod n), the result of computing (where d is in (a large prime close to )) can be quickly reached through repeated addition; while deriving d from Q belongs to the elliptic curve discrete logarithm problem on secp256k1. There is currently no feasible algorithm that can complete it within real-world resources: the complexity of a generic attack is about the level, and according to thermodynamics, even using all the energy in the universe, a computation would be impossible, thereby making it infeasible in engineering terms.
Tip: in actual EVM verification, there are also verifications for the domain/address/chainId and other fields inside the SIWE information. This section mainly discusses the mathematical implementation, so those are skipped here
-
-
Therefore, the server and wallet complete confirmation of wallet ownership using only the signature, the SIWE message, and some defined mathematical information, without exposing the private key
Conclusion
The above is roughly the mathematical proof behind a wallet signature and verification. Although it seems that with Google’s development in quantum computing, this may change soon, there should still be quite some time, and there is no problem with learning the classics (
That’s all. This can roughly be regarded as a supplement to the theoretical foundation behind the engineering practice of wallet signature verification.
If this article helped you, please share it with others!
Some information may be outdated






