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

Figure out strings within an MPC context #15

Open
Mikerah opened this issue Dec 24, 2021 · 2 comments
Open

Figure out strings within an MPC context #15

Mikerah opened this issue Dec 24, 2021 · 2 comments

Comments

@Mikerah
Copy link
Contributor

Mikerah commented Dec 24, 2021

While designing the Stoffel language, I realized that from a developer perspective, having strings makes a lot of sense. For example, it can make conceptualizing how data is stored on the MPC nodes much easier. However, from an MPC perspective, strings are not so straightforward. You would need to use some form of oblivious data structure such as an oblivious array to hide a lot of information about the string such as its length, the contents and any indexing you want to do. Turns out this area of MPC is underexplored and even the ML/AI + MPC folks haven't figured it out as they are focused on making ML/AI + MPC work.

@th4s
Copy link
Contributor

th4s commented Jan 3, 2022

Conceptually a String (in Rust) is a Vec<u8>, meaning that it consists of three numbers

  • a heap pointer
  • a length value
  • a capacity value

So you are right that we run into trouble, because the heap pointer is local to the machine/VM and probably not the same on other machines, so we cannot just secret-share these 3 numbers. But this question is nearly identical to how to treat dynamic arrays in stoffelMPC, so maybe we should think about how we attempt to solve that?

@Mikerah
Copy link
Contributor Author

Mikerah commented Jan 3, 2022

Well, a "simple" way to go about it is to store strings in oblivious arrays. However, that comes with a lot of overhead.
Perhaps, a solution can be to have some syntactic sugar in the language to have strings for storage/identification purposes but they won't be a part of the MPC computation until we (or the MPC community) figures out a way to handle strings.

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

No branches or pull requests

2 participants