Making APIs easier for AI: DIN Integrates Coinbase's x402 Payment protocol

TL;DR

DIN’s co-founder, EG Galano, recently presented at CODE NYC Coinbase Hackathon in Brooklyn on Aug 9 talking about our implementation of x402 for DIN endpoints. For those who need a refresher, x402 is an internet-native payment protocol that was developed by Coinbase for fast, cheap, and AI-friendly payments. Our code calling this implementation is available for review:

Small, but mighty 100 hackers building with Coinbase Developer Program tools
Small, but mighty 100 hackers building with Coinbase Developer Program tools

Setting the Stage

EG’s talk during the 1-hour workshop covers our narrative of why we built a demo with x402 in order to enable AI Agents access to web3 networks paid with micro-transactions.

Technology makes things easier
Technology makes things easier

Through this digital era, technology has been a driving force that has made our lives easier and lowered the barrier of entry with conveniences.


Technology's added features
Technology's added features

The disruption we see with major tech like cryptocurrency and AIs have some key features.

  • Cryptocurrency has an infrastructure that provides a transparent database with a store of value of assets traded on different exchanges

  • Blockchain as the underlying technology has this shared storage mechanism driven by the economics of certain cryptocurrencies

  • Large Language Models created with generative AI has made all of the internet a conversational place where we no longer have to do the searching and creating ourselves

  • Agentic AI is connected to different apps so they can complete tasks like a personal assistant. Maybe you want to make a reservation to a restaurant and your personalized AI will call a restaurant’s AI to negotiate the best times and then share the log of the conversation.

  • And lastly the digital twin AI is the next step we’ve seen where your phone can have a local digital representation of your data and your interface with this AI will be the training that has it learn more and more about you.


Technology disrupting fintech
Technology disrupting fintech

From these technologies, we’ve seen a few interesting use cases that intersect with the fintech world.

  • Cryptocurrency in itself has a global emerging market with a huge shift towards stablecoin regulation and staking infrastructure

  • Blockchains are accessed through wallets that can be created without unified SaaS platforms. These wallets can access multiple databases and aggregate cryptocurrency and other functions.

  • Generative AI now gives you full director control of content creation. Some people will use it to create AI slop, while others will actually build useful novel ideas and pursue their startups

  • Agentic AI interactions is what’s coming next where we may see a personalized AI decide on how to trade and balance a portfolio

  • The digital twin AI will likely lead to more data aggregation and algorithms for making personalized decisions. Maybe this could include sending funds to a friend after splitting a lunch and then asking for some authentication for the payment.


Plaid-like opportunity connecting AI Agents to capital
Plaid-like opportunity connecting AI Agents to capital

In a future where we might see more actions coming from AI agents (like bots in a social media platform), there will be a service that can easily connect and aggregate with authentication from different financial institutions. The AI Agent may want access to capital.


AI Agent's needs for access to verifiable trusted layers
AI Agent's needs for access to verifiable trusted layers

We think this connected AIs will need blockchains and for its citizenship across identity, communities, and agreements. A network layer can support this by having a separately verifiable source of services for interacting with these AIs.


What is DIN?
What is DIN?

Enter DIN… we’re not just looking at decentralized RPC< but we’re building out a marketplace for infrastructure providers to complete on price and quality of service.


"/TRAIN" addition to the READ, WRITE, OWN narrative
"/TRAIN" addition to the READ, WRITE, OWN narrative

If you think of the next phase in the Web3, the AI Agents will start to take over for individuals. The new Web + AI will be an age of personalized digital twin Training where you may enjoy private training of your algorithms rather than the public publishing of your blogs.


Web3 Infrastructure's problem with traditional finance rails
Web3 Infrastructure's problem with traditional finance rails

The dirty little secret with Web3 infrastructure is that we still use traditional financial rails for paying our infrastructure bills and ever-so-important devops team members.


DIN's mission towards adopting Web3 Financial rails
DIN's mission towards adopting Web3 Financial rails

Where we want to get to is a better on-chain payment system that covers Agentic AI integration, but also can be used by B2B providers to better manage their web3 treasury.


DIN Ecosystem mapping
DIN Ecosystem mapping

The way DIN works is by allowing for any customer to access the API Marketplace and route to our DIN API Providers. The Payments piece creates a streaming of payments, but also a netting mechanism to keep tokens within the ecosystem to subsidize the costs for running more network bandwidth and accessing a larger breadth of networks.


DIN x402 example implementation with Ethereum, Base, and Blast networks
DIN x402 example implementation with Ethereum, Base, and Blast networks

What we’ve built to showcase this is a x402 example in Go:

This constructs the x402-buyer to call the DIN request and pay directly to the DIN Treasury (x402-seller) for Ethereum, Base, and Blast networks.


Implementing x402 with API Access in an AI Agent workflow
Implementing x402 with API Access in an AI Agent workflow

If this were extended to an AI Agent workflow, the AI Agent itself could host its own Eliza OS or other wallet to manage and sign transactions connected to DIN as an MCP. This MCP tooling would allow for the AI Agent Orchestrator to make the best choice of collecting and managing data.


The “headless gateway” concept we’ve created here allows for AI Interaction and the following use cases:

  • As an AI Agent, I can call a DIN endpoint (for Ethereum, Base, and Blast), pay with a token (USDC), and receive relevant JSON RPC information for my response.

  • As an AI Agent, I can receive additional information on my DIN usage (e.g. receipts of TXs, calls with the endpoint). This can be a redirect of user to a DIN Web App for monitoring.

  • As an AI Agent, I can share additional information (e.g. website, code, docs). This can be a terminal-like response function.

This could effectively be a terminal interface with your AI Agent conducting additional memory context for completing your tasks.


DIN x402 features list
DIN x402 features list

We’ve got a whole list of additional features we can add to this. From Breadth to Depth, we can see:

  • Addition of more endpoints

  • Connecting DIN with different workflows and agentic tools

  • Adding gateway integration with Infura and generic for other DIN Providers

  • Adding this payment as an option for B2B payments with Node Providers

  • More token types for payment of access

  • Usage of DIN for AI Networks, Marketplace, AVS, and Treasury


AI Agent Orchestration within inbound and outbound connections
AI Agent Orchestration within inbound and outbound connections

To round out this idea, we’ve found that Business to AI integration will be a new line of business as AI Agents become more mature. In order to connect AI to more APIs and tools, we’ll need to consider the discovery, rate limiting, specifications, workflows, documentation, and structured outputs within the web3 ecosystem.


DIN Building towards a permissionless future
DIN Building towards a permissionless future

DIN continues our journey of progressive decentralization by partnering with the right players for GTM on our ideas. We’re opening to more community contributions and finding new ways to approach the deployment of DIN itself without reinventing the wheel with another dedicated blockchain network or just launching a simple utility token. We are deliberate in our methodology of building to cover the needs of the many web3 infrastructure providers powering your cryptocurrency access and fintech experimentation.


Learn more about DIN at @DINBuild and https://din.build . Follow EG’s talks on YouTube:

Subscribe to Decentralized Infrastructure Network (DIN)
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.