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

Handle P2PK addresses #73

Closed
martinboehm opened this issue Oct 9, 2018 · 1 comment
Closed

Handle P2PK addresses #73

martinboehm opened this issue Oct 9, 2018 · 1 comment

Comments

@martinboehm
Copy link
Contributor

There is an issue (caused by the design decision in Blockbook) with pay to public key addresses P2PK: bitcoin type coins in Blockbook use public key scripts, not addresses (as the value returned by by the abstraction bchain.AddressDescriptor from parsers) to index data. When searching for an address in explorer, Blockbook must convert the address to the script before the lookup.
The problem with P2PK address is that it is the same as pay to public key hash, but has different script (which cannot be obtained from the address). Blockbook therefore does not find the transactions of P2PK address and also computes balances of P2PK and P2PKH separately, with different results than returned some other explorers.

Fortunately there is a way how to change this behavior: detect in the parser.GetAddrDescFromVout and parser.GetScriptFromAddrDesc P2PK script and convert it to P2PKH script.

@martinboehm
Copy link
Contributor Author

P2PK scripts are converted to P2PKH address descriptors so that P2PK and P2PKH are indexed together. Existing databases must be reindexed for the feature to work.

bidoudan pushed a commit to stibits-inc/blockbook that referenced this issue Jul 4, 2022
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

1 participant