> For the complete documentation index, see [llms.txt](/llms.txt).

# 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[​](#usage "Direct link to 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();

```
