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

Secp256k1 Private Key

The getPrivateKey method returns the user's secp256k1 private key (the elliptic curve used by Ethereum and EVM-compatible chains). Use this key to sign transactions on EVM-compatible chains.

When you set useSFAKey to true in Web3AuthOptions, this method returns the single-factor authentication (SFA) key instead of the standard private key.

Usage

let privateKey = web3Auth.getPrivateKey()
On this page