EcKeyPair

Overview

Provides static utility methods for working with classical ECDSA/Schnorr key pairs on Bitcoin. EcKeyPair handles key generation, derivation, address generation, Taproot tweaking, multi-signature address creation, and address verification. It uses the secp256k1 curve with precomputed tables for optimized performance.

This class is entirely static and is not meant to be instantiated.

The full source code is available on GitHub at EcKeyPair.ts.

Import

import { EcKeyPair } from '@btc-vision/transaction';
import { networks } from '@btc-vision/bitcoin';

Static Methods

Key Pair Creation

fromWIF()
fromPrivateKey()
fromPublicKey()
generateRandomKeyPair()
fromSeed()
fromSeedKeyPair()

Wallet Generation

generateWallet()
generateQuantumKeyPair()

Address Generation

getTaprootAddress()
getP2WPKHAddress()
getLegacyAddress()
getLegacySegwitAddress()
getP2PKH()
getP2PKAddress()
getTaprootAddressFromAddress()
p2op()
generateMultiSigAddress()

Public Key Operations

tweakPublicKey()
tweakBatchSharedT()
tweakedPubKeyToAddress()
tweakedPubKeyBufferToAddress()
xOnlyTweakedPubKeyToAddress()
verifyPubKeys()

Address Verification

verifyContractAddress()

Properties

BIP32
ECPairSigner