Skip to content

feat: evm profile (Updated) (WIP)#1005

Draft
WaDadidou wants to merge 9 commits intomainfrom
evm-profile-updated
Draft

feat: evm profile (Updated) (WIP)#1005
WaDadidou wants to merge 9 commits intomainfrom
evm-profile-updated

Conversation

@WaDadidou
Copy link
Copy Markdown
Member

@WaDadidou WaDadidou commented Jan 14, 2026

Based on #908
I created this PR to keep the 908 intact.

I updated with main branch.
I added docs and TODOs and added guards to avoid blocking the user (Making this EVM implementation silent)
Mostly done with Claude Code, it's a test.


EVM Profile Integration - Exploration Branch

This branch explores storing Zenao user profiles on EVM-compatible blockchains alongside the existing backend.

Architecture: Hybrid Backend + Blockchain

Profile reads: Backend first → EVM fallback if no data
Profile writes: Backend (always) + Blockchain (optional, if configured)

Smart Contracts Required

1. Profile Contract - Stores profile data on-chain

  • get(address, key) - Read a profile field
  • getBatch(addresses[], keys[]) - Batch read multiple fields
  • set(key, value) - Write a profile field (transaction)
  • setBatch(keys[], values[]) - Batch write multiple fields (transaction)

Keys: pfp (avatar), dn (display name), bio (IPFS CID)

2. UserRegistry Contract - Maps Clerk userId ↔ wallet address (1:1)

  • linkWallet(userId) - Link caller's wallet to userId
  • getWallet(userId) - Get wallet for a userId
  • getUserId(wallet) - Get userId for a wallet

Current State

Implemented:

  • Web3Auth integration with Clerk authentication
  • Hybrid query system (backend + EVM)
  • Profile write to blockchain (optional, conditional on env vars)
  • Wallet/userId verification on connect
  • Smart contract ABIs defined
  • Complete Solidity contracts in docs/EVM_SMART_CONTRACTS.md

Not yet deployed:

  • Smart contracts (need deployment to testnet/mainnet)
  • Environment variables (placeholders in .env.example)

To Activate

  1. Deploy both smart contracts to a testnet (Optimism Sepolia or Base Sepolia recommended)
  2. Configure in .env.local:
    • NEXT_PUBLIC_EVM_RPC - RPC endpoint (e.g., Alchemy)
    • NEXT_PUBLIC_EVM_PROFILE_CONTRACT_ADDRESS - Profile contract address
    • NEXT_PUBLIC_EVM_USER_REGISTRY_ADDRESS - UserRegistry contract address
  3. Users must link their wallet to their userId via UserRegistry contract

Compatibility

Fully backward compatible: App works normally using only the backend if EVM env vars are not configured.

TODOs

  • Deploy smart contracts to testnet
  • Test profile creation/updates on-chain
  • Optimize: only update changed fields instead of all 3 keys
  • Add UI for wallet linking
  • Production deployment strategy

Norman and others added 9 commits November 28, 2025 19:30
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
Signed-off-by: Norman <norman@samourai.coop>
@netlify
Copy link
Copy Markdown

netlify Bot commented Jan 14, 2026

Deploy Preview for zenao failed.

Name Link
🔨 Latest commit 46d271f
🔍 Latest deploy log https://app.netlify.com/projects/zenao/deploys/6967a0a1ddec1600088a9387

@WaDadidou WaDadidou force-pushed the evm-profile-updated branch from 46d271f to f57f904 Compare January 14, 2026 13:55
@n0izn0iz
Copy link
Copy Markdown
Collaborator

@WaDadidou #908 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants