0

I want to implement a client similar to SPV client. The client will download block headers and coinbase transactions. There is an api of downloading block headers such as getheaders. However, it seemed that there is no api of downloading only a coinbase transaction.

Can I download only a coinbase transaction at a specified height without downloading all transactions at the same block height?

1 Answer 1

1

The Bitcoin p2p network doesn't provide any methods for downloading transactions at a specific index (in this question, zero) within a block. SPV clients aren't able to perform any sort of validation of transactions that aren't their own, and only basic validation of ones paying to them, so this sort of method isn't provided. Bitcoin Core additionally doesn't maintain indexes of transactions on disk so this would require an additional one to be built for the purpose, or have the node load entire blocks and re-parse them to find transaction positions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.