5
4
I need some PHP code to generate bitcoin addresses from a given public key.
I can only find algorithms to generate addresses from the master private key but according to https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses the private key is not required at all.
You can do PublicKeyFactory::fromHex and avoid using a private key. For newer versions, getAddress was removed, see this example https://github.com/Bit-Wasp/bitcoin-php/blob/9e535f04665ba22ba2b8b63f371ec50d2e7eabb8/examples/addresstypes.script.php#L16-18
– karimkorun – 2019-05-16T14:46:13.027This answer still uses a private key and is not purely public key based, like asked for. – Wouter – 2018-06-24T12:10:51.733