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

P2PK outputs are not indexed under the correct address #109

Open
qtum-neil opened this issue Apr 25, 2022 · 0 comments
Open

P2PK outputs are not indexed under the correct address #109

qtum-neil opened this issue Apr 25, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@qtum-neil
Copy link

Is your feature request related to a problem? Please describe.
P2PK outputs (OP_DATA_65 OP_CHECKSIG, OP_DATA_33 OP_CHECKSIG) are indexed under their output hex value, because bitcoin client does not return an address for those under scriptPubkey when decoding such transactions (https://github.com/coinbase/rosetta-bitcoin/blob/master/bitcoin/client.go#L777). This results in balances being incorrect for addresses that receive P2PK outputs.

Describe the solution you'd like
P2PK outputs should be correctly detected and indexed under their corresponding address to avoid balance discrepancies. as it is the case in all wallets.

Describe alternatives you've considered
An alternative to this could be aggregating balances for both the address and its P2PK hex script when querying the balance, but it would be best to fix this at the indexing level.

@qtum-neil qtum-neil added the enhancement New feature or request label Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant