Skip to content

oasislabs/ready-layer-two

Repository files navigation

ready-layer-two

This repo contains a confidential machine learning competition demo app. Basically Kaggle, but such that competition creator's private test data is kept hidden from participants, and the participants' models are kept hidden from the competition creator.

This demo was created for presentation at the Ready Layer One blockchain expo.

How it works

application sequence diagram

The Oasis platform, provides confidential smart contracts (i.e. private state). The private state of the Competition service stores the keys to encrypted off-chain test data and submitted, trained models. Additionally, the Competition service allows an attested off-chain enclave to receive the secrets and evaluate the models on the test data. The models and data are decrypted into (encrypted) enclave memory; the evaluation program is sandboxed (though not very completely in this demo) to make it difficult to extract secrets. If everything works properly, nobody except the evaluation program has access to the raw data. The evaluation enclave puts the two in ready-layer-two.

Also, it's generally useful to have user registration so that a person can, y'know, actually be announced as the winner. This functionality is in the UserRegstry service, which amounts to passing around JWTs.

Building the demo

To build the demo, you'll need

  • the Oasis SDK to build and test the platform services
  • Docker to train and evaluate the models

Running the demo

Once you have all of the build tools, simply run make. You should see the following output:

✔️     Create UserRegistry
✔️     Register participants
✔️     Upload data
✔️     Create Competition
✔️     Make submissions
✔️     Start evaluation program "enclave"
✔️  🔒 Fetch data encryption keys
✔️  🔒 Evaluate models on test data
✔️  🔒 Announce winner

🎉 PEGASOS has won the competition! 🎉

About

A demo of confidential ML competitions on the Oasis platform

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages