Turn IPFS File System into IPFS Function as a Service

Turn IPFS (File System) into a new IPFS (Function as a Service) by adding some TEA

IPFS is awesome! It allows you to store your code or data in the middle of nowhere. When you need them, you can get it from somewhere you don’t really care about. You can verify the hash to make sure this is exactly what you requested. How cool is that!

How do I know the result is correct?

If you were getting a piece of data from IPFS, you don’t worry too much about the correctness of the result. You can easily verify the result by hashing it and the CID should match. But if you get a result of a computation of a piece of code and a piece of data, you don’t know the result yet, not to mention the hash of the result. How do you verify?

A quick answer: you don’t

Since you don’t know the hash of the correct result, you cannot verify using the traditional way, and you don’t need to. What you can verify is the Proof of Trust (we call it PoT, Tea-Pot). The PoT is simply a series of valid proof of how your code or data is processed in the T-rust network. The math and silicon physics protects the computation process so that as long as you can verify the PoT, you can trust the correctness of the result.

How does it work? Basically?

A typical IPFS network with four nodes works like this:

Discover the TEA module

Do you mean I can store encrypted data in IPFS with TEA’s help?

Yes! There’s much more than saving encrypted data to IPFS and keeping the key in your pocket. Your key can be protected by and transferred between TEA modules. You can define who, when, and how the key is to be used using the logic defined in your dApp (blockchain smart contracts will also work). Only those who meet the predefined conditions can unlock your data and consume it.

  • Only allow loading when code is running inside a protected secure zone.
  • Only allow loading by TEA nodes listed in an whitelist, or block in a blacklist.
  • Expire after a specific expiration date.
  • Run for free for the first 10 times as new users. After that, charge $2 every hour.

Run the code securely in an executor protected by TEA

From now on, we separate the usage of code and data. Although code is also data from a storage point of view, code can execute as a function but data can become the parameter of this function.

Using IPFS — Inter Planetary Function-as-a-Service

So far we only allow functions compiled to WebAssembly to be called due to security reasons. Besides this, anyone can use T-rust’s trusted computing services as long as the client paid the deposit in layer-1 and called the T-rust API.

Talk is cheap, show me your demo!

Our current demo is a Tensorflow image recognization algorithm in wasm. If you go to our demo page https://teaproject.org/#/demo and follow the step by step instructions, you can try to run the pre-deployed demo. Furthermore, you can deploy any image or replace the preset Tensorflow code with your own. For more experienced users, it’ll be more challenging to download the docker-compose.yml file and run your TEA module simulator yourself. You can even be a miner to try to mine some tokens yourself by providing services to others!

The stage of the TEA project

While you’re reading, you’re probably already aware that the TEA project is a huge and ambitious project. If you read my previous blog post, you can get the background and the mission of this project. As I mentioned on the project home page:




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store