mobile wallpaper 1mobile wallpaper 2mobile wallpaper 3mobile wallpaper 4
1350 words
7 minutes
About an EOA Wallet Signature Verification and Related Content
2026-06-10

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 (

dreaife.tokyo
An EVM wallet login interface for EOAs
A practical EVM/EOA wallet login walkthrough covering connect wallet, SIWE-style messages, wagmi signing, nonce handling, and backend verification, explaining why login separates address connection from signature-based ownership proof.
dreaife.tokyo/en/posts/evm-wallet-login/

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:

y2x3+7(modp)y^2 \equiv x^3 + 7 \pmod p

where:

p=2256232977p = 2^{256} - 2^{32} - 977

That is, the coordinates of points are not ordinary real numbers, but integers modulo p: x,yFpx, y \in \mathbb{F}_p

So the set of points on the curve is: E(Fp)={(x,y)y2x3+7(modp)}{O}E(\mathbb{F}_p) = \{(x,y) \mid y^2 \equiv x^3 + 7 \pmod p\} \cup \{O\}

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:

P+Q=RP + Q = R

Note that this is not direct coordinate addition. In other words:

(x1,y1)+(x2,y2)(x1+x2,y1+y2)(x_1, y_1) + (x_2, y_2) \neq (x_1 + x_2, y_1 + y_2)

Instead, another point on the curve is computed through the elliptic curve group rules.

Let:

P=(x1,y1),Q=(x2,y2)P = (x_1, y_1), \quad Q = (x_2, y_2)

When P != Q, first compute the slope:

λy2y1x2x1(modp)\lambda \equiv \frac{y_2 - y_1}{x_2 - x_1} \pmod p

The division here is division modulo p, which means multiplying by the modular inverse.

Then:

x3λ2x1x2(modp)y3λ(x1x3)y1(modp) x_3 \equiv \lambda^2 - x_1 - x_2 \pmod p \\y_3 \equiv \lambda(x_1 - x_3) - y_1 \pmod p

We get:

P+Q=(x3,y3)P + Q = (x_3, y_3)

When P = Q, this is called point doubling:

2P=P+P2P = P + P

Tip: note that the current addition is also elliptic curve addition, not scalar-field addition.

At this point, the slope is:

λ3x122y1(modp)\lambda \equiv \frac{3x_1^2}{2y_1} \pmod p

Because the curve of secp256k1 is:

y2=x3+7y^2 = x^3 + 7

There is no ax term, so there is no additional a here.

3. Scalar Multiplication#

Scalar multiplication is repeated point addition:

[k]P=P+P++Pk times[k]P = \underbrace{P + P + \cdots + P}_{k \text{ times}}

For example:

[3]P=P+P+P[3]P = P + P + P

The most important relationship in a wallet is:

Q=[d]GQ = [d]G

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:

[n]G=O[n]G = O

And:

G={O,G,[2]G,[3]G,,[n1]G}\langle G \rangle = \{O, G, [2]G, [3]G, \ldots, [n-1]G\}

Here, n is a large prime close to 2^256.

For secp256k1, there is an important property:

h=1h = 1

That is, the cofactor is 1. Therefore, the cyclic group of order n generated by G is the entire point group of the curve:

#E(Fp)=n\#E(\mathbb{F}_p) = n

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:

x,y(modp)x, y \pmod p

Coordinate calculations in point addition and point doubling are all performed under mod p.

n is the order of the base point G:

[n]G=O[n]G = O

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:

1dn11 \le d \le n-1

The public key is:

Q=[d]GQ = [d]G

The random number or deterministic nonce k used during signing also satisfies:

1kn11 \le k \le n-1

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

Gemini
‎Gemini - direct access to Google AI
Created with Gemini
gemini.google.com/share/f72d7ecbcf76

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:

  1. A message conforming to SIWE is sent by the frontend to the wallet to request a signature

  2. For such a signature request, after the wallet receives it, it pops up a prompt asking for the user’s approval

  3. After the user confirms, the wallet signing process begins

    • First, the SIWE message is computed with keccak-256 to obtain a 32-byte hash ee for the following calculations

    • Then, using the wallet private key dd, the finite field pp of secp256k1, its standard selected base point GG, and the order nn of GG, the wallet generates a random number kk 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 r/s/vr/s/v, which are 32-byte/32-byte/1-byte respectively. Their calculations are:

      • R=kG=(Rx,Ry)R = kG = (R_{x}, R_{y})

      • r=Rxmodnr = R_{x} \bmod n

      • s=k1(z+rd)modns = k^{-1} * (z + r * d) \bmod n

      • vv exists because for a secp256k1 elliptic curve

        y2=x3+7modpy^2 = x^3 + 7 \bmod p

        at x=Rxx=R_x, besides the point at infinity 00, there are two solutions symmetric about the x-axis. vv specifies which solution should be chosen by providing the yParity 0/1 here (of course, for secp256k1, there may also be a case where r+n<pr+n<p, but because the probability is too small, the EVM does not consider this case during actual recovery

    • In this way, the final signature r/s/vr/s/v returned by the wallet to the server is generated

  4. Next is the server’s verification of the obtained r/s/vr/s/v. At this point, the server knows the secp256k1 base point GG / the SIWE message sent to the wallet and its keccak-256-computed hash ee / the signature r/s/vr/s/v returned from the wallet

  5. Then the server begins verification:

    • For the server, it already has GG / ee / rr / ss / vv. 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

      address=keccak256(QxQy)[12:32]address = keccak256(Q_x || Q_y)[12:32]

      (that is, the address is the last 20 bytes of the keccak-256 hash result of the public key QQ), we can know that the current goal is to compute the public key QQ from the current conditions

    • Besides the above data, what we can also know is the transformation process of ss (an integer computation in the scalar field), namely

      s=k1(z+rd)modns = k^{-1} * (z + r * d) \bmod n

      So we can likewise obtain a transformed form:

      d=r1(skz)modnd = r^{-1} * (s*k - z) \bmod n

      Then the calculation enters the realm of elliptic curve point operations. Multiply both sides of the above equation by the base point GG

      dG=(r1(skz)modn)G=r1(skGeG)\begin{align} dG &= \left(r^{-1}(sk - z) \bmod n\right)G \\ &= r^{-1}(skG - eG) \end{align}

      At the same time, we know that the public key Q=dGQ = dG, R=kGR=kG, and we know r=Rxr=R_x. Through vv, we can recover RR. Therefore, we can convert the above into a formula for solving the public key QQ composed of known quantities

      Q=r1(sReG)Q = r^{-1}(sR - eG)

      Thus, we obtain the public key QQ of the signing wallet through computation

    • Then compute keccak-256 on the solved public key QQ 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 dd. At the same time, since Q=dGmodnQ=dG \bmod n as an elliptic curve (under mod n), the result of computing dGdG (where d is in nn (a large prime close to 22562^{256})) 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 21282^{128} level, and according to thermodynamics, even using all the energy in the universe, a 22562^{256} 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

  6. 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.

Share

If this article helped you, please share it with others!

About an EOA Wallet Signature Verification and Related Content
https://dreaife.tokyo/en/posts/eoa-sign-verify/
Author
dreaife
Published at
2026-06-10
License
CC BY-NC-SA 4.0

Some information may be outdated

Related Posts Smart
1
An EVM wallet login interface for EOAs
WEB3 A practical EVM/EOA wallet login walkthrough covering connect wallet, SIWE-style messages, wagmi signing, nonce handling, and backend verification, explaining why login separates address connection from signature-based ownership proof.
2
Understanding Blockchain
WEB3 Blockchain is a structure composed of blocks linked in chronological order, with core characteristics such as decentralization, immutability, transparency, and security. Its workflow includes transaction creation, validation, packaging, and adding blocks to the chain. Application scenarios include cryptocurrencies, supply chain management, and financial services. Challenges include scalability, energy consumption, and user education. The underlying logic is based on distributed ledgers and consensus mechanisms to ensure data security and consistency.
3
Trading Journal
WEB3 Recent trading experience shows a relatively high win rate, especially with a short position on February 3 that produced significant profit. Although some gains were lost due to judgment errors, overall returns remain positive. The market is currently range-bound and may face a second test in the short term, so caution is needed. The trading strategy is mainly based on candlesticks and volume, with position allocation of 80% low-leverage trend trading, 10% high-leverage high-frequency trading, and the remaining funds used for on-chain operations. To avoid emotional trading, staying in cash is recommended when judgment is unclear, and high-risk operations should be considered after cash flow becomes stable.
4
The First Round of Screening in the New Era
life This article explores how, against the backdrop of rapid AI development, the cost of using advanced models will become a key factor in a new round of social screening. The author expresses concern that rising model usage fees may lead to a digital divide, pointing out that when usage costs increase from today’s subsidized prices to higher levels, ordinary users may struggle to afford them, resulting in class-based differentiation in technology access. The article also reviews AI’s diverse applications in fields such as security, video, and music, emphasizing that AI is expanding from a coding tool into broader industries. From a personal perspective, the author describes how to navigate the tide of the times with limited capital and calls for attention to the impact of technology costs on public access. Keywords: AI model costs, digital divide, technological screening, AI applications, anxiety of the times.
5
Psychological Record 1
psycho Realizing I’ve been suppressing my emotions, reflecting on how past living habits have led to fear of the outside world and inner stillness. Hoping to find my true self through interacting with the world, while facing the sense of responsibility in choosing a direction and the fear of losing other possibilities. The true self needs to be shaped through exploration, and choosing a future direction means giving up other possibilities.

Table of Contents