Open Pfed-prog opened 9 months ago
It would be amazing to come back to some resource that contains more information on state optimization.
For example, @IamZKdevETH probably his github -> @iam-dev shared with me the following repository that aims to pack data
I am not sure if this is the right place to just post walls of texts, excuse me.
In ERC-20 some tokens implement states that contain strings, I think from projects implemented during hackathons this is the main thing that stands out to me.
I have posted some thoughts on how to use available URI for this purpose https://forums.minaprotocol.com/t/mina-smart-contract-uri/6232/2
Diving into a smart contract details further.
In On-chain state Section of a smart contract https://docs.minaprotocol.com/zkapps/o1js/smart-contracts#on-chain-state
It says that the state can consist of at most 8 fields of 32 bytes each.
But there are no details further. For example, I have used a simple trial and error method to see how this works in practice. For me 9 states worked as well.
Also, when I switched PublicKey instead of a Field the test script failed. Hence, PublicKey seems to take more space than a Field.
Removing one additional Field worked just fine.
I have tested my finding further -- and found out that 2 Fields is equivalent to 1 PublicKey