Anchor requires the allotment of 1 byte of space for a boolean value even though only 1 bit is required. Is there a way to use only 1 bit for booleans while still using Anchor for the serialization/deserialization?
1 Answer
You can't - Solana charges rent in lamports per byte-year, meaning the minimum amount of storage you can rent is one byte anyway. More info on rent can be found here.
Additionally, even if you could, I wouldn't recommend it: I assume you have other data types as well whose size you measure in bytes. Measuring some data types' size in bytes and some others' size in bits, makes serialization/deserialization significantly more error prone (which is also why I'd assume Solana made the above design decision in the first place).