This project demonstrates how to build and verify MPC TLS sessions in an AVS using the Othentic Stack.
This project demonstrates a complete implementation of a TLS-MPC AVS.
Key Components:
- Notary Server – Verifies TLS sessions and issues notarized transcripts.
- Fixture Server – Mock HTTPS endpoint for TLS interactions.
- Prover (Execution Service) – Establishes a TLS session, generates
.tlsnproof, uploads it to IPFS. - Verifier (Validation Service) – Downloads and verifies the proof before approving the task.
- The Performer node executes tasks using the Task Execution Service and sends the results to the p2p network.
- Attester Nodes validate task execution through the Validation Service. Based on the Validation Service's response, attesters sign the tasks.
In this AVS:
-
Prover generates a notarized TLS transcript (.presentation.tlsn).
-
Transcript is uploaded to IPFS via Pinata.
-
Verifier downloads the file and validates the proof.
-
Based on the result, the AVS either approves or rejects the task.
- Rust (v 1.23 )
- Foundry
- Docker
-
Clone the repository:
git clone https://github.com/Othentic-Labs/avs-tls-example.git cd avs-tls-example -
Install Othentic CLI:
npm i -g @othentic/cli npm i -g @othentic/node
cd Execution_Service/tlsn-src/crates/notary/server
cargo run -r -- --tls-enabled falseThe server will start listening on 0.0.0.0:7047.
cd Execution_Service/tlsn-src/crates/server-fixture/server
PORT=4000 cargo run --releaseSimulates an HTTPS server used by the prover to establish TLS sessions.
cd Execution_Service/
cargo build
# Use this command to run the prover directly
# RUST_LOG=debug SERVER_PORT=4000 cargo run --bin attestation-prove
cargo run --bin Execution_ServiceThe Execution service will start on port 4003.
curl -X POST http://localhost:4003/task/execute -H "Content-Type: application/json" -d "{}"It will:
- Connect to the notary server
- Establish a TLS connection
- Create a notarized TLS transcript file (example-json.presentation.tlsn)
- Upload the file to the IPFS and Return the IPFS hash as Proof of Task
cd Validation_Service/
cargo build
# Use this command to verify directly
# cargo run --bin attestation-verify
cargo run --bin Validation_ServiceReplace with the actual hash returned from the Execution Service:
curl -X POST http://localhost:4002/task/validate -H "Content-Type: application/json" -d '{"proofOfTask":"QmSURnBJXpcCKgahoFX559DbRreib2z9hpq4MYzwrX4v2g"}'Follow the steps in the official documentation's Quickstart Guide for setup and deployment.
If you already have all the information required to run the AVS, simply copy the .env file into your project directory and then run:
docker-compose up --buildModify the different configurations, tailor the task execution logic as per your use case, and run the AVS.
Happy Building! 🚀
