r/PhalaNetwork • • Apr 15 '24

Introducing AI-Agent Contract for Smart Agents

1 Upvotes

r/PhalaNetwork • • 13d ago

What does a TEE actually protect when you send a prompt to an AI service?

1 Upvotes

Suppose you send a private contract to an AI service. The connection uses HTTPS, and the operator says it does not keep your data. Once the request reaches the server, though, some program has to read the contract. Who can inspect that program's memory? What stops an update from adding a log of every prompt?

Those are useful questions for confidential computing. The answer depends on where the model runs, which parts of the system the TEE protects, and what the client verifies before sending anything.

I maintain an open-source AI gateway. The forwarding example below comes from that work, but the same trust-boundary questions apply to other services.

Consider two deployments. In the first, the model and inference process run inside a protected VM. With Intel TDX, the VM's private memory and processor state are isolated from direct host access under the hardware's security model. The guest OS and application remain trusted components. A program inside the VM can still leak data deliberately or through a bug. Intel's introduction explains this boundary.

For a CPU inference example, that boundary can include the model computation. If the service sends tensors to an ordinary GPU, or sends documents to an external retrieval database, those paths need their own protection. The diagram needs to follow the data beyond the box labelled “TEE.”

In the second deployment, the protected VM runs an AI gateway. It receives the prompt, calls an external model provider, and returns the answer. Here the TEE can reduce exposure to the gateway's hosting infrastructure. The model provider still receives the content required for inference. Its retention policy and the identity of its model remain separate trust questions.

Before sending the contract, the client needs evidence about the endpoint. One approach is to bind a fresh client challenge and the current TLS certificate into the hardware attestation. The client checks that evidence against independently approved software measurements and a platform security policy, then sends the request over the verified connection.

The connection binding matters: a valid quote from one machine is little help if the prompt goes to another. The reference measurements matter too. Accepting whatever measurements the server supplies would let the server choose its own passing grade. Open source gives people code to review; the build and measurement chain must still connect that review to the running service.

Now consider a different dispute: the contract stayed private, but the bill looks wrong.

Suppose a provider reports 10,000 input tokens, including 2,000 cached tokens, and 1,000 output tokens. Use illustrative rates of $2 per million ordinary input tokens, $0.20 per million cached tokens, and $8 per million output tokens. The charge is:

8,000 × $2 / 1,000,000
+ 2,000 × $0.20 / 1,000,000
+ 1,000 × $8 / 1,000,000
= $0.0244

An implementation that charges all 10,000 input tokens at the ordinary rate and then adds the cached-token charge would produce $0.0284. A TEE can faithfully run either calculation. Checking the arithmetic requires the counters, their meanings, the applicable price snapshot, and the billing rules.

This is where the public-verification idea associated with blockchains becomes useful. A user should be able to inspect the evidence behind an accounting result instead of relying entirely on a balance displayed by the operator.

In the implementation I work on, the gateway commits usage and billing records to signed batches on a five-minute publication cycle. Each batch identifies the previous batch hash. The signing key has its own attestation binding, so a verifier can connect a receipt to an approved runtime as well as check that its bytes have not changed. Checking a batch's signature, reproducing each charge, and verifying the runtime identity are separate checks.

The public records contain accounting metadata. They exclude prompts, answers, and authentication credentials. User pseudonyms change between batches, although timing and usage patterns can still link activity. Publishing auditable bills requires a deliberate decision about what becomes public.

There is an important gap in this design. A valid signature establishes what a key committed to; it does not establish that every request was recorded. A chain of hashes can expose a broken link in a presented history, but an observer may still receive an old prefix or one of several divergent histories. A single attested writer provides no consensus about the latest state. These cryptographic building blocks also predate blockchains.

A crash creates another boundary. A local journal can preserve events already committed to it, and a failed upload can be retried with the same signed bytes. Neither mechanism recovers an event that was never committed, nor does local storage alone prove that the entire stored history has not been rolled back.

The practical result is a more specific set of questions to ask of an AI service: which endpoint received the prompt, which software was approved, what evidence supports the charge, and which parts of the story still depend on an external provider or operator?

The concrete gateway example is TeeRouter, which I maintain and run on dstack/TDX. Its receipt format and verification limits are public. This article was prepared with AI assistance.

For others building TEE services, how do you handle the history problem? In particular, what do independent observers retain or compare so that a valid but stale history is detectable?


r/PhalaNetwork • • Jan 28 '26

Who's hardware does the Phala Network run on?

4 Upvotes

r/PhalaNetwork • • Sep 03 '25

Telegram SCAM - bournesmovers.migration

3 Upvotes

Beware! Many groups on Telegram claiming to be PHALA but are a SCAM. Some scam groups have thousands of members and they try to convince members to migrate tokens using their scam contract! They will drain your wallet. Not a valid migration link. bournesmovers is the link they send you to - do not link wallet!


r/PhalaNetwork • • Apr 22 '25

Intro

5 Upvotes

Hi Everyone. Not a big Reddit guy but will try to be active here and answer any questions. I'm excited what phala.network is doing with phala.cloud and even more excited with what they plan to do in the future.


r/PhalaNetwork • • Feb 23 '25

Unlock the Future: Cryptocurrency, AI, and Rewards - Grass DePIN

5 Upvotes

🌿 Discover the Path to Green Grass with the Grass Project!

Are you ready to step into the future with a revolutionary blend of Crypto and AI? Join the Grass project - your gateway to the next big thing in technology!

Why GetGrass.io?

  • Integration of Crypto & AI: Ride the wave of two of the hottest trends in technology seamlessly integrated into one project.

  • Early Adopter Advantage: Be part of the vanguard in an explosive project with early funding and immense potential.

  • AI Knowledge Hub: Witness the evolution of a project set to become a primary source for cutting-edge AI knowledge.

  • No Commitment, Just Resources: Utilize your existing resources with no commitment - a smart way to engage with the future.

  • Exclusive Access with Code: Use referral code SEsneMoIYQS6M3w for exclusive access to exciting features!

Getting Started:

Register: Sign up with referral code (It will give you 5000 points): SEsneMoIYQS6M3w or use the link below to embark on this incredible journey: https://app.getgrass.io/register?referralCode=SEsneMoIYQS6M3w

Install Extension: Enhance your experience by installing the browser extension: https://chromewebstore.google.com/detail/grass-lite-node/ilehaonighjijnmpnagapkhpcdbhclfg?hl=en

CoinMarketCap: https://coinmarketcap.com/currencies/grass/

Connect: Sign in to the extension, and if it says connected, you're already earning points!

Questions or Assistance? Reach out to me anytime; I'm here to guide you through.

Learn More: Dive deeper into the project on our Discord channel and explore our website at getgrass.io.

🌱 Join us today and let's grow together with Grass!


r/PhalaNetwork • • Feb 19 '25

Oasis, iExec, Phala, and Automata live on X discussing TEEs!

Thumbnail
x.com
4 Upvotes

r/PhalaNetwork • • Jan 16 '25

PHA distribution to DOT stakers on Kraken parachain auctions should start this month

3 Upvotes

Just heard this from Kraken support.


r/PhalaNetwork • • Jan 04 '25

Transfer question

3 Upvotes

I have some PHA rewards from the crowdloan in my app.phala.network/khala

I am looking to transfer to ETH. It gives me the option to Bridge via Subbridge.io

Has anyone done this recently? Any tips?

I will not respond to PMs asking for keys or dick pics.


r/PhalaNetwork • • Dec 26 '24

PHA from Khala to Phala

6 Upvotes

is there a simple way to bridge PHA from Khala Chain to Phala Chain without ETH?


r/PhalaNetwork • • Dec 25 '24

PHA allocation from Kraken Parachain stake

3 Upvotes

Hello

when is the PHA rewards from allocating dot to the PHA auction through Kraken going to be distributed?


r/PhalaNetwork • • Dec 24 '24

Phala is flying!

10 Upvotes

Lets hope this continues 😍


r/PhalaNetwork • • Sep 07 '24

Phala’s Ecosystem Overview - Where AI Meets Web3.0

Post image
3 Upvotes

r/PhalaNetwork • • Sep 04 '24

Phala Ecosystem Events by August 2024

Post image
3 Upvotes

r/PhalaNetwork • • Jul 16 '24

Make this make sense?

2 Upvotes

Hi everyone, forgive my ignorance but I have a couple people asking me to deposit money into Phala to earn 12% on immediate investment. As well as a 1.5% return a day. I am sorry but is this a scam? And if it’s not, make it make sense to me.


r/PhalaNetwork • • Jul 07 '24

Transaction Volume of Phala Network! 🚀

Post image
2 Upvotes

r/PhalaNetwork • • Jun 09 '24

Multi AI Agent bots coming to TG soon!

1 Upvotes

Here is a preview of what the AI Agents integration will look like on telegram chats: https://x.com/PhalaNetwork/status/1798748198032355554

Join AgentWars and unlock your AI Agent: https://agentwars.phala.network/invite/aw-VWUVFp


r/PhalaNetwork • • May 29 '24

AgentWars is coming!

1 Upvotes

r/PhalaNetwork • • May 13 '24

RedPill 💊 is alived on Base!

2 Upvotes

Contact Marvin in DM on X to receive the access code!

https://twitter.com/marvin_tong/status/179008987200449345


r/PhalaNetwork • • May 05 '24

Making World-Class AI Accessible to Everyone, Everywhere.

2 Upvotes

Aggregating top AI models (ChatGPT, Claude, LlaMa), Red Pill opens up AI, making the best AI accessible to everyone, everywhere in the world.


r/PhalaNetwork • • May 03 '24

Unleashing the Potential of AI with Polkadot and Phala

Thumbnail
youtube.com
2 Upvotes

r/PhalaNetwork • • Apr 18 '24

Multi-Agent Systems as the New Frontier in Blockchain Innovation

1 Upvotes

r/PhalaNetwork • • Apr 15 '24

Explaining Phala as a CoProcessor + the AI Agent Economy

3 Upvotes

r/PhalaNetwork • • Apr 15 '24

Discover our latest bi-weekly roundup capturing our recent advancements

1 Upvotes

r/PhalaNetwork • • Apr 11 '24

Phala Monthly Newsletter: March 2024

1 Upvotes