Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying to generate P2PK address #886

Open
mindkind opened this issue Jul 16, 2021 · 1 comment
Open

trying to generate P2PK address #886

mindkind opened this issue Jul 16, 2021 · 1 comment

Comments

@mindkind
Copy link

mindkind commented Jul 16, 2021

`
$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
Copy link
Member

afk11 commented Jul 17, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants