Deploy Docker Apps in TEEs with Phala - ETHGlobal Bangkok 2024
ETHGlobal·Thu, Oct 9, 2025, 12:00 AM
Join us for a workshop with Shelven Zhou & Joshua Waller from Phala Network titled, "Deploy Docker Apps in TEEs with Phala." Learn about TEEs (Trusted Execution Environment) and how Phala's dstack SDK allows you to deploy docker apps within a TEE. We will also show how to make remote attestations, derive keypairs, and interact onchain with a local deployment. ETHGlobal Bangkok 2024 was a 3-day hackathon that took place November 15 to 17, 2024, and brought together the most skilled web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem! ----------------- Follow us: https://x.com/ethglobal Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com
Transcript
e e with larger uh memory so you can see uh I think this is very crucial for uh using te in more seras uh in more scenarios just like running AI model or running the ZK circuit inside te yeah and what we introduced here is a te SDK called D stack so it's a flash Bots X Project which is jointly produced by F and Flash bots so it has four major uh features here the first is that support for Docker images so just input the just uh make your own Docker compos file we all get this running on the te directly and second it's equipped with the remote test apis and the chain of trust visualization on web UI so any users they can easily verify whether the application is really running inside te the third uh it's equipped with the automatic IH https which means every application deploy in the te will be equipped with a domain and also with all the TRS certificate that is totally generated and managed in the te so the end user they didn't even uh they can just use the the current TS based solutions to connect to your application so the final things is unique from the follow part is that we will uh replace the current Hardware based root of trust with the decentralized root of trust that is controlled by the smart contract so this means your application data is safe even if a single te node is down because the state the data is St stored is something else so you can just initiate a new te instance to resume the ex yeah so this is one interesting B which is uh running uh powered by this deck it's built by the professor Andrew Miller from the flashboard team and he used this stack to build it so I say it's different from the others like AI agents in that the whole stack is controlled by the machine just imagine so from the X account so the email account that control the X account and also all the a agents the a API key is used all of the all of them are running inside the te so so now we can see okay with this this is the real AI agents that's controlled by the machine and you can trust yeah and this will unlock a lot of interes in use case uh finally we just published the world first Benchmark on the te gpus so to to show how usable whether it's usable or not so the overall uh conclusion here is that the average overhead is less than 9% so which is quite quite good from my side yeah and in the next my colleagues Josh will show you the usage of the stack thank you okay um so what I'm going to do is show you just application uh that's deployed on our lab server right now just to give you an idea so here is a nextjs application it's uh that have access publicly you can go to this link if you would like as well um what I can do is derive uh a ecdsa key pair here so this is an account that is uh within the te uh from there I can start signing messages and we can see uh TX signature here that you can verify you can sign type data so I I I actually used the uh vmdk just some of the examples they had in there and just kind of made a a mock template here that you can uh you can uh clone and then get started really quick um so and then also I I sent some uh some funds to this this uh wallet so that I can actually execute a transaction and this uh sent uh 420 guay uh to uh an account that I had just sent it to uh sent to the uh te account that was derived and then also uh another key feature as well is that you can also remotely uh do a remote at the station so on this case I actually uh created a remote ad station with some random data and uh from there I'll just uh click here and it should uh generate a quote so I have my my quote here I I I you can uh then copy this go into the uh remote at the station Explorer paste it verify and um here you can see that this is actually running in a te environment with the um the te simulator which is what we have you uh be able to develop on locally uh you would get something that would say uh unverified but um we can also uh do a little uh more checks because you don't want to just trust like our block Explorer and just take our word so you can go onchain as well and say you want to verify against uh automata's uh um uh verifier here and you can see that we're verifying on chain and you can also um choose of the uh different um uh networks that they support as well um so the the next part I I'll show you as well is another application that's deployed it's just like a a jupter notebook so that you can see like we're not you're able to uh also support uh whatever language you would like to build in and you can you can then uh start to get a little more creative but uh since you're able ble to connect to the socket for uh which is the tapd socket here you can then now have access to these um these uh two functions which will be TDX quote and uh the uh parameters that you would pass in is uh report data notebook this not jup notebook is itself is running inside the uh so I'll I'll uh zoom in here so so people can see here um yeah so you can you can run this uh here and get a quote so I have a a quote here and then uh another key feature is is uh derive key so you have this uh derive key function as well where you would Define your path so you could uh Define your like a root of trust and then uh pass in assault here from the subject uh and uh whenever you generate this you should uh this would generate the same key I believe on this uh one here so that you can uh derive a key and then you can then take this key and then either generate like a ecdsa uh key or uh say Ed uh 25519 or whichever uh whichever curve you would like to uh choose but yeah this is kind of like the power that you have with you uh by building uh like dockerizing your applications and then being able to then run it in a te um some other other things uh that you could um uh get started with I have created a a little cheat sheet here um that you can access um uh at uh bit.ly ds- Che sheet um but anyways I uh here it'll it'll tell you how to get started with the uh local simulator um you can clone you'll clone the repo and have the uh the same nextjs application as well I can uh zoom in here for anybody as well um and it'll it'll show you how to get started in just a few steps and then you're you're right away having a application uh running and being able to generate local remote ad stations and uh deriving key pairs from there as well um one of the uh interesting things that uh we we just um have like packaged up but uh want to see if any developer wants to kind of build upon it is uh we we created a uh repo called ai6 ZTE um and here you can you have a a Docker file and you can uh build your own AI agent that can uh run autonomously and be able to uh post on Twitter uh answer on Discord uh with like voice or text you can choose whichever llm models through the red red pill API and uh also um you can have it connect to Telegram and then also generates use the uh derived key to generate uh wallet accounts for you so that you can then start uh uh transacting on chain uh autonomously with these agents so you can really get uh creative and uh we have a repo here in the G sheet for you to uh check out and you know get hacking on it um however you would like but um I I I wanted to uh save uh some time instead of uh going uh deep into the demo to see if there's any questions that some of the uh audience may have oh yes so um if you go to the father Network so so the question was is there any any templates or code that they can reference so that they can uh get started and be able to understand how to uh build say like a a model within a uh te um so if you go into the the follow Network repo here we have um a few uh templates under uh the uh te Sim templates so this is like the te simulator we have like a a python template red pill temp put a uh a nextjs application but if you have like any like kind of like example like where you want to run a model uh please come by our booth we're we're over here on this back wall so that we can kind of like guide you and tell you how you can uh get started really quick with this as well because we have our uh full uh full engineering team for you to uh for you to ask questions for us okay um so that that that'll be it for uh this talk today but um yeah thank you for coming and uh have a great day
Automatic transcript — names and jargon may be misspelled.