For cryptocurrency miners, the aim of the game is to calculate the correct hash of each block. Each hash calculated by a miner has the same chance of being successful in this. In this article, we use the example of Bitcoin to explain aspects of how hashes work in practice.


When a block is generated, its block header contains a 256-bit hash of the previous block header in the blockchain, and another 256-bit hash of the Merkle Root of the block itself.

Solid Red   Market Research Solutions

The 256-bit hash is often expressed as a number in hexadecimal format. Rather than using base 10 decimals, hexadecimals use 0-9 followed by a-f. Each hex digit expresses a 4-bit binary string. An example of a hash expressed as a hexadecimal string is:
9a1f3a322ff119def6f220fe2bb37297b4d87e09fb93905d70dc0cf049684789

Public and Private Keys

Hashes are also used in derivation of public and private keys.

The public key can be shared safely with others, and the private key can be used to verify ownership of a particular address. Think of the pair as a public account number, and a private PIN. Sample public and private key pairs for Bitcoin can be generated online, and in Bitcoin clients.

The private key is an unsigned 256-bit (32 byte) number, and the public key is usually expressed as a 33 byte number comprising of a 256-bit number and a prefix. These pairs are derived from hashes of the Eliptic Curve Digital Signature Algorithm (ECDSA) in the process shown below.

PubKeyToAddr

If you have downloaded a wallet client, the public/private keypair is stored in the wallet data file, usually identifiable by its file name “wallet.dat”.

Base58Check

Base58Check is used to create more widely shared Bitcoin addresses. For example, the address which received the reward for mining the Bitcoin genesis block can be noted as: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa

The original Bitcoin client justifies using Base58 due to its exclusion of sometimes identical-looking characters 0, O, I and l. Use of this method was justified by Bitcoin’s creator due to ease of alphanumeric characters to be accepted as account numbers, ease of users to select an alphanumeric address by double clicking, and ability to express such addresses clearly in communications.

For more information, get in touch for a free consultation by contacting us using the form below:










    Alternatively, drop us an email at:
    info@csmall.co.uk

    C Small Solutions Think Big

    Categories: Tech

    0 Comments

    Leave a Reply

    Avatar placeholder

    Your email address will not be published. Required fields are marked *