<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Test In Prod</title>
        <link>https://paragraph.com/@testinprod-io</link>
        <description>We scale Ethereum by delivering Superchain with Optimism Collective.</description>
        <lastBuildDate>Tue, 04 Aug 2026 02:44:13 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <image>
            <title>Test In Prod</title>
            <url>https://storage.googleapis.com/papyrus_images/ed1ba66f818a852b8ef9e84619c5531cd6c50a61316b861843c6075f7e96c121.png</url>
            <link>https://paragraph.com/@testinprod-io</link>
        </image>
        <copyright>All rights reserved</copyright>
        <item>
            <title><![CDATA[Privacy-Preserving LLMs in Practice: A Full-Stack Approach with dstack and GPU TEE]]></title>
            <link>https://paragraph.com/@testinprod-io/privacy-preserving-llms-in-practice-a-full-stack-approach-with-dstack-and-gpu-tee</link>
            <guid>V3JgYVOiLq3QDX5EupYA</guid>
            <pubDate>Fri, 25 Jul 2025 01:44:03 GMT</pubDate>
            <description><![CDATA[Writer: Harry JeonIntro: Why do we need privacy-preserving LLM?AI services are now woven into daily life, and users routinely pour highly personal information into their prompts. Because state-of-the-art AI models need clusters of high-end GPUs, they usually run in centralized clouds rather than on local devices. This cloud-first architecture gives the provider complete visibility into every token a user submits - unless strong technical and contractual barriers are in place. Traditional safe...]]></description>
            <content:encoded><![CDATA[<p><em>Writer: </em><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://x.com/StackDigest"><em>Harry Jeon</em></a></p><h2 id="h-intro-why-do-we-need-privacy-preserving-llm" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Intro: Why do we need privacy-preserving LLM?</h2><p>AI services are now woven into daily life, and users routinely pour highly personal information into their prompts. Because state-of-the-art AI models need clusters of high-end GPUs, they usually run in centralized clouds rather than on local devices. This cloud-first architecture gives the provider complete visibility into every token a user submits - unless strong technical and contractual barriers are in place.</p><p>Traditional safeguards - on-premise deployment, data siloing, and rigorous regulatory compliance - can all be layered onto an LLM stack, but they address only part of the threat surface. To guarantee that an AI system cannot leak user data even if its operators act maliciously, cryptographic protections must be embedded in the infrastructure itself. When you can offer a mathematical proof that ‘the provider cannot see a user’s sensitive data’, individuals and enterprises alike can trust that their most valuable information remains private.</p><p>These cryptography-based protections deliver that level of assurance and provide several decisive advantages over conventional methods, as detailed below:</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/b735e8e22381803e3ef24bbb7375b3f596fdb9c13951916ca3c88a502bae5e2f.png" alt="Comparision" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Comparision</figcaption></figure><p><strong><em>We’ve built </em></strong><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://panda.chat"><strong><em>Panda</em></strong></a><strong><em>,</em></strong> a privacy-preserving LLM inference service that never compromises confidentiality of user data, using Trusted Execution Environment (TEE). This article outlines how it was achieved using GPU TEEs and verifiable infrastructures.</p><h2 id="h-technical-foundation-gpu-tee-and-dstack" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Technical Foundation: GPU TEE &amp; DStack</h2><p>Panda is a privacy-first LLM service that ensures that interactions remain entirely private and inaccessible to any third party, including us, the platform provider. This is achieved by combining end-to-end encryption with TEE, enabling AI models to run securely on the server side without ever exposing user data in plaintext.</p><h3 id="h-cpu-tee" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">CPU TEE</h3><p>The foundation of TEE technologies used in Panda starts from CPU TEEs. These are designed to create secure enclaves inside the processor that protect both code execution and data storage, ensuring the privacy and integrity of any program running within. These enclaves provide strong isolation from the host operating system, hypervisor, and even the cloud provider itself. A well-known example is Intel SGX, which offers a protected memory region called the Enclave Page Cache (EPC). This encrypted and isolated space enables confidential computing by safeguarding both the data and control flow inside the enclave.</p><p>To ensure not just privacy but also trust in what’s running, CPU TEEs support remote attestation. This process allows the enclave to produce a signed proof of its own identity and integrity - verifying exactly which code is loaded and that the enclave hasn’t been tampered with. The attestation report includes a hash of the enclave’s code and configuration (called the measurement), which external parties can check before sending sensitive data inside.</p><p>However, SGX imposes several limitations; its enclave size is small, and the enclave cannot directly execute syscalls, forcing developers to refactor applications and manage complex proxying mechanisms.</p><p>To address these limitations, hardware vendors such as Intel and AMD have introduced <strong>VM-based TEEs</strong> such as Intel TDX and AMD SEV-SNP. Rather than securing a small isolated region, these technologies encrypt the entire guest virtual machine’s memory, conceal the CPU state using a separate privilege layer, and treat the host hypervisor as untrusted. This allows for a more scalable confidential computing model compared to enclave-based approaches.</p><h3 id="h-gpu-tee" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">GPU TEE</h3><p>One of the most viable technologies for ensuring complete confidentiality of user-related data, even from the service provider at LLM services, is GPU TEE.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/483c411f79e231451ef12fede7370564ff3a4b6c242be53eb8829c30b751b018.png" alt="(NVIDIA H100 Confidential Computing initialization process | Source: NVIDIA Technical Blog)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">(NVIDIA H100 Confidential Computing initialization process | Source: NVIDIA Technical Blog)</figcaption></figure><p>GPU TEE builds on the security foundation of CPU TEE to extend data protection into the GPU, allowing sensitive workloads to remain confidential across the full compute stack. One of the most advanced and practical implementations of this today is NVIDIA Confidential Computing (CC), which currently stands as the only viable TEE technology for GPUs.</p><p>NVIDIA CC begins with a secure setup process based on a hardware Root-of-Trust (RoT), which is physically embedded on-die within the GPU itself. This RoT securely holds cryptographic secrets and the unique identity of the GPU, serving as the anchor for establishing trust. To create a secure connection between the CPU and the GPU, the system uses a protocol called SPDM (Security Protocol and Data Model). SPDM performs mutual authentication and sets up encrypted communication using a session key between the GPU and a Confidential Virtual Machine (CVM) running inside a CPU TEE, such as AMD SEV-SNP or Intel TDX.</p><p>Data transfer between the CPU and GPU is handled by Direct Memory Access (DMA) engines built into the GPU. When CC mode is activated, these DMA engines are restricted to only read from and write to a specific region of GPU-accessible memory called the “encrypted bounce buffer.” This memory region is explicitly designated and isolated by the GPU’s memory controller and is not accessible by any other host processes or applications. As a result, any data moving between the CPU and GPU stays within a secure, encrypted channel, ensuring that it cannot be observed or tampered with by the host system or external software.</p><p>By combining CPU-based encryption and attestation with the GPU’s hardware Root-of-Trust, NVIDIA’s GPU TEE creates a secure, end-to-end environment where data remains protected throughout its entire lifecycle, even from infrastructure operators or hardware providers themselves.</p><h3 id="h-dstack-and-private-ml-sdk" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Dstack &amp; private-ml-sdk</h3><p>One of the ways to implement privacy-preserving AI solution with GPU TEEs is to use <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/nearai/private-ml-sdk/blob/main/README.md">private-ml-sdk</a>, built on top of <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/Dstack-TEE/dstack">dstack</a>.</p><p>Dstack, built by <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://phala.network/">Phala</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.flashbots.net/">Flashbot</a>, is an intuitive SDK that streamlines the deployment of arbitrary containerized apps within TEEs. It offers a set of tools needed for seamless operation and transparency/verifiability of applications running on TEEs.</p><p>With dstack, users can launch multiple CVMs, each having a single docker compose file. These CVMs utilize a custom, reproducible OS image that is pre-integrated with dstack’s runtime components. Upon boot, the system automatically launches docker containers as specified in the docker compose file.</p><p><strong>Verifiability of Dstack</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/955e341f10eef1fe131f2bf9a723bd896ead3fa43905a15d7cf43b2489df6c83.png" alt="(Architecture of dstack-os to ensure verifiability | Source: Phala Blog)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">(Architecture of dstack-os to ensure verifiability | Source: Phala Blog)</figcaption></figure><p>To support full verifiability of the overall architecture, including the application running inside the CVM, dstack generates attestation including the hash of the docker compose file. Intel TDX, which is the only TEE hardware that is currently supported by dstack, provides multiple cryptographic measurements in its remote attestation for verifiability of launch config and runtime integrity of a TDX guest VM. Dstack leverages the following measurements provided by the Intel TDX:</p><ol><li><p><strong>MRTD</strong>: Measurement of Trust Domain. It provides a static measurement of the guest VM build process and the initial contents of the guest VM, ensuring the integrity of hypervisor and serving as the base trust anchor.</p></li><li><p><strong>RTMR</strong>: Run-time measurement register. It is an array of general-purpose measurement registers to enable measuring additional logic and data loaded into the guest VM at run-time.</p></li></ol><p>There are 4 RTMRs from <code>RTMR0</code> to <code>RTMR3</code>, where dstack stores the following information:</p><ul><li><p><code>RTMR0</code> - VM hardware setup</p></li><li><p><code>RTMR1</code> - Linux kernel image measurement</p></li><li><p><code>RTMR2</code> - kernel cmdline and initrd measurements</p></li><li><p><code>RTMR3</code> - Dstack app details</p></li></ul><p>The <code>RTMR3</code> includes the hash of the docker compose file that the operator has injected into the CVM with other necessary information about the application, so verifying the attestation generated inside the dstack CVM can ensure that the hardware as well as the application running inside the CVM is not manipulated by any malicious actors.</p><p>Also, TDX allows us to add an arbitrary custom data in the attestation quote, which is called <code>ReportData</code>. Dstack provides an API to request an attestation generation with custom <code>ReportData</code> through a guest agent.</p><p><strong>dstack-kms</strong></p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/56278b82e3f781f8dd8e0bfbc894c12e16b605baa2ef622bc3ef2bd6a786d017.png" alt="(Resilient, decentralized operation of TEE application using dstack-kms | Source: Phala Blog)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">(Resilient, decentralized operation of TEE application using dstack-kms | Source: Phala Blog)</figcaption></figure><p>In addition to its attestation capabilities, dstack also ensures the <strong>transparency and resilience</strong> of applications running within the TEEs by integrating with blockchain infrastructure. The central component responsible for this feature is <strong>dstack-kms</strong>, a key management service designed specifically for confidential computing use cases.</p><p>One of the attack vectors in privacy-sensitive applications is code substitution. A malicious service provider could temporarily replace the legitimate application with one that exfiltrates sensitive user data to an external server. Such an attack may leave no trace if it occurs between attestation checks. Detecting this kind of manipulation is extremely difficult unless clients frequently and consistently verify the attestation reports of the TDX-enabled environment. Dstack can be used to solve this problem, by enforcing application transparency through an onchain commitment scheme. It requires that every application running inside the TEE submit a hash of its container configuration to a smart contract known as <code>AppAuth</code>. Since this contract is publicly visible, any observer, including users, can audit which application hashes are registered and look for any discrepancies. If a hash is observed that doesn’t correspond to a known or trusted version, users can immediately suspect foul play, effectively creating a decentralized watchdog mechanism.</p><p>Beyond integrity, dstack also addresses the problem of <strong>key compromise and recovery</strong>. Dstack has a strict assumption that ‘even TEE can be compromised’. When the key used to encrypt the data inside the TEE is compromised, it is hard to recover the service since keys are tied to the specific hardware. Dstack solves this through dstack-kms, which manages cryptographic keys and the corresponding derivation function inside a separate CVM instance. It can be used to derive same keys over multiple TEE instances or rotate the keys.</p><p>To do these jobs, dstack-kms interacts with another smart contract called <code>KmsAuth</code>. This contract emits events whenever the application code changes or a new TEE instance is registered, notifying KMS nodes when a key needs to be provisioned or rotated. Upon such an event, the KMS node securely transmits the appropriate key to the target TEE instance. The communication channel between the KMS and the TEE is protected using <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://arxiv.org/pdf/1801.05863">RA-TLS</a>, a remote attestation-based TLS protocol where each endpoint verifies that the other is a genuine TEE instance before proceeding. This guarantees end-to-end confidentiality even in the presence of network-level adversaries.</p><p>To further mitigate the risks associated with KMS compromise, dstack supports MPC-based operation of multiple KMS nodes. This removes the single point of failure inherent in centralized key management, ensuring that even if one KMS TEE is compromised, the attacker cannot reconstruct the full key without compromising a threshold of additional nodes.</p><p><strong>private-ml-sdk</strong></p><p>Through the verification method with remote attestation and integration with blockchain, dstack provides a foundation for running privacy-preserving applications in a secure and verifiable way. However, it does not provide the full environment needed for large-scale privacy-preserving LLMs, particularly those leveraging GPUs.</p><p>For applications that utilizes GPU operation, private-ml-sdk - an extension of dstack developed by Phala and Near - can be utilized. It extends dstack to support GPU TEE by adding the necessary components for GPU operations like NVIDIA drivers and CUDA libraries to the OS image.</p><h2 id="h-pandas-technical-design" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Panda’s Technical Design</h2><p>We’ve built Panda leveraging private-ml-sdk. The following demonstrations are what we’ve considered during the design.</p><h3 id="h-using-gpu-tee-and-dstack" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Using GPU TEE &amp; Dstack</h3><p>We believe that GPU TEE and dstack form the strongest available foundation for a privacy-preserving AI inference service, among available solutions.</p><p>Other approaches to privacy-preserving LLM inference outside of TEEs have yet to achieve production-grade performance. Relevant cryptography-driven research includes:</p><ul><li><p>FHE (Fully Homomorphic Encryption)</p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://arxiv.org/abs/2311.08610">Polynomial Transformers</a>: Introducing the first polynomial transformer to convert models into polynomial form and run inference with transformer and homomorphic encryption.</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.ndss-symposium.org/wp-content/uploads/2025-868-paper.pdf">NEXUS</a>: Non-interactive protocol for secure transformer inference.</p></li></ul></li><li><p>MPC (Multi-Party Computation)</p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://crypten.ai/">CrypTen</a>: Uses secure MPC, where multiple nodes compute on an encrypted data. Researched by Meta.</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://nillion.com/news/fission-distributed-privacy-preserving-large-language-model-inference/">Fission</a>: Enhances CrypTen by separating linear and non-linear operations to different parties, where privacy is still preserved by the basic concept of MPC. Researched by Meta and Nillion.</p></li></ul></li></ul><p>Although these techniques operate directly on encrypted user inputs - and thus provide strong privacy guarantees - their latency remains prohibitive. FHE inference still requires minutes even for mid-sized BERT-class models. MPC-based Fission lowers latency to roughly 14 seconds on Llama 3.1, which is still far from mainstream AI chat apps that deliver responses in a few hundreds of milliseconds. By contrast, GPU TEE inference achieves ChatGPT-class responsiveness with only about a 10 percent performance overhead.</p><p>Dstack currently appears to be the most mature SDK for GPU TEEs.</p><ul><li><p>Traditional TEE offerings like AWS Nitro have been used in some cases like <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/base/op-enclave">op-enclave</a>, but are not compatible with NVIDIA’s CC mode.</p></li><li><p>Some projects for general TEE use cases - like <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/confidential-containers">confidential-containers</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/cc-api">cc-api</a> - are in development and not ready for the production usage yet.</p></li></ul><p>Dstack and private-ml-sdk also show powerful use cases at GPU TEEs, such as <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://redpill.ai/">Redpill</a>.</p><h3 id="h-extending-chain-of-trust-to-the-client" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Extending Chain of Trust to the Client</h3><p>Panda extends the chain of trust established by dstack all the way to the client, allowing users to verify in real-time that they are communicating with a genuine, attested TEE instance.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/1ffb29128f05eaff2bc7ec11bea626498e519bafbc89b76741730813ad452899.png" alt="Chain of Trust at Panda" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Chain of Trust at Panda</figcaption></figure><p>The process of client verification takes the following steps:</p><ol><li><p><strong>TLS Certificate Generation</strong></p><p>When the inference server starts, it generates a TLS certificate for its registered domain (e.g., panda.chat) and a ECDSA private key.</p></li><li><p><strong>Embedding Public Key in TDX Quote</strong></p><p>The public key, derived from the ECDSA private key, is embedded in the TDX quote as <code>ReportData</code>. The inference server then registers both the quote and the public key with the external application server, outside of TEE.</p></li><li><p><strong>Onchain Attestation Verification</strong></p><p>The application server submits a transaction containing the quote to the <code>AutomataDcapAttestationFee</code> contract on OP Mainnet (<a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/automata-network/automata-dcap-attestation/blob/c66b1e313f8b3dc63880ddecc1bf1c271331dcbd/evm/contracts/AutomataDcapAttestationFee.sol#L12">developed by Automata</a>). This smart contract performs onchain verification of the Intel TDX quote.</p></li><li><p><strong>Storing Verification Result</strong></p><p>If the attestation succeeds, the application server stores the resulting transaction hash.</p></li><li><p><strong>Client Fetches Valid Hashes</strong></p><p>The client fetches the list of valid quote verification transaction hashes from the <code>AppAuth</code> contract on OP Mainnet.</p></li><li><p><strong>Challenge-Response Setup</strong></p><p>The client sends an inference request to the TDX instance, including a <code>Panda-Challenge</code> header containing a random 32-byte hex string. This string will be signed by the inference server.</p></li><li><p><strong>Server Signs the Challenge</strong></p><p>The inference server constructs the following message to sign:</p><pre data-type="codeBlock" text="PROOF_PREFIX | SERVER_TIMESTAMP | RANDOM_SALT | CLIENT_CHALLENGE
"><code>PROOF_PREFIX <span class="hljs-operator">|</span> SERVER_TIMESTAMP <span class="hljs-operator">|</span> RANDOM_SALT <span class="hljs-operator">|</span> CLIENT_CHALLENGE
</code></pre><ul><li><p><code>SERVER_TIMESTAMP</code> and <code>RANDOM_SALT</code> help prevent signature replay attacks.</p></li><li><p>The server signs this message using the private TLS key generated in Step 1.</p></li><li><p>The signature, along with the <code>SERVER_TIMESTAMP</code> and <code>RANDOM_SALT</code>, is returned in the response headers.</p></li></ul></li><li><p><strong>Client Retrieves Attestation Hash</strong></p><p>The client queries the application server to get the <strong>transaction hash</strong> associated with the server’s attestation.</p></li><li><p><strong>Final Verification</strong></p><p>Using the hash, the client verifies on OP Mainnet that:</p><ul><li><p>The attestation transaction exists and is valid.</p></li><li><p>The app hash retrieved from <code>AppAuth</code> contract matches the app hash from the quote.</p></li><li><p>The public key in the verified TDX quote matches the public key used by the server.</p></li></ul></li></ol><p>Through this mechanism, the client can ensure:</p><ol><li><p><strong>The TEE server is genuine and untampered</strong></p><p>The Intel TDX quote is cryptographically verified onchain, proving that the server is running inside a trusted and unmodified TEE.</p></li><li><p><strong>The server the client is connected to is the verified TEE server</strong></p><p>By verifying the TLS public key against the attested quote, the client ensures that it is communicating with the legitimate TEE server, with an assumption that attestations for all TLS certs of the domain are provided and can be verified by the user.</p></li></ol><h3 id="h-enhancing-ux-without-sacrificing-privacy" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Enhancing UX without sacrificing Privacy</h3><p>To provide useful AI inference service, there are a few additional features to be supported as follows:</p><ul><li><p>User chat history</p></li><li><p>Vector database for advanced RAG features (e.g. web search, PDF analysis)</p></li></ul><p>Panda follows a strict security posture on these features.</p><p><strong>Encryption by user-side secret</strong></p><p>One requirement for AI inference services like Panda is management of each user’s chat history. Since these transcripts include sensitive information, they should also be end-to-end encrypted at the application level.</p><p>The client-side encryption workflow is as follows:</p><ol><li><p>A user creates a master password which is used to encrypt and decrypt every chat history and associated user data.</p></li><li><p>This password is used to derive an encryption key.</p></li><li><p>Each chat message is encrypted with the encryption key, then upload the encrypted ciphertext to the remote storage.</p></li><li><p>The encryption key never leaves the client; Panda’s servers only see opaque ciphertext.</p></li></ol><p>Because Panda cannot decrypt these blobs, even privileged operators or a compromised backend gain no insight into users’ private data. Lost keys simply render the data unreadable, mirroring the security model of modern end-to-end encrypted messengers.</p><p>To prevent XSS-driven key theft or any other client-side mischief at runtime, we off-load all cryptographic work - key unwrapping, encryption, decryption - into a sandboxed iframe**.** Because <strong>t</strong>his sandboxed iframe is hosted on a opaque origin, it allows zero direct reads, zero ambient storage, and every cookie is hidden from JavaScript. Every encryption / decryption is done via explicit message passing between main app and the sandbox, where each request is protected by strict CSP.</p><p>Also, to prevent the situation that user has to re-enter the password every time client memory is cleared (e.g. due to page refresh or tab closure), Panda encrypts the user password with server-provided, periodically rotating key, and stores the encrypted password in the browser&apos;s local storage. Server provides the <code>old_key</code> and <code>new_key</code> when the rotation happens, so that the client can decrypt the saved password using the <code>old_key</code> and re-encrypt it with the <code>new_key</code>. These key rotation are also done inside the sandboxed iframe, significantly increasing the security of these operations while also improving the UX by avoiding frequent password prompts. The use of a server-side rotating key acts as a safeguard, ensuring that even if the saved encrypted password is retrieved by client-side attacks, long-term access to the user’s chat history remains protected.</p><p><strong>Strict TTL at the vector DB</strong></p><p>Vector DB is a purpose-built system designed to store and search machine-generated embeddings. Unlike traditional databases that organize data in rows and columns, a vector DB represents each document chunk as a high-dimensional numeric vector and indexes them using an approximate nearest neighbor (ANN) algorithm. These systems are optimized to efficiently compare vectors using predefined similarity metrics.</p><p>This can be used to enhance the accuracy of LLM inference service. When prior chats or uploaded documents are embedded and retrieved at inference time, LLMs gain rich, user-specific context, dramatically improving answer quality.</p><p>Although the embeddings themselves are numerically transformed, they can still leak private information if an attacker extracts and decodes them. If the root key of the TEE were ever to be compromised, an adversary could scrape the entire vector store.</p><p>To mitigate this risk, Panda enforces a strict time-to-live (TTL) policy at its vector DB, of 1 day. This minimizes the attack surface by ensuring that even in the event of a breach over the TEE instance, only data added within the past 24 hours can be leaked.</p><h2 id="h-conclusion" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Conclusion</h2><p>TEEs provide hardware-enforced isolation that allows models to run without exposing plaintext data to infrastructure operators, system software, or external observers. System architectures that extend these guarantees to GPUs have now reached a level of maturity where they can support production-grade confidential LLM inference in real-world deployments.</p><p>Building such systems, however, is non-trivial. It requires deep familiarity with both the capabilities and limitations of the underlying hardware - ranging from attestation protocols and root-of-trust initialization to the secure orchestration of containerized environments. It also demands practical solutions for challenges like runtime verifiability, rollback resistance, and integration with transparency and auditability mechanisms.</p><p>Panda, built on top of dstack and modern GPU TEE infrastructure, demonstrates that secure, production-grade confidential LLM inference is not only possible, but operationally viable. It extends the chain of trust from the Intel TDX hardware enclave all the way to the client, ensuring that every layer of the system is verifiably secure. By leveraging custom <code>ReportData</code> fields and onchain attestation verification, Panda delivers end-to-end confidentiality and integrity across the full inference lifecycle.</p>]]></content:encoded>
            <author>testinprod-io@newsletter.paragraph.com (Test In Prod)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/001024bd761e131436d7ae72842ff815ace2bb3e7b62706aaf1c8dad0e3a61c2.png" length="0" type="image/png"/>
        </item>
        <item>
            <title><![CDATA[Falling into the Optimism rabbit hole: Bedrock, OP Stack, and Superchain]]></title>
            <link>https://paragraph.com/@testinprod-io/falling-into-the-optimism-rabbit-hole-bedrock-op-stack-and-superchain</link>
            <guid>ot5xRM1aqlXFLdbQg2R8</guid>
            <pubDate>Wed, 11 Jan 2023 12:49:48 GMT</pubDate>
            <description><![CDATA[TL;DRBedrock is an epic software update that Optimism put everything they learned. Optimism started splitting the code into three parts to become a rollup framework -- Consensus, Execution, and Proof.OP Stack is a rollup framework that allows anyone to plug different modules for rollup’s three parts based on the Bedrock update’s modularization.Superchain is a collective of chains that use OP Stack. Superchain provides a single-chain experience for users by leveraging a single set of sequencer...]]></description>
            <content:encoded><![CDATA[<h3 id="h-tldr" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">TL;DR</h3><ol><li><p><em>Bedrock</em> is an epic software update that Optimism put everything they learned. Optimism started splitting the code into <strong>three parts</strong> to become a rollup framework -- Consensus, Execution, and Proof.</p></li><li><p><em>OP Stack</em> is a rollup framework that allows anyone to plug different modules for rollup’s <strong>three parts</strong> based on the Bedrock update’s modularization.</p></li><li><p><em>Superchain</em> is a collective of chains that use <em>OP Stack</em>. Superchain provides a single-chain experience for users by leveraging a <strong>single</strong> set of sequencers.</p></li></ol><h2 id="h-intro" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Intro</h2><p>Hey there! We are TiP. We build stuff that scales Ethereum.</p><p>Bedrock update is coming to Optimism, but none of our team knew Bedrock exactly. We couldn’t also find a blog that explains Bedrock exactly. Everyone is talking about block time and gas cost, but we felt <strong>it’s more than block time or gas cost.</strong></p><p>We started to dig deeper into Bedrock and <strong>fell into the Optimism rabbit hole</strong>. It was amazing. This article takes you down the same rabbit hole we fell: <strong>the big picture of Optimism</strong> connecting Bedrock, OP Stack, and Superchain.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/5542ef7e0e0b5e8d5e2ada5d7cc6af2b3614318f71757976e747b56a38a1e900.png" alt="Me at 2 am googling OP on the bed" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Me at 2 am googling OP on the bed</figcaption></figure><h2 id="h-bedrock" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Bedrock</h2><p><em>Bedrock</em> is <strong>a)</strong> an epic <em>software update</em> that Optimism put everything they learned while operating the chain, and <strong>b)</strong> a <em>gentle announcement</em> that Optimism is not just a single rollup but also a rollup framework.</p><h3 id="h-software-update" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Software Update</h3><p>Bedrock contains a bunch of enhancements. Here are some of the key topics -</p><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ethereum-optimism/optimism/blob/develop/specs/derivation.md#batch-submission"><strong>Theoretically optimal data submission</strong></a><strong>:</strong> Rollups regularly submit data to Ethereum. Bedrock doesn’t waste a byte and gwei upon data submission, which <strong>saves the gas cost</strong>.</p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ethereum-optimism/optimism/blob/9a198e90b1a7ab90a2ca85a3277576103eba6548/specs/derivation.md"><strong>Smarter sync, sequencing, and state submission</strong></a><strong>:</strong> Syncing update enables Optimism to provide users <strong>stable service though L1 is shaking.</strong></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ethereum-optimism/optimism/blob/9a198e90b1a7ab90a2ca85a3277576103eba6548/README.md#directory-structure"><strong>Modularization</strong></a><strong>:</strong> It enabled the preceding updates and the transition to the <strong>rollup framework</strong>.</p></li></ul><p>We see <strong>modularization</strong> as the 👑 <strong>crown jewel</strong> of the Bedrock update.</p><h3 id="h-modularization" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Modularization</h3><p>Optimism had a <strong>monolithic codebase</strong> which caused a big problem. Engineers couldn&apos;t have flexibly modified the code because the entire codebase is tangled. Therefore, Optimism decided to separate the proof system, which had the most dependencies on the system.</p><p>After Optimism initiated the <strong>modularization</strong>, amazing things happened. The new codebase was so intuitive that the community could’ve forked the code and implemented a whole new rollup, such as <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://opcraft.mud.dev/">Minecraft rollup</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://www.youtube.com/watch?v=a5NIGmu9Lv8">Game boy rollup</a>. Modularization ended up enabling the community to accessibly build variations of Optimism rollup and advance the rollup community at the end of the day.</p><p>As a result, the Optimism team <strong>built a bedrock for the <em>OP Stack</em>.</strong></p><h2 id="h-op-stack" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">OP Stack</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/bdeef51695b5ae9384beb91a6a6e84ae19d9b3673fb4e0dab948eecf996c54c4.png" alt="Source: Introducing the OP Stack (https://optimism.mirror.xyz/fLk5UGjZDiXFuvQh6R_HscMQuuY9ABYNF7PI76-qJYs)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Source: Introducing the OP Stack (https://optimism.mirror.xyz/fLk5UGjZDiXFuvQh6R_HscMQuuY9ABYNF7PI76-qJYs)</figcaption></figure><p><em>OP Stack</em> is a rollup framework that allows anyone to plug different modules for rollup’s <strong>three parts</strong> -- Consensus, Execution, and Settlement. It could be possible thanks to <em>Bedrock’s</em> modularization!</p><p><em>OP Stack</em> allows you to build various kinds of chains! You can build an EVM chain that uses ZK-proof and stores data to the blob on Ethereum; or a Game Boy chain that uses fault-proof and stores data on your desktop computer. I’m not joking; it’s happening!</p><p>Optimism defined consensus, execution, and settlement as a mental model representing the rollup’s technical stack. This means you can <strong>make your new rollup by combining</strong> a consensus module, an execution module, and a settlement module, like a burrito!</p><p>The wordings are pretty hard. But don’t you worry, Anon. In short, the <strong>Consensus Layer</strong> saves, retrieves, and interprets the data; the <strong>Execution Layer</strong> executes interpreted data; and the <strong>Settlement Layer</strong> checks if everything is valid.</p><h3 id="h-consensus-layer" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Consensus Layer</h3><p>The Consensus Layer is responsible for storing, retrieving, and interpreting data. It contains <strong>two</strong> layers -- the Data Availability Layer and the Derivation Layer.</p><p>The <strong>Data Availability Layer</strong> is responsible for storing and retrieving the chain’s <strong>data</strong>. It’s <strong>data storage</strong> for your rollup. You can put the rollup’s data on Ethereum calldata, Ethereum blob, IPFS, or even your desktop computer.</p><p>The <strong>Derivation Layer</strong> is responsible for interpreting the data retrieved from the <strong>Data Availability Layer</strong>.</p><blockquote><p><em>FYI,</em> <code>S</code> <em>represents</em> <code>State</code> <em>and</em> <code>DA</code> <em>represents</em> <code>Data Availability</code> <em>in the formula.</em></p></blockquote><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/9a35621aa4d371773b5cbcdc98701b636552bb6629f7a882120474897d3cfbb5.png" alt="Source: Modular Rollup Theory Through the Lens of the OP Stack by Kelvin Fichter (https://youtu.be/jnVjhp41pcc?t=596)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Source: Modular Rollup Theory Through the Lens of the OP Stack by Kelvin Fichter (https://youtu.be/jnVjhp41pcc?t=596)</figcaption></figure><h3 id="h-execution-layer" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Execution Layer</h3><p>The <strong>Execution Layer</strong> is responsible for the execution. It <strong>takes</strong> interpreted data from the Consensus Layer, <strong>executes</strong> it, and <strong>generates</strong> the following status of the chain.</p><p>You can use various execution engines—for example, EVM (of course), Game Boy, and Minecraft. The sky is the limit!</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/f0b3638cfb45c2f93a18ff788c86b10cac4789f09112d045d77865601d7bdff9.png" alt="Source: Modular Rollup Theory Through the Lens of the OP Stack by Kelvin Fichter (https://youtu.be/jnVjhp41pcc?t=828)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Source: Modular Rollup Theory Through the Lens of the OP Stack by Kelvin Fichter (https://youtu.be/jnVjhp41pcc?t=828)</figcaption></figure><h3 id="h-settlement-layer" class="text-2xl font-header !mt-6 !mb-4 first:!mt-0 first:!mb-0">Settlement Layer</h3><p>The <strong>Settlement Layer</strong> is responsible for settling the chain. The Settlement Layer checks if the data and execution are right by putting everything all together. If the Settlement Layer verifies everything is correct, then the chain is settled to the next state.</p><p>You can use various methods to build the Settlement Layer—for example, <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum.org/en/developers/docs/scaling/optimistic-rollups/">Fault Proof</a> and <a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://ethereum.org/en/developers/docs/scaling/zk-rollups">Validity Proof</a>.</p><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/27dd6b66e2e298255cd725f065a602bd66358b3833ff1d38ef1995745fe62645.png" alt="Source: Modular Rollup Theory Through the Lens of the OP Stack by Kelvin Fichter (https://youtu.be/jnVjhp41pcc?t=1206)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Source: Modular Rollup Theory Through the Lens of the OP Stack by Kelvin Fichter (https://youtu.be/jnVjhp41pcc?t=1206)</figcaption></figure><h2 id="h-superchain" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Superchain</h2><figure float="none" data-type="figure" class="img-center" style="max-width: null;"><img src="https://storage.googleapis.com/papyrus_images/7ad14b6e3e20a1550b4f7f2c8dc8e835cdbb48f3af82bb6565d17fb81cf91099.png" alt="Source: Optimism’s OP Stack by Karl Floersch (https://youtu.be/HiU-g8XHi5s?t=1290)" blurdataurl="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=" nextheight="600" nextwidth="800" class="image-node embed"><figcaption HTMLAttributes="[object Object]" class="">Source: Optimism’s OP Stack by Karl Floersch (https://youtu.be/HiU-g8XHi5s?t=1290)</figcaption></figure><p><em>Superchain</em> is a collective of chains that uses <em>OP Stack</em>. From the revealed information, <em>Superchain</em> leverages <strong><em>OP Stack</em>’s modular architecture</strong> and a <strong>single shared sequencer set,</strong> allowing <strong>a)</strong> atomic cross-chain composability between chains and <strong>b)</strong> trustless rollup maintenance.</p><p>If we dare speculate Optimism’s intention for a Superchain, we see intentions to make a rollup like a <strong>smart contract</strong>. With a smart contract, a deployer doesn’t have to maintain their own infra to run their own code. But the code frictionlessly runs on the nodes; most importantly, the code executor doesn’t have to trust the deployer.</p><p>Similarly, when there is a <strong>shared <em>Superchain</em> sequencers set</strong> that commit to sequence and execute rollups on behalf of the deployers, both rollup deployers and users are happy. Because deployers don’t have to maintain their infra and put efforts into deploying a rollup, and users don’t have to trust the deployer. <strong>Nothing was compromised</strong> from the initial vision of trustless computing but only scales enough to serve everyone on the internet.</p><p>Therefore, with <em>Superchain</em>, we get a world where <strong>builders</strong> can <em>build a new rollup by combining</em> modules, <em>deploy a rollup easily</em> like a smart contract, and <em>don’t have to maintain a thing</em>; <strong>users</strong> can interact easily with other rollups as if they are using single big chain (single-chain experience); the <strong>trustless execution</strong> is guaranteed because nodes are well-decentralized.</p><p>Of course, realistically, we have some <strong>to-dos</strong> to make the <em>Superchain</em> possible. Here are some notable to-dos for the Superchain.</p><ul><li><p><strong>Multiple chains run on a sequencer.</strong> We call it <code>M:1</code> problem.</p></li><li><p><strong>Multiple sequencers that run a single chain.</strong> We call it <code>1:N</code> problem.</p></li><li><p><strong>Combining</strong> <code>1:N</code> <strong>and</strong> <code>M:1</code> for the <code>M:N</code> network.</p></li><li><p><strong>A communication protocol between rollups</strong> for atomic transactions between rollups.</p></li><li><p><strong>Diverse modules and implementations</strong> for Consensus Layer, Execution Layer, and Settlement Layer.</p></li></ul><p>Each to-do is quite a topic, but I know we can make it. We are talking about <strong><em>Optimism</em></strong>, my friends!</p><h2 id="h-in-conclusion" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">In conclusion</h2><p>As a team commits to scaling Ethereum, Superchain is a mission that flutters our hearts. The most amazing part is that Optimism is a public good for the community’s public benefit. The entire codebase is under the MIT Licence, which allows everyone to contribute new ideas and redistribute freely.</p><p>Optimism is building days and nights for everyone’s public benefit. They are especially working harder at the moment since Bedrock is merging to test net soon. When each feature is shipped, we are getting one step closer to the <em>Superchain.</em></p><p>Lastly, I would like to thank the Optimism team for building an amazing product for the community. Their positive impact is not something I’ve ever seen in my life.</p><p><strong><em>Let’s stay optimistic!</em></strong></p><h2 id="h-sources" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Sources</h2><ul><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://dev.optimism.io/introducing-optimism-bedrock/">Introducing Optimism Bedrock</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://optimism.mirror.xyz/fLk5UGjZDiXFuvQh6R_HscMQuuY9ABYNF7PI76-qJYs">Introducing the OP Stack</a></p></li><li><br></li><li><br></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://github.com/ethereum-optimism/optimism/tree/9a198e90b1a7ab90a2ca85a3277576103eba6548/specs">Optimism Specs</a></p></li><li><p><a target="_blank" rel="noopener noreferrer nofollow ugc" class="dont-break-out" href="https://community.optimism.io/docs/developers/bedrock/">How is Bedrock Different?</a></p></li><li><br></li></ul><h2 id="h-have-a-question" class="text-3xl font-header !mt-8 !mb-4 first:!mt-0 first:!mb-0">Have a question?</h2><p>Email us to <code>contact[at]testinprod.io</code> 🙌</p>]]></content:encoded>
            <author>testinprod-io@newsletter.paragraph.com (Test In Prod)</author>
            <enclosure url="https://storage.googleapis.com/papyrus_images/1cd8414d7ce0345fcc33b5d91d866dd82b1cf9cd9539860c287d7d8cc26d814e.png" length="0" type="image/png"/>
        </item>
    </channel>
</rss>