start	end	text
0	1340	Good morning, everyone.
1340	3200	Thank you for joining us today.
3200	6120	I have the pleasure of introducing Elaine Shee.
6120	9260	She is a professor in Carnegie Mellon University.
9260	18580	Her research interests include cryptography, security, mechanism design, algorithms, foundations of blockchains, and programming languages.
18580	21780	She is a co-founder of Oblivious Labs, Inc.
21780	29540	Her research on oblivious RAM and differentially private algorithms have been adopted by Signal, Meta, and Google.
29540	36020	She is a Packard Fellow, a Sloan Fellow, an ACM Fellow, and an IACR Fellow.
36020	43040	Without further ado, Elaine Shee, presenting Oblivious RAM, From Theory to Large-Scale Deployment.
43380	46820	Thank you so much, Chelsea, for the introduction.
46820	50780	I'm very excited to be here, and I love my hacker badge.
51100	61240	Okay, I'll talk about Oblivious RAM, or O-RAM for short, and the exciting story of how it evolved from theory to large-scale real-world deployment.
62540	77900	So I'll begin with the Signal story and some other motivating applications in blockchains, and then I will tell you how to construct a simple O-RAM algorithm, and then at the end I will maybe mention a bit more about applications in the blockchain space,
77900	82940	as well as the technical roadmap going forward.
84840	93760	Okay, so Signal has contact discovery, and they want to guarantee privacy for the users.
94000	103800	So essentially, in contact discovery, the user will upload its address book to the server, and the server will return the entries corresponding to his friends.
105000	110880	But obviously for Vitalik, his address book is top secret, so he is reluctant to disclose it to the server.
110880	113580	So how can we protect the user's privacy?
113840	118560	A naive solution is to use encryption, like an encrypted database.
118560	128240	So imagine the server is equipped with TE, Trusted Execution Environment, also called the secure processor.
128340	132900	So you can think of the secure processor as a hardware sandbox.
132920	139360	Everything is always encrypted, and only inside the sandbox can things get decrypted.
139360	153000	There is a decryption key inside the sandbox, so you can decrypt the data and do competition inside the sandbox, but any data that leaves the enclave, and the sandbox is also called an enclave, anything that leaves the enclave, either in transit or in storage,
153000	154400	will always be encrypted.
155280	171720	So you may think that this will solve the privacy problem, but as you sit down and think about it a little bit longer, actually encryption alone doesn't do very much to protect the user's privacy, and this is because when the enclave needs to do the computation,
171720	185940	it needs to go to the database that resides in memory and on disk, and it needs to fetch those records corresponding to the friend, and which locations are being accessed will disclose exactly who your friends are.
187460	197440	So this access pattern leakage is not just relevant for signal, it's actually a pretty general problem.
197820	214600	It manifests in many different ways, like for instance, this is a binary search program, you don't have to stare at the code, but essentially what happens in binary search is that you will first look at the middle element of the array, and then depending on the result of the comparison,
214600	218300	you either recurse on the left half or the right half.
218300	227180	And now if you think about it, if you like observe the sequence of accesses, you can actually determine whether you are searching for a large value or a small value.
228960	244200	And more generally, if your program contains control branches dependent on secret variable, let's say you are conditioning on the last bit of your secret key, and then depending on whether it's 0 or 1, the two branches exhibit different memory traces,
244200	251080	then by observing what data is being accessed in memory, you can actually learn the last bit of the secret key.
253580	271900	So this is an actual attack shown by researchers in UT Austin and Microsoft Research, and they showed that if you are running off-the-shelf image processing software inside PE, and you can only observe the page-level access patterns, and these are like car screen access patterns.
271900	277720	And even such car screen access patterns can allow you to recover the shape and the location of the objects.
279280	287020	Okay, so the question we want to answer is can we provably defeat such access pattern leakage, but we still want to preserve the efficiency of the program.
287980	291120	So let me tell you a signal story again, right?
291120	303660	So there is actually a naive solution to solving this problem, which is every time I need to query the database for something, I'm going to make a linear scan over the whole database, and of course a linear scan will hide which location I'm interested in.
303660	307400	But the drawback of this approach is like obviously it is very expensive.
308480	311240	So Signal actually did an optimized linear scan.
311240	318000	They were like basically for a batch of queries, they make a single linear scan, and even so the overhead is linear.
318000	322160	It's n over beta, where n is the database size and beta is the batch size.
322220	327980	And back then when they deployed the linear scan solution, they needed 500 servers, which was a lot.
328460	336220	And eventually they came around and they realized that the right thing to do is to use an ORAM algorithm.
336220	343420	So specifically they implemented an ORAM scheme called PathORAM, which was proposed in our prior work in 2013.
343820	353800	And once they deployed the scheme, they were down to six servers, so almost 100x saving in operational costs.
354060	367320	And then asymptotically, PathORAM achieves log squared n overhead, but actually in practice one of the log has a large base, so really in practice you just observe log n overhead.
368800	373340	And there are many other applications of ORAM besides Signal.
373340	380120	For instance, we are working with Ethereum Foundation to build ORAM into their infrastructure.
380120	394460	Because Ethereum wants to enable private blockchain reads, they want to basically be able to provide RPC and four nodes, which allow users to privately access the public data that live on the blockchain.
394880	398480	Meta has an implementation of our PathORAM as well.
398780	403720	We actually don't know exactly what application they're using it for, but likely it's private AI.
404800	412080	Flashbots is interested in using ORAM to enable private block building, and we are also collaborating with them.
412600	425720	And it is hard these days to give a talk without mentioning LLM, so something that would also be nice to have is to have private LLM, like imagine you can query chatGPT without disclosing your intentions and your query.
425720	428140	So this is also something that ORAM can enable.
428360	433740	And I also want to mention in many of these applications, traditional databases completely fail.
433780	440120	And the reason is because traditional databases only do encryption, they only encrypt the data contents.
440120	446220	But for a lot of these application scenarios, like in Ethereum's case, the database itself is public.
446260	449760	It is precisely the queries you want to hide, not the database itself.
449760	454700	And in other scenarios, like in Signal's case, the database is not public, but it is known to Signal.
454700	460580	So they don't actually, they're not worried about hiding the database, but they just don't want to see the user's address book.
460900	465940	So in these cases, really what you need is ORAM rather than traditional encrypted database.
467140	475080	Okay, so I hope this has got you excited about ORAM, so let's actually see how to construct ORAM.
475080	483980	So in fact, ORAM is an extremely simple data structure, and I hope this talk can convince you it is simple, and this is also the reason why it is so fast.
486060	487220	So what is ORAM?
487220	491740	It was first proposed by Goldrich and Ostrowski back in the 1980s.
491740	497800	It's an algorithmic technique that allows you to kind of quote-unquote encrypt access patterns.
498200	502580	I mean, of course, it's not really encryption because access patterns are a side effect of program execution.
502580	504620	It is not like a data stream.
504760	511180	So behind the scene, what you are really doing is like you are shuffling and permuting the data in memory as you access the data.
511180	513140	So we'll see how it works.
513860	534160	If you want to think of ORAM as a box, as abstraction, essentially it will receive requests in the form of read some logical address or write to some logical address, and it will translate these logical requests into some physical accesses, and each logical request will be translated into potentially multiple physical accesses.
535100	543060	And the ratio of the physical accesses over the logical accesses is essentially the overhead of the ORAM.
543480	551120	And the security requires that no matter what your logical request is, the observed physical access patterns must be identically distributed.
553100	564280	Okay, and then when we deploy ORAM, let's say in a secure enclave or TEE, essentially the ORAM is a client that runs inside this trusted boundary.
564280	566600	It is part of your trusted computing base.
569840	578440	So let me first give you the bigger picture of where we are in terms of the theoretical landscape, and then I can tell you about the construction.
578460	586800	So even back in 1987, Goldreich-Ostrofsky already showed a non-trivial construction with log-cubed overhead.
586800	589620	So this is already much better than linear scan, right?
589620	593880	But their scheme is very complex, and it has large constants, and it's completely impractical.
593880	597320	So you wouldn't want to actually implement these log-cubed schemes.
597440	602480	And they also proved that if you want an ORAM, log-end overhead is necessary.
602480	605060	So this is like a lower bound on the performance.
605620	616480	So really what is interesting is like on the practical side, we want to have an ORAM scheme that is practical, not like the one by Goldreich-Ostrofsky.
616480	623380	And on the theoretical side, we want to understand whether we can bridge the gap between the upper bound and the lower bound.
623940	642040	So this is the research we have been doing since around 2010, and we were able to answer both questions affirmatively, and we are able to construct a practical scheme which is now deployed in the real world at large scale, and we were also able to bridge this gap between the upper and lower bound.
642040	644800	These two, unfortunately, they're not the same scheme.
645380	649240	So today I will want to focus on the practical scheme.
650680	653480	Okay, so I will tell you how to construct an ORAM.
656280	660800	Before I tell you the idea, I want to just quickly brainstorm together.
660800	666580	So a strongman solution is to just take all your data blocks and permute them in memory.
666580	671220	So suppose the adversary doesn't know the permutation.
671220	674560	So essentially every block is stored at a random location.
674660	680740	In this case, if you want to access logical address 9, you would just go to a random location.
680920	686180	So it seems like this already gives you some security, but it is not highly secure.
686180	690740	It is not really secure if you need to access each block multiple times.
690740	698680	For instance, if I access the same block 9 twice, then it leaks frequency and linkability.
698680	707620	So you can actually launch statistical attacks to infer which location is storing what data.
707940	713280	And the reason why this strongman is not secure is the same reason why deterministic encryption is not secure.
713280	715600	It leaks statistical information.
716280	723380	So really, the moral of the story is that the blocks have to keep moving around in memory.
723380	730880	Because if they always stay in the same place, then any time I access the same block multiple times, it will leak statistical information.
731160	736200	So this is the key insight I want you to keep in mind as I tell you what the solution looks like.
737800	739400	Okay, so here's the solution.
739400	741500	So ORAM is just a very simple data structure.
741500	742760	It's a binary tree.
743040	752120	In fact, actually, ORAM is even simpler to teach than the typical data structures we teach to our undergrad students, like red-black tree.
752540	756600	For instance, it doesn't have complex balancing operations.
757260	760760	Every node in the tree is called a bucket.
761620	763920	And the bucket has a finite capacity.
763920	766180	It can store, let's say, a constant number of blocks.
767660	769920	And some blocks are real blocks.
769920	771900	Real blocks are encryption of actual data.
771900	773280	And some blocks are filler blocks.
773280	775220	And filler blocks are just encryption of zero.
775220	776720	And they're only there for security.
776720	778520	They don't encode any useful data.
780800	786920	Okay, so the most important invariant in ORAM is that every block is assigned to a random path in the tree.
787340	791300	So a path is like, you know, a path from the root to some leaf node.
791320	798820	So in this case, imagine the block at logical address x is stored on the blue path.
799980	806660	And in the beginning, I'm going to cheat a little bit and imagine the CPU can store a position map that records where every block is.
806660	812520	But in the end, I will get rid of the position map because this position map is very large and you cannot store it inside the CPU's cache.
813020	821360	Okay, so reading a block is very simple because I just have to find out where the block is, which path it is on, and all I have to do is read this path.
821500	828120	And then when I read this path, I can remove the block I want from the path and hold it in my hand and hold it in the CPU's cache.
829380	833720	And at this moment, you know, we are going to revisit that key inside type machine.
833820	838160	It is important that as soon as we read the block, we need to relocate it.
838160	844740	Because if we don't relocate it, the next time if we want to read the same thing, we'll go back to the same path and that leaks statistical information.
845260	847180	So how do we relocate this block?
847240	852420	The most natural idea is to assign it to a random new path.
852420	854280	So I'm going to sample a path at random.
854280	856280	Say I happen to pick the green path.
856560	859420	And how do I relocate the block X to the green path?
859860	867340	The idea is, where on the green path can I write the block X?
868720	870580	Can I write it to the leaf?
874160	884120	So the answer actually should be no, because if you disclose which path it is, then the adversary knows you have relocated something from the blue path to the green path.
884120	889560	And the next time if you access the same thing, you'll go to the green path and this still leaks statistical information.
890140	898920	So really you also cannot write this block to any of the internal nodes, because these internal nodes leak partial information about the choice of the new path.
898920	906160	So really you have to write the block back without leaking what is the choice of the new path.
906160	909240	And the only way to do that is if you write it back into the root.
909240	916440	The root is on every path, so if you write it into the root, it satisfies the path invariant without disclosing which path I've chosen.
917940	931320	Okay, so I mean of course you cannot keep writing things into the root, that'll create a problem because the root will soon overflow, and how do we resolve... okay, so before I tell you how to resolve this overflow problem, essentially if you do this,
931320	938240	the security of the scheme is very easy to see, because anytime I want to make a request, I will just end up visiting a random path.
938240	946800	And importantly, the choice of the path has not been revealed before, because every time I relocate the block, I write it back to the root without disclosing the choice of the new path.
948780	953440	Okay, so now let's try to resolve the problem I've mentioned.
953440	960440	So because I cannot keep writing things into the root, the root will soon overflow, and I have to overcome this problem.
961340	963820	And in fact, there are actually two issues remaining.
963820	977640	One is how do we resolve overflow, the second is, remember I said I'm cheating, I'm assuming the CPU actually starts the position map that records where every block is, but we cannot do that because the position map is too large.
977640	982140	So I'll tell you how to resolve these two remaining issues, and we will get a full ORM scheme.
982420	997480	So to resolve the overflow issue, we are going to introduce an eviction process, and the goal of the eviction, it's a maintenance process that tries to move things closer to the leaf, and if you do it in a clever way, you can prove that except with negligible probability,
997480	999360	no bucket will ever overflow.
999520	1016520	And in fact, in path ORM, the way the eviction scheme works is every time I read something from a path, I use, because I'm touching this path anyway, I'm going to use this opportunity to repack all the blocks on that path and pack them as close to the leaf as possible while subject to the path invariant.
1017020	1025160	So in path ORM, eviction and read are kind of like they take place on a single path, and this is why the scheme is called path ORM.
1025160	1031720	It's because every time I need to make a request, I just have to visit a random path in the tree.
1032160	1033240	Okay, so that is eviction.
1033240	1044480	I will not go into detail, but actually in the afternoon, I'm going to give a longer version of the talk, and I will go into the detail of the eviction in the longer talk.
1044780	1048580	So let me also mention how to remove the position map, and the answer is just one word.
1048580	1049920	It's recursion.
1050000	1067860	Essentially, you have this position map, you cannot start it in the CPU cache, you are going to recurse and start it in a smaller ORM tree, and once you recurse logarithmically many times, your position map will be constant size, and at that time, you can start it in the CPU's cache or registers.
1068840	1076640	So essentially, every time you recurse, the size of the position map is at least constant factor smaller than the original data set.
1077200	1083400	Okay, so this is the whole algorithm, and it's really simple.
1083400	1089280	It's just 16 lines of pseudocode, and even counting lines like and if and for.
1090820	1106660	It's so simple you can print it on a t-shirt, and in fact, I guess the biggest debate in the ORM community is not whether the ORM scheme is simple enough or fast enough for practical purposes, it's more whether the tree is upside down or not.
1106660	1111640	That is the most debated topic in the ORM community.
1113200	1117920	Okay, so just to summarize, how do we construct an ORM?
1117920	1134180	It's a tree-based data structure, and the key insights are, a block is always remapped to a new random path whenever it is read, and then you must relocate the block to the new path without revealing the choice of the new path, and this is important for security.
1134260	1144020	And in order to make sure the buckets don't overflow, we have to have a clever eviction process that tries to keep moving things closer to the leaf.
1144360	1155600	And then the main work, like even though the scheme is simple, I want to say actually the proof of security, the stochastic proof that there is no overflow, that is a rather complex and mathematical proof.
1156440	1177640	Okay, so performance, and we actually, so this is the performance we measure using our own implementation by Oblivious Labs, and we are using an Ethereum or SignalScale data set ranging from 100 gigabyte to one terabyte, and this is performance just on a single desktop machine.
1177640	1182600	Every request, every key value lookup is only 20 to 50 microseconds.
1182600	1188520	It's not even millisecond, we are talking about microsecond level delay, right, so there's almost no delay essentially.
1188680	1204220	And then the throughput is very high even on a single node, it can be up to 200k queries per second, and it's also easy for ORAM, it's actually very easy to do horizontal scaling by adding more machines, you can scale up the throughput proportionally to the number of machines.
1205260	1225800	Our implementation outperforms Signal by roughly an order of magnitude, we outperform Meta by about 100x, and there is also this ObliX is a state-of-the-art academic implementation, and we outperform ObliX by like 600x, so I think this is probably the fastest implementation known to date.
1226380	1233560	And I want to conclude with some more applications in the blockchain space, and some of the ongoing work.
1234100	1236000	So when do you need an ORAM?
1236000	1247380	I guess like previously, so what's interesting is like previously, you know, people are using TE a lot, but maybe they didn't realize that they need an ORAM.
1247380	1260300	But in fact, whenever you need trusted hardware, you should actually think whether actually ORAM is needed, because for a lot of computation tasks, they don't just linearly scan through memory, they are going to make dynamic memory accesses, and in these cases,
1260300	1264760	chances are the memory accesses are leaky, and you would need ORAM.
1264760	1266960	And also, ORAM is not just for TE.
1266960	1280740	Actually, if you want to have secure computation, like let's say TE is replaced with a cryptographic secure computer enabled by multiparty computation, the same problem happens, and you need ORAM to make the accesses secure as well.
1281920	1284540	Okay, so what are some of the applications for blockchains?
1284540	1290440	I already quickly mentioned them at the beginning of the talk, but maybe I can't go into detail for like one of them.
1290440	1297080	Let's look at Flashbots application private order flow, and I'll explain why it's important.
1297700	1308580	So in blockchain, users submit transactions to the block builder, and the block builder will build blocks to be included in the consensus.
1308800	1324180	So today, the transactions are submitted in the clear, and this creates this big problem called MEV, minor extractable value, and simply put, the block builder can front run and background your transaction to make profits.
1324540	1330100	And this is not only harmful to the user, it also creates a centralization effect for the blockchain.
1330160	1339100	So in fact, if you look at Ethereum's ecosystem today, more than 85% of the blocks are mined by just two, are created by just two block builders.
1339100	1346400	So essentially, it's a duopoly, like the architecture is no longer kind of the decentralized architecture we used to think of, right?
1346400	1352560	And this is why the stakeholders, they're really concerned about this problem, and they really want to mitigate MEV.
1352640	1359600	And one way to achieve this is to add privacy to the order flow, to the transaction submission process.
1359600	1368620	So imagine the users submit transactions in encrypted format, and the block building also happens in encrypted format, without the block builder being able to see the transactions.
1370160	1376320	And imagine you are going to execute the block building program inside the TEE.
1377000	1383360	And the problem is that when you build the block, you have to speculatively execute the transactions.
1383360	1387280	And I want you to think of the transaction as a small smart contract program.
1387280	1392520	And as these programs are executed, they're going to have to access data that lives on the blockchain.
1392680	1395060	And again, these accesses are highly leaky.
1395060	1399820	They leak things like which crypto asset you are trading and the trading partners.
1399940	1402680	And these are precisely the information you want to hide.
1402680	1409720	So if you only encrypt the data and you don't obfuscate access patterns, there is very little privacy.
1411400	1420880	Okay, so for this reason we have been collaborating with Flashbots to try to demo the performance of private block building with ORAM.
1421280	1428620	And in some ongoing work, and this is a new ongoing work we are doing at our company, it's called Oblivious STL.
1428620	1437000	So Oblivious computation also is not just about ORAM because ORAM gives you a generic way to take any algorithm and compile it to an Oblivious format.
1437000	1448200	But oftentimes if you have specific data structures or specific computing tasks like graph algorithms, you can convert it to an Oblivious form without going through the generic ORAM transformation.
1448200	1454100	And these customized Oblivious algorithms are often faster than generic ORAM compilation.
1454100	1460740	So in Oblivious STL, we are trying to make a counterpart of the STL library, like think about C++ STL.
1460740	1465120	This is like a standard library that's packaged with modern programming languages.
1465360	1471120	So we want to create an Oblivious counterpart of these common libraries, and this is ongoing work.
1471120	1483220	We have already implemented some common data structures and maybe sorting and some graph algorithms, but there's a lot more to do to finish the library and increase the coverage.
1484040	1490040	Okay, so finally I want to conclude by asking the question again, do we need ORAM?
1490040	1501960	And this is yet another large-scale application of ORAM because if you come to my hometown Pittsburgh, the coffee shops in Pittsburgh, they sell a donut called ORAM.
1501960	1503260	So do you need an ORAM?
1503260	1504660	Yes, because it's delicious.
1504660	1508360	And if you come to Pittsburgh to visit me, I will definitely buy you an ORAM.
1508360	1509140	Thank you.
1517610	1519090	Thank you so much, Elaine.
1519090	1527610	I just wanted to let you all know that Elaine will be furthering this talk in our workshop in the cryptocurrency community, which is in C101 at 2 p.m.
1527610	1531950	today, and that will be for a much longer period of time with some workshops going on.
1531950	1534870	So please come check us out at the cryptocurrency community.
1534870	1536410	Hope you have a great day and a great con.
1536410	1536990	Thank you.
