Live data from Hacker News

Representing SHA-256 Hashes as Avatars

francoisbest.com

11–20 of 75 posts

Re: Representing SHA-256 Hashes as Avatars

#11
post #7
post #4

As a warning, this would not be good for colorblind people (such as myself). The "Hello, Hacker News!" Hash's middle ring has half it's ring that looks identical to me, and unless I looked carefully, that entire ring looked the same to me.

What would you suggest as a solution ? I considered swapping Hue for Lightness in order to increase contrast changes. Would you be interested in testing out some variants ?

Your Hue choices are selected from a pool of 16 with various mutators applied. Hue alone isn't a viable path forward, so finding a translation of Hue to a non-Hue representation that doesn't worsen the diagram is essential.

You could apply repeating surface textures inside each slice, rather than showing a solid color, so that Hue 1 shows repeating dots, Hue 2 shows repeating lines, Hue 3 shows repeating triangles.

You could use a Braille-like 2x2 grid to represent the 4-bit Hue space as circles and lines within each slice.

If you imagine that each slice has 4 walls, replacing the missing fourth wall of the innermost slices with the innermost corner, then you could map the binary representation of 2^4 hue (such as 0110) onto "bites" out of the walls. For example, given 0110, map the 0s onto "bites" and punch a small hole into two adjacent walls of the slice; given 0000, punch a small hole into all four walls.

ASCII art of what I mean by "punch a hole into the wall", for Hue 0111 (one zero, so one hole punched). This is an uncurved slice, because ASCII art.

     ____________
    |            |
    |     __     |
    |____/  \____|

Re: Representing SHA-256 Hashes as Avatars

#13
post #9
post #5

Suggestion: shave off two bits, and switch between the variants in the "A bit of fun" section: https://francoisbest.com/posts/2021/hashvatars#a-bit-of-fun

What do you mean by "shave off 2 bits"?

I think he means use 2 bits to decide the variation

Re: Representing SHA-256 Hashes as Avatars

#14
post #7

Earlier quoted context omitted.

What would you suggest as a solution ? I considered swapping Hue for Lightness in order to increase contrast changes. Would you be interested in testing out some variants ?

Your Hue choices are selected from a pool of 16 with various mutators applied. Hue alone isn't a viable path forward, so finding a translation of Hue to a non-Hue representation that doesn't worsen the diagram is essential. You could apply repeating surface textures inside each slice, rather than showing a solid color, so that Hue 1 shows repeating dots, Hue 2 shows repeating lines, Hue 3 shows repeating triangles. Y…

That's a great suggestion, I love the "hole punching" idea (although it'll probably end up looking like Swiss cheese).

The key is to find a solution that looks good enough when zoomed out to ~64px square, which is tricky for details, especially in the inner ring where sections are packed so close from one another.

Re: Representing SHA-256 Hashes as Avatars

#15
post #7
post #4

As a warning, this would not be good for colorblind people (such as myself). The "Hello, Hacker News!" Hash's middle ring has half it's ring that looks identical to me, and unless I looked carefully, that entire ring looked the same to me.

What would you suggest as a solution ? I considered swapping Hue for Lightness in order to increase contrast changes. Would you be interested in testing out some variants ?

The primary issue in colorblindness is:

1) One confuses two types of colors as the same one (e.g. red-green, blue-yellow, etc. colorblind) or

2) Colors that are close together appear to be the identical (Like the case that I saw, half of the row looked exactly the same to me, the the entire row looked the same until I looked close).

Perhaps a mix of shapes and colors would make it more obvious? Or constrasting the border colors too to hightlight closer difference (like if you have "f8" and "f0", which has a hamming distance of 1, you make the boarder somehow highlight the differences.

Don't get me wrong, I think it is a neat idea! I just want you to be aware.

Re: Representing SHA-256 Hashes as Avatars

#16
post #8

It would be a lot more work, but it might work better if you picked something which humans are particularly tuned to notice subtle details such as faces.

Using the hash as a seed for an AI face generator like thispersondoesnotexist would be pretty powerful. Free idea for anyone who wants to give it a shot.

Look at that, you reinvented NFTs such as CryptoPunks :) https://www.larvalabs.com/cryptopunks

Re: Representing SHA-256 Hashes as Avatars

#17
post #15
post #7

Earlier quoted context omitted.

What would you suggest as a solution ? I considered swapping Hue for Lightness in order to increase contrast changes. Would you be interested in testing out some variants ?

The primary issue in colorblindness is: 1) One confuses two types of colors as the same one (e.g. red-green, blue-yellow, etc. colorblind) or 2) Colors that are close together appear to be the identical (Like the case that I saw, half of the row looked exactly the same to me, the the entire row looked the same until I looked close). Perhaps a mix of shapes and colors would make it more obvious? Or constrasting the bo…

Thanks for your feedback. Are the color-blindness simulators in Firefox devtools good enough to reproduce your experience? Or do you have tools that you'd recommend?

Re: Representing SHA-256 Hashes as Avatars

#18

Earlier quoted context omitted.

Your Hue choices are selected from a pool of 16 with various mutators applied. Hue alone isn't a viable path forward, so finding a translation of Hue to a non-Hue representation that doesn't worsen the diagram is essential. You could apply repeating surface textures inside each slice, rather than showing a solid color, so that Hue 1 shows repeating dots, Hue 2 shows repeating lines, Hue 3 shows repeating triangles. Y…

That's a great suggestion, I love the "hole punching" idea (although it'll probably end up looking like Swiss cheese). The key is to find a solution that looks good enough when zoomed out to ~64px square, which is tricky for details, especially in the inner ring where sections are packed so close from one another.

I imagine that's why square hashes are more common than circles: the raw information density problem.

Re: Representing SHA-256 Hashes as Avatars

#19
I still like snowflakes for this: https://levien.com/snowflake-explain.html is a half-finished blog post explaining the motivation and algorithm I came up with. I never did careful user testing, but suspect that the answer would be that some people can reliably distinguish the patterns, others won't be able to.

In any case, there are a lot of variations on this "visual hash" idea, including the original fractal one, and I heard of more recent work to use the hash to seed StyleGAN face generation.

Re: Representing SHA-256 Hashes as Avatars

#20
The problem with hash avatars in general is that people want to use them for identity verification -- and humans are wired to do so automatically -- but technologically, they cannot provide this. The space of possible avatars (2^256, in this case) is far, far larger than the number of distinct objects that humans can distinguish between. Which means that there will invariably be "collisions:" two avatars that are not identical, but appear identical to humans. As a result, if an attacker can brute-force an avatar that looks very similar to, say, Elon Musk's avatar, they can trivially scam people.

It follows that, since avatars do not provide any proof of identity, there is actually no harm in greatly truncating the hash space when generating them! That is, rather than trying to encode all 256 bits into the avatar, you can use a much more manageable number, like 16. But isn't this too small? Won't there be lots of collisions? Yes -- but that's a feature! If collisions are common, then the average user will be aware that avatar != identity, which makes them less susceptible to scamming. But 16 bits is still enough to meet the real goal of avatars: quickly distinguishing between different people in a conversation (or transaction, or whatever).

(This also shows why making avatars more costly to generate, e.g. with scrypt, can do more harm than good: doing so makes collisions less likely, but still not impossible. Meaning that if a collision does occur, whether accidental or malicious, you are less likely to notice it.)

Post reply on HN