I'm looking at this ethereum smart contract that iterates over an area in a 2D bool matrix to reserve pixels. When looking at a call to that ethereum smart contract for a 20x11 area, it used 0.0315 Ether ($9.36 on that date).
I made a Tezos smart contract with the same logic checks (except it's storing a
sp.big_map(tkey=sp.TPair(sp.TNat, sp.TNat), tvalue = sp.TBool) instead of a 2D bool matrix) and I'm seeing really high burn fees. When running the same operation to reserve a 20x11 area, the contract burned 3.68 Tez because it's storing 14741 bytes. If all I care about is setting the value of 220bits, then the storage requirement should only be 27.5 bytes which should bring down the burn fee to .006678 Tez.
What's the most efficient way to encode a 2D bool matrix?