Search code examples
blockchainrpcbitcoinjson-rpc

Getting a list of public addresses from block zero


If I have a local blockchain downloaded, is it possible to use the bitcoin-core rpc commands to query a block? For example the genesis block to get a list of all the public addresses used in that block? If it is possible, which commands do I need to use?


Solution

  • You can use two sequenced command - getblockhash and getblock.

    • 1st, getblockhash, take block height, and returns hash of the block on specific height in the current main chain.
    • 2nd take hash and returns block.

    From linux command line to get block #10000, you can run:

    $ bitcoin-cli getblock `bitcoin-cli getblockhash 100000`