The Trustless Agentic Economy with ERC-8004 and x402

ETH Global Talks · 14 Jul 2026 · 32:59

Jake Hall gives a pre-recorded technical deep dive into building AI agents that earn revenue, pay each other and carry their own onchain identity. He covers three layers: ERC-8004 for identity and trust, agent communication protocols, and the x402 payment standard, so agents can discover, trust and pay one another without a central intermediary.

Speakers

Topics

From ETH Global Talks; community: ETHGlobal.

Transcript

Okay, looks like we're live. Well, today we're going to be covering some AI agent stuff. Uh, firstly, I do want to start off. I'm sorry I'm not able to do this live. It was quite late for me, so I've just pre-recorded this. Um, but we're going to take a real deep dive. If we're going to get really technical, really, really into it to be fair on how you can build AI agents which leverage all of the latest innovations in the AI agent and web 3 space. So, in particular, we're going to be looking at how you can create AI agents that can earn revenue uh and can pay each other, AI agents which have their own identity on a decentralized ledger blockchain. Um, and also the the latest technologies for how

you can communicate with AI agents. So, let's get into sort of the the three pillars that we're covering. And like I mentioned, the first one is this identity layer. Um, it's the ability to actually identify AI agents. Uh, know where they're located, but also know whether you can trust them or not. As we sort of go into this agentic web where we're interacting with AI agents more and more often, we are obviously using chat GPT basically every single day. That's an AI agent inside of our browser. Now, these uh companies are also releasing agentic browsers and very soon, definitely within the next few years, we'll see companies expose AI agents and we're going to have AI agents

communicating with other AI agents. We need to know exactly where they are, where they're located, are they on a web server, are they on this or that? Um, and we also need to know how can we trust them. And obviously, blockchain gives a really nice way of doing that in a decentralized way. We're going to get into exactly how blockchain enables that. The other thing that you need is you need that communication layer. You need to be able to speak to an AI agent programmatically either as a human or uh an AI agent speaking to an AI agent. So that that's using sort of your your communication rails like a HTTPS uh request for example, post request, whatever. Similar when it comes to AI agents. And finally, you need to have a payment layer. you need to actually be

able to pay the AI agent. Uh or not always of course, but there will be times where an AI agent wants to do something for you. Uh and it's going to require a fee. So, you need to be able to pay them. Again, blockchain gives a really really good solution to that. So, for each of those layers, we're going to be covering the technology which is emerging as the as the most prominent as at the moment. On the identity layer, we've got this ERC 804. on the communication layer, Google's A2A, it's now an open- source protocol.

Uh I think it's by the it's actually owned by the Linux Foundation now, but agent to agent is sort of the communication protocol for agents. And then finally for payments, we're going to be looking at Explorer 2. And I'm going to going to get straight into the code uh because my idea is that actually by seeing it in practice, we'll be able to um by seeing it in practice, you'll be able to sort of better understand the actual theory behind it. If you do want to take part and you do want to have a look at this repo which we're going to look into, uh, have a look at that QR code. So, I'll leave this on the screen for a while. Uh, that QR code will take you to the GitHub repository with all of the folders and and all of the source code that we're going to be working on

today. Okay. So, let's now go over to the code. And the first thing that we're going to be looking at is more just on that agentic. Um, uh, we're going to be looking more on that agentic communication side. So, we we're going to be quickly skimming over A2A. Uh, one of the repos, one of the folders that you'll see over here, uh, right at the root is this A2A agent. So, just to sort of really have a quick look at what an actual agentto agent uh, agent looks like, this is basically it. You've got a server where the agent sits on and uh every single AI agent [clears throat]

according to the A2A spec has an agent card. So this agent card you can find all of these um you can find all of these all of these types and all of these APIs from the A2A-JS SDK repository. There's also one for Python as well. But every single agent has this agent card which basically uh tells you what the agent does, where it sits, uh what its skills are, its capabilities, kind of do streaming. Uh streaming is that sort of me that that word by word uh messaging that you get when you're talking to chat GPT for example. It doesn't come out all in one block. It's streamed out. So this tells

you whether the agent is streaming, default input modes and output modes and v various sort of uh v various data points which would allow a client to understand actually how do I deal with this particular AI agent. Uh so there's you you sort of implement this class and then you host it on a in this case we're hosting it on a on an express server. I don't want to go into this into too much detail because we'll cover it actually within the context of the payment stuff. Um, but that's basically the most quick easy way you can spin up an agentto agent compatible server. And at the moment, all that happens is whenever a request gets sent to the AI agent, that's awkward.

That should be hello world. Uh, uh, whenever a um whenever a request gets sent, then all that's happening is it's just responding with this message. So it's very straightforward in this case but typically and what we'll see in the next example is we'll see it being used with uh with an actual AI agent uh for the client the thing which is connecting and sending the request to the agent. Um again you've got sort of helper functions and and types which come out of that A2AJS SDK and all you need to do is you need to create your client which connects towards the the agent card. You pass in the agent card over there and you just

send it a message. And again with an AI agent that would be the sort of prompt essentially. But that's just a really quick coverage on on the 828. Where I want to show it in practice is actually I want to show it in practice uh with regards to the X42 protocol. So let's now take a bit of a step away from agents. We'll just focus on X4. We'll just focus on X42 and actually what it is. X42 is a web-based protocol which makes it very easy to accept crypto payments like stable coins. It makes it very easy to accept crypto payments on existing web servers. So,

say you've got a web server with business logic. And I want to put myself in the screen again because I quite I think it's a bit more engaging. Let me uh let me let me wiggle stuff around. Give me a second. Um, there we go. Sorry about that. So, what X42 does, uh, I just cover it there. What X42 does, it gives you a way to take payments for an API that you may have, business logic, your IP, your your intellectual property, something which is valuable, and it will allow you to wrap it with a with a payment sort of middleware layer. basically meaning whenever someone wants to try and access your resource, your business logic, wheneverbody wants some wants to try and

access it, they need to pay you a an an amount in stable coin. So you could think of it as really great for enabling things like micro payments. And a good example as to where this is being used in the real world is with Cloudflare. Cloudflare are actually one of the main contributors to X42. They're part of the X42 foundation. and Cloudflare they have uh they're they're talking about doing things like paper cruel. So actually going to let's say the Financial Times or or or a very uh high quality news platform and actually going okay either you can buy a subscription or you can actually pay per use pay per request using the X42 protocol. You'll see how

easy it is just now. Um and it'll be potentially another way to generate revenue. It's particularly relevant for AI agents as well, right? Where you can actually have an AI agent crawl these particular data sources, use it for its own training, but pay a fee. Uh so let's take a look at actually what that looks like. Again, I've given sort of the theory, but let's see it in practice. So um for a developer who wants to actually set this up, it's really easy. Um now it doesn't even look it look it looks a bit uglier over here. Uh but if we that's because I've got some agentic 8028 code.

Um but let's actually let me show you what it's like sort of another repo. So I'm going to go to 402-hide. So if I just go over here where it's a bit tidier uh and we go to examples type. This is our Hideera's implementation of X42. You can find it at Hideera-dev X42 Hideera. And if you go to the servers and we'll just go to the express server, you'll see that essentially I I've got that you just take your existing express server with all of these endpoints of get endpoint a uh yeah various get endpoints. This can be post endpoints as well. And all you need to add is this

middleware. So you go to the Explorator Express library, import that middleware, and any one of the endpoints that you have that you want to start receiving pay-per-use payments for, you just specify inside of this middleware. So for example, over here, the get endpoint, the get Hadira-USDC is going to cost uh onetenth of a cent. And with these 15 lines of code, we've now actually gated these two endpoints. Um, and it's really that easy. It's it's very very developer friendly, which is why it's sort of been picking up an adoption.

Now, what we've done is we've set up our A2A server. Uh, as you can see over here, we've got our agent to agent server. This code looks quite similar to the code I was sharing earlier. And um uh lost my train of thought. Sorry about that. So we've got um the agent to agent logic over here and then we're setting it up. Uh so it's sort of living on this express server at the A2A endpoint. This is a post endpoint and we're basically saying, okay, I'm going to use that payment middleware wrapper to wrap the agent uh A2A server and I'm going to say every

time someone interacts with that server, it's going to cost them onetenth of a cent. So, just to sort of recap that, we've uh we're creating an agent to agent protocol server over here. We've got our agent card. We are creating our agent executor and we're configuring it using all of the utility sort of the the helpers that that A2A provide. Uh we're then using this app builder setup routes method to to say okay we're going to register our AI agent at this A2A endpoint. I mean this this could be anything though. This could be um test agent for example. It

can be whatever you want. Um, and then just before it, we're doing this middleware, taking the using the middleware helper function from X402 and saying, okay, anytime somebody wants to post to this A2A endpoint, they're going to need to pay 110%. Um, and with that, we can now go over to a client and actually start interacting with it. So before we do that, I want to give a bit more context around the X42 architecture. So there's another interesting uh player in the X42 architecture which is this facilitator.

And essentially the facilitator helps separate the concerns of the actual blockchain logic and the business logic. So as a engineer, as a developer who's got their own product, you've got your own product, you want to start monetizing it, you don't actually need to really worry about blockchain too much. The only thing that you as a developer need to specify is what the facilitator URL is and where you want the user's payment to go to the the pay the pay to address.

Um, and with that you don't you don't actually need to do any blockchain transactions because essentially what happens is all of that gets outsourced to the facilitator. So the facilitator in our case we're going to run it locally but the facilitator is responsible one for verifying the uh ve verifying the transaction that is generated from the client is actually legitimate and then once that's done it will settle the transaction. So it'll actually execute it. So we've got this facilitator which is responsible for that. Um but I just wanted to sort of mention that facilitator. It's a very important part of that sort of exploratory 2 architecture. It separates that uh separates the actual blockchain

execution on a different server and many people can connect to that same facilitator. Many people can connect to the same one on the client side. Uh we'll just do a quick sort of code. This is in uh uh yeah, for those of you who want to know where the files are for this, uh it's all inside of the X42 folder. And then if you go to examples, TypeScript, you can see we have the Express server, the facilitator, and the Axios client.

And what this Axios client does is um uh it it just simulates the actual querying of the endpoint. So in this case, we're going to be uh we're going to be querying our server which contains the AI agent. So we're querying the server over here. We're using this with payment interceptor helper function from X42 and we're spec we're creating our seriously a Hadira account. Um we've got the RPC request. So this is actually just the request body that gets sent to the server because agent to agent uses RPC protocol. It doesn't just use a

typical REST API. uses RPC and JSON uh JSON um yeah like a JSON RPC request. Um and then we're just yeah we're just posting that JSON RPC request to our endpoint. And then we can see over here we're just sort of passing the logic. Let's see it in action. Let's actually take a look at what this sort of all looks like pieced together. So in each of these uh endpoints, each of these servers I'm sort of running. So I'll go I'll go over it again. Um but I've I have got my facilitator. So I'm going to run pmppmdev to spin up my facilitator.

And obviously I've got some environment variables configured. If you go through the replay, you'll be able to see that uh yourself. Um, I'm going to spin up the server, the the server which has the agent to agent endpoint. And just quickly, what actually is this agent doing? So, if we take a look at our agent, we can see that like in the first example, we've got this agent executor. We've got this execute function, but this time we're actually doing something a bit more meaningful than just responding with some hard-coded text. We're actually invoking an AI agent that we have. Uh, so this AI agent, very straightforward. I mean, it's technically not even an agent, it's just an LLM.

It randomly picks a stock from the NASDAQ exchange and then gives a summary on the company. So, it's very straightforward. Uh, we are taking the user's request, the text that the user sends, the client sends, and then we are generating the response. Uh, and that's what then we're responding back. So, this is what's going to cost onetenth of a cent. Uh and then on the client side, what we're actually sending is we're sending the this question or this this uh prompt, tell me about a stock. Uh so if we we've got the facilitator running, we've got the server running. Now I just need to do a test of running this script at PMPD as well.

And we'll see that the we get a request we get a response from the agent saying agent message uh sure let me randomly select a stock from the NASDAQ exchange docuign given me some information about that and we can see that actually it's also the transactions also been executed successfully. So, if we go over to our if we go over to our um there it is. If we go over to our hash scan, we can see this transaction ID and we've sent one/tenth of a cent to the uh there we go. Yeah. one/10enth of a cent USDC

to this recipient account which was specified as the pay to account. So it's pretty cool. It's pretty cool. Basically what we've done is yeah we've set up an AI agent which is able to receive a payment using the A2A protocol. Uh and a client which also could be an AI agent is able to pay pay it. And this is really powerful. Um, but you might be thinking, what about the trust? Uh, which is sort of what we were alluding to earlier. If these agents are autonomous, obviously this is a very controlled environment where I've got the agent A2A server. I I know that it's

uh I I I know that it's safe to use because I built it. I'm also the client. But what if we're in this futuristic world which probably isn't too far away where AI agents are have got a lot of freedom, a lot of free reign, a lot of control. They can discover other AI agents. There's the they've got the ability to connect. Uh I've got an AI agent which is working on my behalf and it knows everything that I sort of need to do dayto-day. Maybe it's a business agent. It knows exactly when my meetings are. It knows exactly um who I need to speak to. Maybe it starts doing some research on this client. Maybe it goes to this data broker where the my AI agent goes to this data broker agent

which knows which settles data about other people just like sort of what Facebook and that do. I'm I'm totally spitballing here as well. This is a not really thought about this use case before. But my AI agent needs to be able to know that if it pays this AI agent to tell me about the business opportunity or the this talk which I'm going to um my AI agent needs to know that it can trust and that actually this AI agent which it's dealing with is going to provide value and that's where [clears throat] that's where ERC 804 comes in. So ERC804 at its sort of most fundamental

uh at its sort of most fundamental thing, it's just a set of smart contracts. Now I'm going to quickly find this um give me I need to going to dig around quickly for this uh um article. Uh, let me find a very good article which I should have pulled up before. Um, hopefully I can find There we go. I've got it. So, here's a really ah, brilliant.

Um, okay. There we go. So this is a really great article which sort of gives high level obvious to ERC804 what it actually is and as it says over here it's a standard that defines a framework for autonomous agents to identify each other to find evaluate and interact with each other trustlessly. So it's got these three registries. This identity registry, this reputation registry and this validation registry.

And each of these is the composable primitives which a developer is able to then build on top of um to actually create applications that enable agents to trust each other. So the identity as I sort of briefly mentioned earlier uh the identity gives the agent an ID. is actually an NFT and with it it's got this schema which can point towards maybe your agent to agent card if you've got an agent to agent uh agent. Um and then it also has this reputation registry. So essentially we're going to get into this. I'm going to do a quick demo of it, but you can then map reputation onto your AI agent, onto the

identity, so that when I go to use this data broker agent, for example, I can actually look, my agent can actually look at all of the reputation, all of the feedback that's been given to then decide whether it wants to trust it. And then finally, you've got this validation registry. Now this isn't always required. Um but this is essentially I I I like to think of it a bit like the reputation for the reputation. It's just making sure that this reputation which is given to the particular AI agent isn't totally botched. It's not it's not a botched job. It's not fake. The validation actually goes okay is the reputation does the reputation feedback actually cover any carry any weight. Um,

I've not really looked into validation too much, but it's definitely important because it's very easy to just uh totally falsify the reputation uh registry. But as it says over here, the sort of entire uh the entire framework is very unopinionated. It's it's just gives you the primitives to build on top. Um, but let's have a quick look at actually what it looks like. Again, we've got snippets inside of this code repo. So, if you go over to this time, if you go to the A2A, no, sorry, the ERC804JS folder and you go in here, uh, you can see that we've got this Hadira test script.

Test Hadira. Obviously, I've installed everything. I've built everything. Uh, but essentially this test Hadira script, it goes through those steps of registering an agent and then, uh, giving it feedback. so we can sort of see it bit by bit. We'll also run the script. Let's maybe run the script first and then we can uh go through it sort of one by one. So I'm inside of that repo and I'm just running pmppm test that's triggering this uh script to run. So we've got an agent owner which is going to be registering the AI agent uh which is actually the AI agent that we just created.

So we can see for example uh over here we're just setting up our EVM addresses. We are registering our ERC804 client. We're specifying the registries. Hideera we already have our in deployed registries. You can find this on the uh you can find that on the ERC80004 smart contracts on GitHub.

But we're using this ERC80004 client. This comes with a lot of methods that we can use to interact with the registries. We are first of all registering the agent. So what this is doing uh we can have a look at the transaction hash. What this is doing is it's going to be invoking the uh it's going to be calling the identity registry. Oh, surprise. Uh where do I let's put this. So, this is going to be invoking our identity registry over here.

Uh and it's just essentially minting an NFT. That that's all it is. and the owner is the one who actually registers it. So the the account which I've set up this client where it has the uh sign up that's going to be the owner. Now we can then get the agent ID in that response and then what we can do is we can actually set the metadata of our AI agent. So after creating it, we then get this agent ID and with that we can generate the metadata over here which is a uh it's a standardized schema and you'll see that we pass in the

endpoints. So we've got the name, we've got the description, uh we've got the endpoints, it's an A2A endpoint and this just points towards our this just points towards our agent which we've set up. Uh so if we go over to our server, you can see that we have this agent card which is what we deployed earlier on. That's what lives inside of the X42 Hadira repo. Uh and it's specifying all of the trust mechanisms. In our case, it's just reputation, but you can also have further trust mechanisms which relate to the validation part. Um, and importantly inside of this registrations array, we then point back to the agent ID on our identity

registry. This is really important because this makes sure that the agent uh is that's registered on the smart contract is actually the right agent. It's not like someone's just randomly registered an agent which doesn't belong to them. This actually proves that okay this agent does belong to me. Now that's then essentially added to the metadata of this agent ID. That metadata it can be a hosted on a web server. It can be hosted on IPFS. Can really do whatever you want there. Uh there's sort of no no uh must do but we're setting the metadata.

Uh and then yeah once we set the metadata uh we're then testing around the feedback. So I'm going to sort of explain the feedback now going over to our agent uh example which we had over here where essentially what happens with the feedback is when an AI agent or when a client interacts with a server. So now in our case it was over here we had this um we had this script which was acting as the client and it was interacting with this agent to agent server.

When that initially happens what should take place is the AI agent which is on the server the AI agent on the server should authorize the feedback to be given. So, they're going to call this uh create feedback off method, which essentially goes, I'm going to let you, the client who's just spoken to me, I'm going to give you the ability to leave feedback on my reputation registry.

And you can see that it specifies the feedback giver. So, uh it's not just anyone who can give the feedback. It's only the person who's sent the request. So user will send the the client will send the request saying I want to uh pay 5 USDC to to to get your endpoint to get your business logic. And then the server AI agent will go okay I'm going to now give you a authorization to actually leave feedback on my registry. And then with that they'll sign it just again to make sure that it's actually been authorized by them.

And then the feedback client uh the client which is going to give feedback is able to actually give feedback using that feedback signed authorization uh token essentially. So that feedback is is a score of uh zero to 100 and you can also give a feedback URI. So this is quite interesting this feedback UI. It basically allows you to enrich the data that gets given to the AI agent for the on their feedback registry. Um and the ERC804 docs over here it talks about using IPFS.

Uh so here it says you can use um we've got this feedback. So give feedback um which accepts a file URI pointing to an off-chain JSON containing additional information and it's uh hash to guarantee integrity. Now obviously if you're just taking feedback and you're just chucking it and and that feedback lives on a web server which can be which can be changed. You're going to want to obviously hash it so that on the smart contract it has the hash so you can see if someone ever changes it. Well, actually that's been changed because the smart contract has the hash. The hash is

now different. Someone's obviously altered and tampered with it. Uh, but the docs over here, the EIP also mentions that you can use IPFS and in which case IPFS is deterministic. You can't change it. Um, and in that case, you don't need to use the use the hash. Now, IPFS still has its own problems because you need to pin it on IPFS and there's a chance that it gets lost. So actually with this example there's an interesting implementation which uses HCS the Hera consensus service which is onchain and allows you to put the reputation onchain as well. So I thought that's a quite nice little nice to have um and definitely a great use case for the Hideera consensus service where you can have this uh onchain immutable thing

will ne that will never get lost and you can use that for the feedback but that's essentially it and then you can obviously read the feedback the feedback will get indexed so you can sort of look at it and and then use it as part of your discovery process but that's sort of a quick summary in terms of how the ERC80004 ties in and I think you'll be able to understand why exactly is it important? Well, yeah, if you're going to be having AI agents that are um AI agents which are interacting with each other, they need to have a safe way to to trust each other essentially.

But that's it from me. I've gone on for a bit. I'm going to go back over here. So, I think final sort of call to action, uh join the Discord. Um really, yeah, we're going to be really active in in sort of helping out the Discord. would love to see how you are using agent to agent x42804 to build some of the most disruptive uh some of the most disruptive sort of applications that are going to be going to be around. Uh it's really quite an exciting time and and all of these pieces are coming together and and merging very well. So without further ado, have a great day everyone. Take care.

Related talks