For AI agents: a documentation index is available at /llms.txt. A markdown version of this page is available at the same URL with .md appended (or via Accept: text/markdown).
Skip to main content

Get secp256k1 private key

After a user signs in, retrieve their secp256k1 private key from the sign-in response or by calling getPrivateKey(). Use this key with a Unity-compatible library to sign transactions on EVM-compatible chains. Never log or persist an unencrypted private key.

Usage

private void onLogin(Web3AuthResponse response)
{
var privateKey = response.privateKey;

// Use private key for EVM transactions
}

You can also retrieve the key from the active session:

var privateKey = web3Auth.getPrivateKey();
On this page