import * as bitcoin from 'bitcoinjs-lib'
import ECPairFactory from 'ecpair';
import * as ecc from 'tiny-secp256k1';
const ECPair = ECPairFactory.ECPairFactory(ecc)
const keyPair = ECPair.makeRandom();
const privateKey = keyPair.privateKey.toString('hex');
const publicKey = keyPair.publicKey.toString('hex');
const { address } = bitcoin.payments.p2pkh({ pubkey: keyPair.publicKey });
console.log('Private Key:', privateKey);
console.log('Public Key:', publicKey);
console.log('Bitcoin Address:', address);