We have spent quite a bit of time on improving synchronisation of notes for the multi-asset shielded pool of Namada.
In the last months, we have gone from brainstorming to propose a concrete solution, based on Fuzzy Message Detection (a sophisticated cryptographic primitive --check it out here–) and trusted enclaves for defense-in depth.
The journey has been quite amazing, involving pure research as well as lots of engineering. The outcome is an advanced prototype, formed by libraries written in Rust. One for performing multi-key FMD across several detection servers, and the Kassandra service bridging and coordinating the process, with room to accommodate TEEs in the future.
So, are we done? What we have got so far speeds up the computations required to sync on the wallet side. It does not improve, significantly, the number of downloaded notes. This comes at no surprise, as what FMD gives you is detection of your own notes; it doesn’t retrieve the notes.
What’s going on. In layman words, in the current solution, wallets locally combine the responses of several detection servers to reduce the number of trial-decryptions they need to perform. BUT, to keep their own notes hidden, the can’t just query the reduced (combined) set of notes to a MASP indexer. At least not in the clear. If we were to do that, then we could just deploy a single server, and ask him to detect with the reduced false-positive rate (with the corresponding downgrade of privacy).
- The safe solution is having wallets query all the notes they get from the detection servers (i.e. the notes before reducing/combining). This is what is currently implemented. See the diagram below
- An alternative approach, that we are currently considering, is to query a subset of the notes to different indexers. As long as they don’t collude, none of them will get the whole view. This would reduce latency, but yes, is an ad-hoc solution, and, unavoidable, indexers learn something below the threshold set for detection servers.
Is there more to it? A third option that we could explore is private information retrieval. The point is that wallets do know what to retrieve from the public pool. So, they could run a PIR on the reduced/combined set of notes (in the diagram, after step 7). In theory, this works beautifully, in practice… well it depends on the exact performance of the PIR.
- Single-server PIR tends to be slower because it relies on computational hard-problems.
- Multi-server PIR is faster as it can be shown to be information-theoretic secure.
My suggestion is to spend a bit more of time on this (in parallel with the planned integration). Explore PIR schemes and, potentially, other related primitives. See if we can reduce communication overhead without hurting too much the computational performance we have already got.