For those unfamiliar, blockchains have two main types of data structures propagated in their networks: blocks and transactions. Each block and transaction has a hash, just like key fingerprints. The following block explorer called Blockchair uses colored representations of sha256 hashes. What method is used to do this?

Example transaction hash

I've seen similar things like the Drunken Bishop cipher used by SSH, as well as the blockies identicon library used by some Ethereum GUI clients (which uses original Keccak-spec public key/contract hashes).


At closer examination, it seems that the most recent blocks start with three black boxes. Real Bitcoin mainnet block hashes are of very high difficulty to mine, and contain around 18 zeroes in the beginning. This leads me to believe that the first boxes correspond to color code #000000, or black, while the rest of the hash is grouped into triplets of 3 bytes and colored as that hex code. There are 4 left out hex digits (2 bytes, one on each side), as a 32 byte hash is not evenly divisible in 3.

Due to the avalanche effect observed by all modern cryptographic CRHFs, and the fact that the using color technically omits no information (although it might be hard to distinguish #000000 from #010101 visually, it's hard to find near-collisions due to this effect), this seems to be a clever way of representing transaction and block hashes, and may also work well on public key fingerprints. It's much easier to visually verify a few color swatches compared to dozens of hex digits (unless you're colorblind). In the case of colorblindness, a grayscale system of low to high brightness would also work.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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