The rest of your logic to derive the appPubKey from the private key remains the same.
2. Notes on v10 Changes
The provider is now accessed as web3auth.provider after a successful login.
You do not need to manually set up privateKeyProvider or chainConfig for standard EVM chains; these are managed via the Web3Auth Dashboard.
The method to get the private key is still available for EVM chains, but always ensure you’re using the correct provider object from the new SDK instance.
import { Web3Auth } from "@web3auth/modal";
// ...initialize and login with web3auth...
const privateKey = await web3auth.provider?.request({ method: "private_key" });
// Use your existing logic to get the compressed public key
const appPubKey = getPublicCompressed(window.Buffer.from(privateKey.padStart(64, "0"), "hex")).toString("hex");
Summary
The way to obtain the private key and derive the appPubKey is almost the same, but ensure you’re using web3auth.provider after login in v10.
No major change to your logic for generating the public key from the private key.
If you run into any issues with the provider or private key access, please share your initialization and login code snippet, and any error messages you receive.
Let us know if you need further clarification or run into any issues!
Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.
Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours