
What is the most compact way of expressing data? - paulpauper
Obviously binary is the longest  but what would be the opposite of that? Would it be possible to compress a bitcoin key into a very small number of characters using Unicode and other special characters?
======
eindiran
Potentially you could use Unicode encoded in UTF-32, but since there are many
fewer Unicode code points than 2^32, there are a lot of valid 32-bit patterns
that don't map to a valid UTF-32 encoding of a Unicode code point. As a
result, most Bitcoin keys would contain invalid characters, so that scheme
doesn't work for all keys, but it does get you down to 8 characters for the
keys it does work for.

There are more than 2^16 Unicode code points, so you can definitely use
UTF-16, which will get you down to 16 characters.

One thing to note is that you're not actually getting any compression here:
each of these character strings is the result of the same 256-bit pattern.

To find out more about how much actual compression you could get of the data,
look up Kolmogorov complexity.[0] For most Bitcoin keys/random 256-bit
patterns, they aren't going to be significantly compressible, if at all.

[0]
[https://en.wikipedia.org/wiki/Kolmogorov_complexity](https://en.wikipedia.org/wiki/Kolmogorov_complexity)

------
brudgers
Code can be a compact way of expressing non-random data. All positive
integers:

    
    
      i=0
      while true:
       i = i + 1
       print i
    

Most data is non-random. Random data is hard to distinguish from noise.

------
javajosh
Binary is not longest; read up on Shannon entropy.
[https://en.wikipedia.org/wiki/Entropy_(information_theory)](https://en.wikipedia.org/wiki/Entropy_\(information_theory\))

