Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend Item to add noise for saving/loading #71

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

toml01
Copy link
Member

@toml01 toml01 commented Feb 8, 2023

FuzzyItem is basically a wrapper around Item.
Simply put, it is intended to obfuscate whether the value was changed during contract execution.

Currently, fuzz is implemented naively as a wrapping u8, bringing some basic obfuscation while keeping gas usage to a minimum. To improve the obfuscation quality, we can change fuzz to be either a

  1. bigger integer (e.g. u32)
  2. random byte(s)

at the expense of gas usage.

Another limitation is that since we have to keep a reference to Storage (to use a dtor), we have to implement both mutable and non-mutable versions e.g. FuzzyItemMut + FuzzyItem for it to be supported in both handle() and query().

Future PR would be to add an into_fuzzy_item() and into_fuzzy_item_mut() function to Item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants