Skip to content

P2PK outputs are not indexed under the correct address #109

@qtum-neil

Description

@qtum-neil

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions