Bit-Wasp / bitcoin-php

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

trying to generate P2PK address #886

Open mindkind opened 3 years ago

mindkind commented 3 years ago

` $publicKeyHex = "03c8fc5c87f00bcc32b5ce5c036957f8befeff05bf4d88d2dcde720249f78d9313"; $pubKeyFactory = new PublicKeyFactory(); $publicKey = $pubKeyFactory->fromHex($publicKeyHex); $pubKeyHash = $publicKey->getPubKeyHash();

// this one is from  andkom/php-bitcoin-address and it works
echo OutputFactory::p2pk($publicKey->getBinary())->address();

`

afk11 commented 3 years ago

The OutputFactory in andkom/php-bitcoin-address is a different implementation from that library, not this one.

I think the P2PK address is just the pubkey hex, unless I'm mistaken. What does andkom/php-bitcoin-address output and I'll see how we can match it?