Skip to content
On this page

Function: addressFromPrivateKey()

TypeScript
function addressFromPrivateKey(
   privateKey: PrivateKeyInput, 
   type: "p2wpkh" | "p2tr", 
   network?: "mainnet" | "testnet" | "regtest"): string;

Defined in: index.ts:391 (opens in a new tab)

The P2WPKH or single-key P2TR (BIP-86) address of privateKey, the address signMessage signs for.

ParametersLink to this section

ParameterTypeDefault
privateKeyPrivateKeyInputDefault undefined
type"p2wpkh" | "p2tr"Default undefined
network"mainnet" | "testnet" | "regtest"Default 'mainnet'

ReturnsLink to this section

string