The focus of this blogpost is on protecting the privacy of transactions that have been submitted to a public mempool but are yet to be included on chain.
Based on work with Arka Rai Choudhuri, Sanjam Garg, Dimitris Kolonelos, Julien Piet, and Mingyuan Wang.
[09/2024] UPDATE: We improved batched-threshold encryption by removing the epoch setup and simplifying the initial setup. See new blogpost.
There are many situations in which one would want to hide a transaction until the very moment before it is executed. A popular example is the mitigation of “bad” MEV, where a block proposer can frontrun and/or backrun a user’s transactions, thereby exploiting to exploiting price movements to gain profits at the expense of users.
Another situation where privacy would be useful is during the recovery of funds which were sent to a wrong address as outlined this blog post. In this particular case, submitting the recovery transaction to the public mempool already leaks too much information. A frontrunner could simply copy the transaction and replace the recipient address with their own to steal the funds.
💡 At a fundamental level, users should be able to submit transactions to a blockchain with the guarantee that no party learns any information about their transaction until it is actually executed.
Note: For the moment, we are not concerned with the ordering of transactions. Fair ordering of transactions is an important and complementary problem to mempool privacy.
The Flashbots Research Talk by Justin Drake is good starting point to learn more about the state of the art.
Amongst the various approaches to mempool privacy outlined (see blogpost for a summary), we focus on threshold encryption. At a high level, threshold encryption allows for a message to be encrypted to a committee of
It is highly desirable (in this setting I would argue necessary) to have non-interactive decryption where each committee member computes a “partial decryption”, locally, using just their secret key and the ciphertext. These partial decryptions, can later be publicly aggregated to recover the message.
It’s not too hard to see how this would be used for Mempool privacy:
We identify two main bottlenecks to deploying threshold encryption in practice.
Most threshold encryption schemes (based on groups) have a setup phase, where parties run a distirbuted key generation protocol to establish shamir secret shares of a random value. This can be quite expensive in a massively distributed setting. If a party joins/leaves the committee, we require further interaction to re-share the key with the new committee. Or we are forced to rerun the setup entirely. Moreover, it requires parties to be aware of who else is in the committee.
Decryption in existing threshold encryption schemes requires a large amount of communication. Say there are
We note that there are (albeit unsatisfactory) ways to get around the above issues. For instance, if committees once formed, stay together for a long time, this "amortizes" the setup cost. A new committee can be formed before the existing one decides to "disband" and users can begin encrypting to the new committee after a certain block number.
One can also get around the decryption issue by encrypting transactions to an epoch number, instead of a committee. The committee issues keys to decrypt transactions for the current epoch, using which all transactions that were encrypted to that epoch can be decrypted. This decryption material can be a few group elements per party, irrespective of how many transactions were encrypted to the epoch number. But this comes with the problem that a user's transaction is compromised if it is not included within time. In some situations such as decentralized auctions, this can be a great solution, but this may not be acceptable in settings where for example a user wants to place a large order for a token and does not want to be frontrun. Here, even revealing the intention to buy a large amount of a particular token may be unacceptable. Shutter Network and McFly use an adaptation of the Boneh-Franklin IBE scheme to achieve this.
We are excited to announce two papers that make progress on the above issues:
Silent Threshold Encryption [CRYPTO 2024, code] - A novel threshold encryption scheme that avoids any interaction during the setup procedure and provides other attractive features.
Batched Threshold Encryption [USENIX Security 2024, code] - A novel threshold encryption scheme where a batch of ciphertexts can be decrypted using communication that is independent of the batch size. Our ciphertexts are 370 bytes long, which is
Our silent threshold encryption scheme is actually a witness encryption scheme for the statement "If you know at least