As Web3 evolves, the demand for confidential computing and decentralized data storage has grown. Whether it’s protecting user data, safeguarding AI prompts, or securing enterprise-sensitive computations, developers need tools that offer both privacy and verifiability.
In this guide, we explore a hands-on project built in Python that showcases secure data handling using three critical components:
The result: a fully auditable, secure data flow that combines the strength of Web3 storage with trusted hardware guarantees. if you prefer video format, watch the YouTube recording of the live workshop.
Decentralization has solved many problems, but not all. When it comes to handling sensitive data or executing confidential code, decentralized networks alone fall short. Users must trust that the computation was done correctly and privately. This is where TEEs and attestation play a crucial role.
A Trusted Execution Environment (TEE) is a secure area within a device’s processor that ensures both confidentiality and integrity of code and data. Even privileged software like operating systems and hypervisors cannot access what’s happening inside the enclave.
Marlin provides lightweight remote attestation services. It can prove that a given computation was executed in a TEE without being tampered with. Marlin is integrated with the Alith SDK, offering an easy interface for:
Combined with IPFS, this stack allows you to publicly share and verify sensitive data with full cryptographic assurance.
This Python-based demo illustrates how to:
File
Purpose
app.py
Main script to attest and store data
Clone the project and install dependencies:
git clone https://github.com/metis-edu/Tee_Marlin_IPFS.git
cd Tee_Marlin_IPFS
python3 -m venv venv
source venv/bin/activate
pip install alith requests
Run the attestation service locally:
docker run --init -p 127.0.0.1:1350:1350 marlinorg/attestation-server-custom-mock
Alternatively, build from source:
git clone https://github.com/marlinprotocol/oyster-monorepo
cd oyster-monorepo/attestation/server-custom-mock
cargo run -r
Run the main script:
python3 app.py
Secure data stored on IPFS: bafybeie...xyz
TEE proved it, IPFS stored it, anyone can verify it
View it at: https://ipfs.io/ipfs/<CID>
The script:
Each step ensures that the data:
{
"data": "Secret: Alice pays Bob $100",
"proof": "8444a1013822a0590782a969d6f64756c655f69647827692d"
}
Combining TEEs with attestation and decentralized storage gives developers a powerful toolkit for building privacy-first Web3 applications. Whether you’re processing confidential transactions, AI queries, or personal data, this approach ensures security, transparency, and trust.