-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Project
Enhancing User Experience in Web3 Dapps with Social Authentications
Problem
In our current implementation, we need to create a Rust proxy that can interface with our Cairo code. This proxy should leverage rustls to extract details from the TLS handshake, specifically the server's public key, certificate, and the connected domain. The goal is to pass this data to our Cairo program to validate the server's certificate.
Requirements
-
Proxy Enhancement: Based on the existing code, develop the proxy to extract the required TLS handshake details.
-
TLS Handshake: Implement a step-by-step TLS handshake using
rustls. The implementation should be clear and document each step to provide insights into the TLS handshake process. -
Data Interchange with Cairo: Since Cairo does not directly accept string inputs/hints, we need an efficient mechanism to work with domain strings. For a start, encoding them as ASCII and passing them as felt arrays might be suitable.
-
Workflow:
- Accept a domain as input from the Cairo program: request_input.json
- Make a request to the given domain using the proxy.
- The proxy should extract the necessary keys and certificate, required for Cairo validation.
Concerns
The main challenge lies in the restrictions Cairo imposes on input data types. Finding a developer-friendly mechanism to communicate with Cairo is crucial. Moreover, the clarity of the TLS handshake process is vital for understanding and potential modifications in the future.
Action Items
- Update the Rust proxy to work with
rustlsand extract TLS details. - Implement a clear step-by-step TLS handshake in Rust.
- Develop a method to pass domain strings and other data to Cairo.
- Test the workflow using a few different domains and validate certificate details in Cairo.
Note: Careful attention is required to ensure data integrity, especially while interfacing between the Rust proxy and Cairo.