How to download the mapping of user's web2 handle and public key

I don’t know what went wrong. Our users reported that they got different public keys after the same Twitter authentication. And the background prompts that we have not created a verifyer

so we try to create a verifyer. However, the user’s web3 account will change after changing the verifyer. So we need to export the relationship between web2 and web3 accounts.

@0x8911 Welcome Aboard!

Which SDK did you create your app with? Did you link your verifier earlier to a project as per this announcement?

Was your Dapp earlier on Test enviornment?

Share a screenshot of the verifiers you have setup

We are using “@web3auth/modal”: “^7.0.5”. We do not use custom authentication and use the default authentication of Web3Auth.

Can you please upgrade to the latest version 7.2.0 ?

Was your app previously setup in Testnet before you got this prompt?

We will upgrade the SDK to 7.2.0.
But our key point is if we use the default authenticator of Web3Auth, is it possible for the same web2 account to hold different web3 addresses after authentication?

We already have an app on the Testnet.

Hello @0x8911 ,

Thank you for your query. In essence, maintaining a consistent account requires using the same client ID, SDK and web3auth network. Additionally, the user must authenticate with the same email and login method.

For more in-depth information, I recommend reviewing this documentation: Web3Auth - Troubleshooting Different Private Key. It provides a comprehensive explanation of scenarios leading to wallet address changes and strategies to prevent them.

Hope this clarifies your concerns.

Our team have fixed the issue and you should no longer be seeing the prompt to add custom verifier. Please check

In our production environment, the same Twitter logged in to two web3 addresses again. After our investigation, we found that the two verifiers were different (the first time was ‘web3auth’, the second time was ‘tkey-auth0-twitter’). May I ask why this happens?

Thank you so much. :grin:

Please share your complete implemention code

// Web3Auth Libraries
import { Web3AuthConnector } from '@web3auth/web3auth-wagmi-connector'
import { Web3Auth } from '@web3auth/modal'
import { EthereumPrivateKeyProvider } from '@web3auth/ethereum-provider'
import { OpenloginAdapter } from '@web3auth/openlogin-adapter'
import { CHAIN_NAMESPACES, WALLET_ADAPTERS } from '@web3auth/base'
import { Chain } from 'wagmi'

export default function Web3AuthConnectorInstance(chains: Chain[]) {
  const dev_clientId =
    'BIB3D_my_dev_clientId'
  const prod_clientId =
    'my_prod_clientId'
  // Create Web3Auth Instance
  const name = 'my_name'

  const chainConfig = {
    chainNamespace: CHAIN_NAMESPACES.EIP155,
    chainId: '0x' + chains[0].id.toString(16),
    rpcTarget: chains[0].rpcUrls.default.http[0],
    displayName: chains[0].name,
    tickerName: chains[0].nativeCurrency?.name,
    ticker: chains[0].nativeCurrency?.symbol,
    blockExplorer: chains[0].blockExplorers?.default.url as string
  }

  const mode = process.env.NEXT_PUBLIC_APP_MODE
  const web3AuthInstance = new Web3Auth({
    clientId:
      mode === 'PROD' || mode === 'STAGING' ? prod_clientId : dev_clientId,
    web3AuthNetwork:
      mode === 'PROD' || mode === 'STAGING'
        ? 'sapphire_mainnet'
        : 'sapphire_devnet',
    chainConfig,
    uiConfig: {
      defaultLanguage: 'en',
      appName: name,
      mode: 'light',
      loginMethodsOrder: ['twitter', 'google'],
      loginGridCol: 2,
      logoLight: 'https://my_logo.png',
      primaryButton: 'socialLogin'
    }
  })

  const privateKeyProvider = new EthereumPrivateKeyProvider({
    config: { chainConfig }
  })
  const openloginAdapterInstance = new OpenloginAdapter({
    privateKeyProvider,
    adapterSettings: {
      network: 'cyan',
      uxMode: 'popup',
      whiteLabel: {
        appName: 'My Wallet',
        defaultLanguage: 'en',
        mode: 'light',
        logoLight: 'https://my_logo.png'
      }
    }
  })
  web3AuthInstance.configureAdapter(openloginAdapterInstance)

  return new Web3AuthConnector({
    chains: chains as any,
    options: {
      web3AuthInstance,
      modalConfig: {
        [WALLET_ADAPTERS.WALLET_CONNECT_V2]: {
          label: 'wallet_connect',
          showOnModal: false
        },
        [WALLET_ADAPTERS.OPENLOGIN]: {
          label: 'openlogin',
          loginMethods: {
            apple: {
              name: 'apple',
              showOnModal: false
            },
            facebook: {
              name: 'facebook',
              showOnModal: false
            },
            reddit: {
              name: 'reddit',
              showOnModal: false
            },
            twitch: {
              name: 'twitch',
              showOnModal: false
            },
            line: {
              name: 'line',
              showOnModal: false
            },
            github: {
              name: 'github',
              showOnModal: false
            },
            kakao: {
              name: 'kakao',
              showOnModal: false
            },
            linkedin: {
              name: 'linkedin',
              showOnModal: false
            },
            weibo: {
              name: 'weibo',
              showOnModal: false
            },
            wechat: {
              name: 'wechat',
              showOnModal: false
            },
            sms_passwordless: {
              name: 'sms_passwordless',
              showOnModal: false
            }
          }
        }
      }
    }
  })
}

'use client'

import { ChakraProvider } from '@chakra-ui/react'
import { CacheProvider } from '@chakra-ui/next-js'
import { configureChains, createConfig, WagmiConfig } from 'wagmi'
import { supportConnectChain } from '@/constants/chain'
import { theme } from '@/styles/theme'
import { publicProvider } from 'wagmi/providers/public'
import { QueryClient, QueryClientProvider } from 'react-query'
import { useEffect, useState } from 'react'
import Web3AuthConnectorInstance from '@/app/Web3AuthConnectorInstance'

const { chains, publicClient } = configureChains(supportConnectChain, [
  publicProvider()
])

const wagmiConfig = createConfig({
  autoConnect: true,
  connectors: [Web3AuthConnectorInstance(chains)],
  publicClient
})

const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      refetchOnWindowFocus: false,
      retry: 1
    }
  }
})

export function Providers({ children }: { children: React.ReactNode }) {
  const [mounted, setMounted] = useState(false)
  useEffect(() => setMounted(true), [])
  return (
    <QueryClientProvider client={queryClient}>
      <CacheProvider>
        <ChakraProvider theme={theme}>
          <WagmiConfig config={wagmiConfig}>{mounted && children}</WagmiConfig>
        </ChakraProvider>
      </CacheProvider>
    </QueryClientProvider>
  )
}

Where are you seeing this information? Can you share a screenshot ?

I see in your openlogin Adapter settings, you have set the network: ‘cyan’, but the web3AuthNetwork is set as sapphire_mainnet ?


In order to troubleshoot this problem, userInfo is recorded after user authentication.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.