Building MetaMask Wallet Ownership Verification in MyZubster
I’ve started implementing MetaMask / EVM wallet ownership verification inside MyZubster.
At first, this might sound like a simple “Connect Wallet” feature.
But I wanted to avoid one of the most common mistakes in Web3 UX:
treating “wallet connected” as if it automatically meant “identity verified”, “payment authorized”, or “transaction completed”.
For MyZubster, those states need to stay separate.
The architecture I’m building follows this rule:
CONNECTED
!=
VERIFIED
!=
SIGNED
!=
PAID
!=
SETTLED
That distinction is now becoming part of the product.
What we already had
MyZubster already had several EVM-related pieces in the codebase:
ethers
Ethereum Sepolia verification
Base Sepolia anchoring
Marketplace ETH support
NFT experiments
blockchain evidence flows
What was missing was the user-side ownership layer.
In other words:
How can a logged-in MyZubster user prove that they actually control a specific Ethereum wallet?
Without giving MyZubster the private key.
Without sharing a seed phrase.
Without sending ETH.
Without paying gas.
That became the first milestone.
The new flow
The flow now looks like this:
Authenticated MyZubster user
↓
Connect MetaMask
↓
eth_requestAccounts
↓
Read wallet address
↓
Read chain ID
↓
Request challenge from MyZubster
↓
Server creates short-lived nonce
↓
User signs message in MetaMask
↓
personal_sign
↓
Signature sent to backend
↓
Backend recovers signer
↓
Address matches?
↓
WALLET_VERIFIED
The important part is that verification happens server-side.
The frontend cannot simply tell MyZubster:
{
"walletVerified": true
}
and be trusted.
New API
I added four authenticated endpoints:
GET /api/wallet/me
POST /api/wallet/challenge
POST /api/wallet/verify
DELETE /api/wallet/disconnect
Their responsibility is intentionally narrow.
/challenge creates the ownership proof request.
/verify validates the signature.
/me returns the current wallet relationship.
/disconnect removes the verified association from the MyZubster account.
The challenge
The challenge includes context such as:
MyZubster account
wallet address
chain ID
domain
application URI
random nonce
issued time
expiration time
intended action
The intended action is currently:
LINK_WALLET
A simplified message looks like:
www.myzubster.com wants you to link your Ethereum account to MyZubster:
0x...
Sign this message to prove wallet control.
This is not a payment and does not spend ETH.
URI: https://www.myzubster.com
Version: 1
Chain ID: 1
Nonce: ...
Issued At: ...
Expiration Time: ...
Request ID: LINK_WALLET:user-id
That “not a payment” line is deliberate.
I don’t want a wallet signature to ever be confused with a transaction.
Why use a nonce?
Because the signature must not be reusable forever.
Each challenge is:
random
short-lived
account-bound
wallet-bound
action-bound
The backend checks:
challenge exists
↓
challenge is not expired
↓
wallet matches
↓
message matches
↓
signature is valid
↓
recovered signer matches wallet
Only then does the wallet become verified.
Signature verification
The backend uses ethers to recover the signer:
const recovered = verifyMessage(message, signature);
Then the recovered address is normalized and compared with the expected wallet.
If another wallet signs the challenge, verification fails.
What gets stored
MyZubster never stores:
private key
seed phrase
mnemonic
MetaMask password
wallet secret
Only wallet relationship metadata is persisted.
Conceptually:
evmWallet: {
walletType: 'EVM',
provider: 'metamask',
address: '0x...',
chainId: 1,
status: 'WALLET_VERIFIED',
verifiedAt: Date,
lastVerifiedAt: Date
}
Temporary challenge information is also stored server-side until verification or expiration.
Wallet state
I’m avoiding a single boolean like:
walletConnected = true
Instead, MyZubster has explicit states:
WALLET_NOT_CONNECTED
WALLET_CHALLENGE_PENDING
WALLET_VERIFIED
WALLET_DISCONNECTED
That becomes useful both for the UI and for Zorgax.
For example:
MetaMask connected
is not the same as:
wallet ownership verified
and neither means:
payment completed
Frontend
I extended the existing WalletHubPanel rather than creating a completely separate wallet system.
The user now gets a:
Connect MetaMask
action.
The frontend uses:
eth_requestAccounts
then:
eth_chainId
and finally:
personal_sign
The signature is then sent back to the backend for verification.
The UI explicitly explains that the signature:
does not transfer ETH
does not cost gas
does not authorize a payment
Preventing duplicate wallet ownership claims
Another issue is what happens if two MyZubster accounts try to link the same verified wallet.
The current behavior is:
Account A
→ verifies 0xABC
Account B
→ tries to verify 0xABC
Result:
WALLET_ALREADY_LINKED
This does not mean that MyZubster treats a wallet as a legal identity.
It simply prevents contradictory wallet-to-account relationships inside the application.
What changes in MyZubster
This creates a new trust layer.
MyZubster can already work with:
account identity
GitHub identity
community profile
Marketplace identity
Zorgax context
Now it can also say:
this account proved control
of this EVM wallet
at this time
That is a reusable building block.
The next milestone: signed Marketplace requests
This is where the wallet integration becomes much more useful.
The next step is to let a verified wallet sign a canonical Marketplace request.
Something like:
{
"schema": "myzubster.marketplace-request.v1",
"intent": "MARKETPLACE_REQUEST",
"listingId": "listing-123",
"quantity": 1,
"buyerAccountReference": "user-42",
"walletAddress": "0x...",
"nonce": "...",
"issuedAt": "...",
"expiresAt": "..."
}
The buyer signs it off-chain.
The server verifies it.
Then MyZubster can create:
MarketplaceOrder: REQUESTED
with cryptographic evidence attached.
No gas.
No blockchain transaction.
No payment.
Just signed intent.
Why not put every action on-chain?
Because not every interaction needs blockchain finality.
If every Marketplace request required a transaction, the UX would become unnecessarily heavy.
Instead, the architecture I’m aiming for is:
Marketplace request
↓
off-chain signature
↓
seller acceptance
↓
exchange lifecycle
↓
structured evidence
↓
optional blockchain anchor
Blockchain should be used where permanence adds value.
Not everywhere by default.
User wallet vs infrastructure wallet
This is also an important boundary.
MyZubster already has server-side blockchain infrastructure for evidence anchoring.
That wallet must stay completely separate from user wallets.
User MetaMask
!=
MyZubster infrastructure wallet
User-controlled wallet actions remain user-controlled.
Server-side evidence operations remain isolated.
How Zorgax can use this
Once the wallet state is explicit, Zorgax can explain it correctly.
For example:
User:
Is my wallet verified?
Zorgax:
Yes. Your MetaMask wallet ownership has been verified.
But if the user asks:
Did I pay?
Zorgax should answer:
No confirmed payment evidence exists.
Your wallet only signed the request.
That distinction is essential.
Security tests
I’ve added tests covering:
valid signer
wrong signer
expired challenge
non-payment message semantics
authenticated API wiring
MetaMask provider integration
The goal is not just to make the feature work.
The goal is to make it hard to misunderstand.
Current status
The first implementation is now open as:
PR #1385 — MetaMask wallet ownership linking
The PR adds:
wallet model
challenge service
signature verification
authenticated API
MetaMask UI
disconnect flow
security tests
This is not yet an ETH payment system.
It is the identity and ownership layer that payments or signed Marketplace actions can build on later.
Why this matters for MyZubster
The bigger change is architectural.
MyZubster is gradually moving toward a model where different kinds of evidence are handled by different layers:
MyZubster account
↓
wallet control
↓
signed intent
↓
Marketplace state
↓
payment evidence
↓
optional blockchain evidence
instead of:
connect wallet
↓
everything becomes blockchain
For me, that is the more useful direction.
MetaMask should not just be a button.
It should become a cryptographic tool that adds proof exactly where proof is useful.
Project: MyZubster
Stack: Node.js, Express, MongoDB, React, ethers, MetaMask
Current milestone: EVM wallet ownership verification
Next milestone: signed Marketplace requests without gas
Repository:
https://github.com/MyZubster-Ecosystem/myzubster
Implementation PR:
https://github.com/MyZubster-Ecosystem/myzubster/pull/1385