Skip to main content
Sequence flow of the Loyal frontend
The Loyal client is just one option for interacting with the network, and it follows MagicBlock’s Private Ephemeral Rollup flow end-to-end before it will send a request. The sequence is:
  1. Generate a 32-byte nonce, send it to the TEE RPC, and validate the returned TDX quote via PCCS collateral. We rely on verifyTeeRpcIntegrity from the @magicblock-labs/ephemeral-rollups-sdk; if the quote fails verification, the UI halts.
  2. With integrity confirmed, the wallet asks the RPC for a challenge that is scoped to its public key, signs it, and exchanges the signature for a short-lived authorization token using getAuthToken.
  3. The token is appended as a query string when opening the Solana connection so every request is tied to the attested session.
import { verifyTeeRpcIntegrity, getAuthToken } from "@magicblock-labs/ephemeral-rollups-sdk";
import { Connection } from "@solana/web3.js";

const isIntegrityVerified = await verifyTeeRpcIntegrity(PRIVATE_ER_URL);
if (!isIntegrityVerified) throw new Error("TEE attestation failed");

const { publicKey, signMessage } = useWallet();
const authToken = await getAuthToken(PRIVATE_ER_URL, publicKey, signMessage);
const connection = new Connection(`${PRIVATE_ER_URL}?token=${authToken}`, "confirmed");

PER Lifetime and Anonymity Window

MagicBlock PER is a parallel execution layer that settles back to Solana; it is not one rollup instance per user.For privacy, two windows matter:
  1. Session window: your PER auth token is short-lived (getAuthToken returns expiresAt). When it expires, the client must re-authenticate.
  2. Delegation window: your private account access on PER starts when accounts are delegated and ends when they are undelegated/committed back to Solana.
Your practical anonymity set comes from overlapping delegated activity on the same PER endpoint and permission domain during that time, not from a single fixed “rollup lifetime.”To tune the tradeoff, choose delegation windows based on your threat model: longer windows can increase overlap (and therefore anonymity set), while shorter windows reduce exposure if keys, sessions, or delegated permissions are compromised. In practice, batch private actions when possible, keep windows only as long as needed, and undelegate promptly after completion.Once the handshake succeeds, the user links a Solana wallet and receives a PDA that anchors every chat session and settles payments automatically.Because the state lives on-chain, users are not tied to our interface. They can fork the frontend, self-host a minimal web or mobile client, or embed Loyal into an existing product while preserving the same conversations. Privacy-conscious users keep control over their history, export encrypted transcripts, or delete them without asking permission from a centralized provider.