Web3 & Generative NFT Programming Articles

This publication features articles about web3, crypto, blockchain, 10k generative NFT sets, and other tech. By Jim Dee of GenerativeNFTs.io  —  Jim@GenerativeNFTs.io

Member-only story

Enhancing Coinbase AgentKit with Hex Data Transfers Using Zod and Ethers.js for a New Formal Tool

Refining my previous post about on-chain Ethscription-style NFTs via the Coinbase AgentKit

Image by Midjourney AI. Also, incidentally, this looks like my dog, Lupin!

A few days back, I explored adding hex data to Ethereum transactions via Coinbase AgentKit. (That article is here.) While functional, my initial approach relied on rigid prompt parsing. Today, I’ll demonstrate how to implement this feature more seamlessly via the LLM using Zod, a schema validation library, and the AgentKit’s tool-based architecture.

With a surprisingly low amount of refactoring, I was able to implement this same functionality as a new “tool” in the AgentKit — which is the more formal and recommended approach of doing this. So, I wanted to talk about that today briefly.

Why Zod Matters

Mainly, I was missing Zod, which ensures that all input data conforms to a predefined schema, combining TypeScript’s compile-time safety with runtime validation. For LLM-driven applications, this eliminates ambiguities, ensuring robust and predictable tool execution. That is to say, using Zod literally allows AgentKit to interact with the LLM. (I’ll touch on this a bit more, below.)

--

--

Web3 & Generative NFT Programming Articles
Web3 & Generative NFT Programming Articles

Published in Web3 & Generative NFT Programming Articles

This publication features articles about web3, crypto, blockchain, 10k generative NFT sets, and other tech. By Jim Dee of GenerativeNFTs.io  —  Jim@GenerativeNFTs.io

Jim Dee — From Blockchain to Bookshelves.
Jim Dee — From Blockchain to Bookshelves.

No responses yet