Data Flow
Tracing the journey of data from user action to private state update
1. Client-Side Encryption
Before any data leaves the user's browser, it is encrypted using the Sapphire Public Key. The frontend fetches this key directly from the Sapphire network via the web3 provider.
↓ ECIES Encryption
Ciphertext = 0x7f3a2b...9c
2. Public Submission
The user submits the transaction to the PrivateLendingIngress contract on Mantle.
What is visible?
- User Address (Sender)
- The encrypted Ciphertext (Blob)
- Gas Fees paid in MNT
Crucially, the actual action details (amount, token type) are hidden inside the ciphertext.
3. Cross-Chain Relay
The Ingress contract emits a Hyperlane event. Relayers observe this event and transport the message payload to the Sapphire network.
4. Private Execution (TEE)
Inside the Sapphire Trusted Execution Environment (TEE):
- The
LendingCorecontract receives the message. - It uses the Private Key (only available inside the enclave) to decrypt the ciphertext.
- It executes the logic (e.g., adds 1000 USDC to user's collateral).
- It updates the private state storage.
5. Indexing & Feedback
Ponder picks up the "ActionProcessed" event from Sapphire.
While the details remain private, the event confirms success or failure. The frontend queries the Ponder GraphQL API to update the UI (e.g., stopping a loading spinner).