Building a Real MetaMask + Ethereum Sepolia Payment Flow for MyZubster

Leader ●2 ●24 ●155
calendar_today • schedule4 min read

Building a Real MetaMask + Ethereum Sepolia Payment Flow for MyZubster

I’ve been working on the next stage of the MyZubster Marketplace: connecting authenticated users, MetaMask wallets, signed marketplace requests, and real blockchain payment verification.

The target flow is:

MyZubster account
→ verified MetaMask wallet
→ signed marketplace request
→ seller acceptance
→ Ethereum Sepolia payment
→ server-side verification
→ PAID
→ COMPLETED

This week we reached an important milestone: real wallet ownership verification is working end-to-end.

What is working now

We created a completely isolated E2E environment on the VPS instead of experimenting directly in production.

The test stack currently runs as:

React frontend
127.0.0.1:3010

    ↓ proxy

MyZubster backend
127.0.0.1:5010

    ↓

MongoDB + Ethereum Sepolia RPC

The environment stays private. Instead of exposing the development ports publicly, I access the React frontend from my local machine using an SSH tunnel.

That also means I can use the real MetaMask browser extension against the remote test backend.

Real MetaMask verification

The first working flow is:

Authenticated MyZubster user

    ↓

Connect MetaMask

    ↓

Backend generates challenge

    ↓

MetaMask personal_sign

    ↓

Backend verifies signature

    ↓

Wallet becomes VERIFIED

And this is now working with a real wallet.

The UI successfully reached:

Verified · 0xBBBc51B471…03f514bCBb

with confirmation that the wallet was linked to the MyZubster account.

The important detail is that this is not a payment.

personal_sign is only being used to prove wallet ownership.

No ETH is transferred and no gas is consumed.

Authentication and wallet ownership are separate

One thing I wanted to preserve in the architecture is a strict distinction between platform identity and blockchain identity.

A user first authenticates with MyZubster, currently through mechanisms such as Google or GitHub OAuth.

MetaMask then proves control of an EVM address.

So:

AUTHENTICATED ≠ WALLET VERIFIED

And later:

WALLET VERIFIED
≠ REQUEST SIGNED
≠ TX SUBMITTED
≠ PAID
≠ COMPLETED

Those states should never collapse into a single “connected” status.

An interesting network detail

The wallet verification test happened while MetaMask was on:

chainId 84532

which is Base Sepolia.

The Marketplace payment system itself targets:

Ethereum Sepolia
chainId 11155111
0xaa36a7

That is intentional.

Wallet ownership verification proves control of an EVM address.

The actual payment step independently checks the required network and can request MetaMask to switch to Ethereum Sepolia before sending anything.

Signed Marketplace requests

The next layer is already implemented.

When a Buyer requests a real Marketplace listing, MyZubster can generate an order-specific challenge.

The Buyer signs it with MetaMask:

Marketplace listing

  ↓

Order challenge

  ↓

personal_sign

  ↓

Signature verification

  ↓

Signed request

Again, this does not move funds.

It creates cryptographic evidence that the verified Buyer wallet approved that specific request.

The Seller can then see wallet evidence before deciding whether to accept the order.

The payment architecture

After Seller acceptance, the server creates an ETH payment intent.

That intent defines the expected:

sender
recipient
amount
chain

The frontend then verifies that the currently selected MetaMask account matches the Buyer wallet.

It also verifies Ethereum Sepolia.

Only then can it call:

ethereum.request({
method: "eth_sendTransaction",
...
})

MetaMask still requires explicit approval from the user.

MyZubster never receives the private key.

A transaction hash is not proof of payment

This is probably the part of the architecture I care most about.

The browser submitting a transaction hash does not automatically change the order to PAID.

The backend independently checks the blockchain through the Sepolia RPC.

It verifies things such as:

correct sender
correct recipient
correct network
correct amount
successful transaction
minimum confirmations

The lifecycle can therefore look like:

TX_SUBMITTED

 ↓

CONFIRMING

 ↓

3 confirmations

 ↓

PAID

If something does not match, the verifier can reject the transaction instead.

What has actually been tested

So far the real environment has validated the isolated VPS deployment, frontend/backend proxy, Ethereum Sepolia RPC access, SSH browser access, OAuth-authenticated MyZubster session, MetaMask detection, wallet connection, real personal_sign, server-side signature verification, and successful wallet linking.

The blockchain payment code exists, but I am deliberately not calling the whole Marketplace payment flow complete yet.

What remains

The next E2E test needs two actors:

Seller account + Seller MetaMask wallet

Buyer account + Buyer MetaMask wallet

The Seller will create an ETH listing.

The Buyer will sign a request.

The Seller will inspect and accept it.

The Buyer will then submit a real Ethereum Sepolia transaction using test ETH.

Finally, the backend should independently detect and verify the transaction before changing the order to:

PAID

and eventually:

COMPLETED

After the happy path works, we still need negative tests for wrong wallets, wrong networks, wrong recipients, incorrect amounts, failed transactions, insufficient confirmations, and reused transaction hashes.

Why I’m building it this way

I don’t want “Connect Wallet” to become a magic button that implicitly means identity, authorization, payment, and settlement.

Each operation should have its own proof.

OAuth
→ proves the MyZubster account

Wallet signature
→ proves control of the address

Order signature
→ proves approval of the request

Blockchain transaction
→ proves value movement

Server verifier
→ proves that the transaction matches the order

That makes the system more complex than a simple wallet-connect demo, but it also makes the trust model much clearer.

The first major milestone is now working:

a real authenticated MyZubster user can connect MetaMask, sign an off-chain challenge, and have their EVM wallet independently verified and linked by the backend.

Next stop: the first complete Buyer → Seller transaction on Ethereum Sepolia.

🔥 Join developers growing publicly
Share your knowledge, build in public, and grow your developer presence with a global community.

More Posts

🚀 MyZubster: Completing a Real Ethereum Sepolia Marketplace E2E Payment Flow

Myzubster - Sep 26

ERC20 Edge Cases Every Smart Contract Engineer Should Know

BinnaDev - Jun 24

Debugging 6.5 Million PM2 Restarts: Stabilizing MyZubster Sepolia and I-ECO-01

Myzubster - Sep 26

Building MetaMask Wallet Ownership Verification in MyZubster

Myzubster - Sep 24

Part-1: Intro to MEV(Maximal Extractable value) Attack

abiEncode - Aug 7, 2025
chevron_left
4.4k Points • 181 Badges
Rimini
112Posts
17Comments
33Connections

Related Jobs

View all jobs →

Commenters (This Week)

2 comments
1 comment
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!