Skip to content

Add demo projects for Web3 scenarios #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 12, 2024
Merged

Add demo projects for Web3 scenarios #150

merged 7 commits into from
Dec 12, 2024

Conversation

DemesneGH
Copy link
Contributor

This PR introduces a new projects/ directory dedicated to demo projects that showcase real-world applications. These projects are more complex and feature-rich than the examples in the examples/ directory.
Additionally, we are releasing a basic ETH wallet project for the Web3 scenario.

As outlined in projects/README.md, our goal is to provide developers with practical reference implementations that demonstrate how to effectively use the SDK in real-world scenarios. Currently, we are focusing on Web3-related projects, with plans to expand to additional scenarios in the future.
We believe these demo projects will be valuable resources for developers looking to build TAs tailored to real-world requirements.

@b49020
Copy link
Contributor

b49020 commented Nov 26, 2024

Thanks @DemesneGH for this PR. It's really nice to see real world use-cases supported upstream. Care to write some tests for this project?

@ivila
Copy link
Contributor

ivila commented Nov 29, 2024

Actually during my development, I will use git path for teaclave dependencies, it's more convenient as can be use cross my team (and we use no_std).
For example, when I want to use optee-teec, I just type the following:

cargo add optee_teec --git https://github.com/apache/incubator-teaclave-trustzone-sdk.git --branch main

And in cargo it will:

[package]
name = "demo"
version = "0.1.0"
edition = "2021"

[dependencies]
optee-teec = { git = "https://github.com/apache/incubator-teaclave-trustzone-sdk.git", branch = "main", version = "0.2.0" }

@b49020
Copy link
Contributor

b49020 commented Nov 29, 2024

Acked-by: Sumit Garg <sumit.garg@linaro.org>

@b49020
Copy link
Contributor

b49020 commented Nov 29, 2024

Actually during my development, I will use git path for teaclave dependencies, it's more convenient as can be use cross my team (and we use no_std).

Agree that's better for development. In case of deployment it's better to use released version of OP-TEE crates here:

https://crates.io/crates/optee-teec
https://crates.io/crates/optee-utee

@DemesneGH is releasing new version of crates still on your ToDo list?

@DemesneGH
Copy link
Contributor Author

@DemesneGH is releasing new version of crates still on your ToDo list?

Yes it is. Let me figure out the release process on crates.io.

@DemesneGH
Copy link
Contributor Author

Yes it is. Let me figure out the release process on crates.io.

@mssun Could you help to add my account as the owner of these 5 crates?:

https://crates.io/search?q=optee-

Seems the operation is:
cargo owner --add DemesneGH (Reference: https://doc.rust-lang.org/cargo/reference/publishing.html#cargo-owner)

@DemesneGH
Copy link
Contributor Author

Actually during my development, I will use git path for teaclave dependencies, it's more convenient as can be use cross my team (and we use no_std).

@ivila BTW could you share some information about what your team is working on with this SDK, such as the specific scenario? We're gathering real world use cases and would greatly appreciate your input.

@mssun
Copy link
Member

mssun commented Nov 30, 2024

Yes it is. Let me figure out the release process on crates.io.

@mssun Could you help to add my account as the owner of these 5 crates?:

https://crates.io/search?q=optee-

Seems the operation is: cargo owner --add DemesneGH (Reference: https://doc.rust-lang.org/cargo/reference/publishing.html#cargo-owner)

Done. Please check and let me know if it's okay.

@DemesneGH
Copy link
Contributor Author

Done. Please check and let me know if it's okay.

It works, thanks! @mssun

@ivila
Copy link
Contributor

ivila commented Dec 3, 2024

Actually during my development, I will use git path for teaclave dependencies, it's more convenient as can be use cross my team (and we use no_std).

@ivila BTW could you share some information about what your team is working on with this SDK, such as the specific scenario? We're gathering real world use cases and would greatly appreciate your input.

@DemesneGH Sorry I miss your response, we are using it for trusty computation, for example, PIR(private information retrieval), deep learning. We used to develop by C, and it's painful as we always met problem like memory leak or memory fault(use after free), use teaclave really helps a lot.

@DemesneGH
Copy link
Contributor Author

@DemesneGH Sorry I miss your response, we are using it for trusty computation, for example, PIR(private information retrieval), deep learning. We used to develop by C, and it's painful as we always met problem like memory leak or memory fault(use after free), use teaclave really helps a lot.

@ivila Thanks for your insights, issues, and PRs over the past few days. We really need polish the Rust SDK better for real-world use cases. Please feel free to discuss any problems you encounter with us.
Additionally, we would also appreciate contributions to the real-world examples, such as a minimal demo for deep learning, etc. If you're interested please feel free to open the PR, thanks!

@DemesneGH
Copy link
Contributor Author

Actually during my development, I will use git path for teaclave dependencies, it's more convenient as can be use cross my team (and we use no_std). For example, when I want to use optee-teec, I just type the following:

cargo add optee_teec --git https://github.com/apache/incubator-teaclave-trustzone-sdk.git --branch main

And in cargo it will:

[package]
name = "demo"
version = "0.1.0"
edition = "2021"

[dependencies]
optee-teec = { git = "https://github.com/apache/incubator-teaclave-trustzone-sdk.git", branch = "main", version = "0.2.0" }

Actually during my development, I will use git path for teaclave dependencies, it's more convenient as can be use cross my team (and we use no_std).

Agree that's better for development. In case of deployment it's better to use released version of OP-TEE crates here:

https://crates.io/crates/optee-teec https://crates.io/crates/optee-utee

@DemesneGH is releasing new version of crates still on your ToDo list?

Release 0.2.0 for 6 optee- crates have been published in crates.io: https://crates.io/search?q=optee
Now we can import the crates by optee-teec = "0.2.0". For reference the code version for these 0.2.0 release is 20e6988 .

The crates will be updated accordingly with each future release (the next planned release is 0.3.0).

- Transaction Signing: Signing Ethereum transactions without exposing private
keys to the normal world.
- Key Erase: Erasing keys when they are no longer needed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add

  • Security assumptions for this example if possible.
  • Disclaimers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc updated, please check, thanks!


Ok(proto::CreateWalletOutput {
wallet_id,
mnemonic,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please highlight the security assumption and potential risks for returning mnemonic in this sample TA.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc updated

@DemesneGH DemesneGH merged commit edcb7a2 into apache:main Dec 12, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy