Bit-Wasp / bitcoin-php

Bitcoin implementation in PHP
The Unlicense
1.05k stars 419 forks source link

How to generate testnet address #899

Closed roleenboticario1 closed 2 years ago

roleenboticario1 commented 2 years ago

Hello, How to generate testnet address? Thanks here's what i saw. is it okay? thanks

// $network = NetworkFactory::bitcoinTestnet(); // $keyFactory = new PrivateKeyFactory(); // $privateKey = $keyFactory->generateCompressed(new Random()); // $addressHash = new PayToPubKeyHashAddress($privateKey->getPublicKey()->getPubKeyHash()); // $privateKeyWif = $privateKey->toWif($network); // $testnet_address = $addressHash->getAddress($network); // return $testnet_address;