New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

0G SDK Walkthrough I Udhaykumar Balakrishnan

ETHGlobalThu, Oct 9, 2025, 12:00 AM

Udhaykumar Balakrishnan presents a hands-on walkthrough of the 0G SDK, showing developers how to integrate decentralized storage and compute into their applications. This tutorial covers both the 0G Storage SDK for uploading and downloading files across a global decentralized network, and the 0G Compute SDK for running AI inference on a decentralized marketplace of models. The session begins with an introduction to 0G Storage, explaining how it provides fast, secure, horizontally scalable storage designed for AI workloads. Using the TypeScript starter kit, Udhaykumar demonstrates how to set up the SDK, configure RPCs and private keys, upload files with a root hash identifier, and download them from the network. Developers learn how the SDK handles chunking, Merkle trees, and verifiability checks seamlessly. In the second half, the workshop dives into 0G Compute, a decentralized AI marketplace where providers can list models and users can query them without API keys or subscriptions. Udhaykumar walks through the starter kit, shows how to set up a broker and ledger, list available models like Llama 3.3 and DeepSeek, and run inference queries with verifiable results. The tutorial also demonstrates balance checks, funding, and refunds directly through the SDK. With clear code examples, live demos, and references to documentation and starter kits, this walkthrough provides everything developers need to start building dApps and AI-powered projects on 0G. 00:02 Introduction to 0G SDK 00:49 What is 0G Storage? Decentralized storage overview 01:13 Developer hub & SDK options (Go & TypeScript) 01:34 Cloning and using the TypeScript starter kit 02:27 Client setup with RPCs, signer & indexer 02:52 ZGFile for uploads & indexing explained 03:41 Uploading files with root hash identifiers 04:26 Downloading & verifying files 04:47 Environment setup: RPCs, private keys & tokens 05:16 Running the server & Swagger endpoints 05:44 Upload demo with example file (panda image) 06:04 Using root hash for file retrieval 06:50 File successfully uploaded & downloaded 07:22 Transition to 0G Compute SDK 07:46 What is 0G Compute? Decentralized AI marketplace 08:07 SDK setup & starter kit walkthrough 08:49 Installing dependencies & initializing broker 09:33 Creating ledger accounts & funding 09:55 Listing available AI services (Llama 3.3, DeepSeek) 10:18 Acknowledging providers & retrieving metadata 10:41 Running inference queries with headers & endpoints 11:02 Verifying responses & fee settlement 11:42 Live demo of compute SDK & Swagger endpoints 12:30 Listing AI services & provider addresses 13:36 Running inference with DeepSeek model 13:56 Closing: links, docs & happy building _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 🇮🇳 *ETHGlobal New Delhi* This workshop is specifically for ETHGlobal New Delhi, a 3-day hackathon held September 19-21 at the India International Convention & Expo Centre, bringing together the most skilled web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem! Watch the full ETHGlobal New Delhi 2025 playlist here: https://www.youtube.com/playlist?list=PLXzKMXK2aHh7zCFW3hBqatZ18rQaYeEJL _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ✅ *Follow 0g* X: https://x.com/0G_labs ✅ *Follow ETHGlobal* X: https://x.com/ETHGlobal​ Warpcast: https://warpcast.com/ethglobal Website: https://ethglobal.com YouTube: https://www.youtube.com/c/ETHGlobal _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _Are you interested in Ethereum development and entrepreneurship?_ 👉 Sign up for the next ETHGlobal event: https://ethglobal.com/events 🎁 Get exclusive access and perks with ETHGlobal Plus! https://ethglobal.com/plus 📣 Want us to throw an event in your city? Tell us where! https://ethglobal.com/city

Transcript

[Music] Hi everyone. Today let me show you how easy it is to integrate ZeroG storage into your existing application. Let's walk through the code and get familiarized about uploading and downloading processes using our starter kits. The links are in the description. For starters, zerog storage is like a decentralized storage network where your data is stored across different nodes across the globe.

It is fast, simple, secure, and also horizontally scalable that provides the power to handle AI workloads that needs faster data output. Let's just dive into the code and check out how to integrate the zero storage SDK. For that, we need to head on to the docs.zog.ai.

And under this developer hub, you can able to find zerog storage. We do have SDKs and CLIs. If your use case needs CLI and if you are using a programming language that doesn't support the SDK, you can feel free to check into the CLA section. Now we are going to look into the SDKs. We are providing SDKs for Go and TypeScript.

Both of them we do have the starter kits. If you are preferring Go then please do check out Go starter kit. Now we are going to look into the TypeScript starter kit. When it comes to the starter kits, we just need to clone this. All the error handlings and the type checks, everything has been handled within the starter kits.

Since I have already cloned it, I'll be opening that for you. So, here is the folder where I cloned my repo. So, it does have two branches. One is a master branch and another one is CLI version branch. One version has swagger documentation and rest API implementation.

If you prefer to use it in a rest api way, you can check it out. Or else if you want it in a CLA version and that that is the need for your application means you can feel free to check it out to the CLA version of the branch. So currently we are in the master branch that means we are in the swag swagger documentation branch. Let's just walk through some of the code. First the client setup starts with the importing of the zerog SDK.

Once you import you will have two type things. One is ZG file. This one is specifically to import and upload a file and this will help you calculate the gas cost and every stuff on the way. And this is the indexer that will help you chunk the file and store it in different nodes across the globe. So you don't need to deal with it.

The SDK already has all the stuffs that are emboded in it. and ethers is the common library that if you are using the wallet and the private key stuffs. So first you need to add the RPC URLs and the private key things for creating the serer and once you need to add the indexer RPC into the indexer then that's it you have already set up the zerog storage SDK now your only thing to do is upload and download for uploading you can use the zg file to import any file from a path once it is imported it have already added functions to create Merkel tree and calculate root hash before the uploading. So you can use that function to create the tree and if you want to upload that file you just need to call upload function with that file and the RPC URL and the signer that you have created previously. Once it is done you will get a root hash.

So this root hash will serve as a identifier for the file across the zerog storage. So whatever the file that you upload has unique root hash that will serve as an identifier. Once it is uploaded if you want to download a file you will be passing the same root hash on the download function and the output path that you want to store. And if you want to verify the file in the decentralized network you can also do that by passing true here. So this will verify the file before the downloading.

Let's see it in action. So for that we have already cloned the repo and we just need to start by installing the dependencies. Yeah, now the dependencies has been installed. Once the dependencies are added, we need to go into the env example file. If you want to change the port, feel free to change it.

This is the RPC and we do support quick third web and anchor as third party RPCs. and add your private key and this key needs to have some of the zerog tokens. So please check the faucet to get more tokens for yourself and once it is added you are good to go. Then let's start the server. So now we get the swaggery endpoint.

So once we open we'll have two endpoints. One is for upload and another one is for download. Let's test the upload one with an image. So we already have a cute panda that is lying here in our desktop. Let's just try him.

So the uploading part will include a shanking process through the intexer and also a transaction committing on the zerog chain. This all will be handled with the help of zero storage SDK. Now if you see all the things has been completed and it has reverted with a root hash and also a transaction as if you check this transaction as on storage scan or a chain scan we can able to get the details of the file. So now this root hash is the identifier of the file. So we can use this root hash anytime to download this file.

Let me use this root hash to check it out whether the file is exist on the cloud. So yeah, there it is. It is available for download. So here is the downloaded file. Since it is not named, it is showing like this.

Let me name it like cloud panda.png. Yeah, here if you can see this is the uploaded one and the downloaded one. So that's it. This is how easy it is to integrate the zerog storage into your application and build more stuff with zero storage.

So the links are in the description. For more advanced usage, please do check out the docs.zog.ai. Happy building.

[Music] Hi everyone, today let me show you how we are going to integrate decentralized inference using the zerog compute. Let me walk you through how to connect the zerog comput SDK and also listing the models that are available in the decentralized space and using those models. Let's get started. Before that, a quick intro. ZeroG compute is a decentralized marketplace for AI services.

Think of it like Uber for AI services where provider can list their models and user can use it. Here no API keys, no subscription, no hidden charges. Whatever you use, you will be paying for it. So it is all paper use. Let's dive into the code.

To start with, head on to the docs.zero.ai and under this developer hub, you can find the zerog compute. So under this we do have two sections. One is for developers.

We do have SDKs and fine-tuning CLIs. And this one is for providers. If you want to provide your model as a service, you can use this. Currently we are going to explore this SDK. So to use this SDK, we have already created a starter kit that will be useful for you to start with.

Let's explore the starter kit. In this starter kit, everything is already integrated like type checking and error handling. You can just clone it and get started. I have already cloned this repo. Let me open that for you.

If you have already visited our storage starter kit video like that, we'll also have two separate branches in this. One branch is for the rest API and another one branch is for the CLA version. Right now we are going to explore the API version of the branch. So to get started with let's walk through the code to get better understanding of ZeroG comput SDK. To start with, we are going to install the dependencies that it needs.

Starting from the SDK and the types it requires and cryptojs as a dependencies. Once everything is installed, we are going to start by importing the RPC and the private keys that it is needed. Once the broker is initiated, we are going to use this broker throughout our code for accessing the inferences. We need to create a ledger account within the broker to access the services. This add ledger function will handle that for you.

If the account is not there, it will automatically create the account and fund the account. If the account is there, it will trace the account and it will fund it for you. Once the account is ready, you can always check the balance using this get ledger function. Now you can list the services that are available on the 0eroG marketplace. Currently, we do have Llama 3.

3 and deepc car 1 that is officially provided by Zerog. After selecting a model, we just need to copy their provider address. So this will be the identity to access those inferences. Before accessing the model, we need to acknowledge the provider. This step helps you in the process of verifiability.

After the successful acknowledgement of the model, we'll be getting the metadatas like endpoint and the model using the get service metadata function. Once we got the metadatas, we'll be getting the headers. These headers will act as the authentication. So make sure to call this before every request that you are making to the LLMs. Once we got the headers and the endpoint, we can interact with the models whether using the fetch API or using the open SDK.

We just need to pass the endpoint and the headers for the authentication and your prompt. You will get the completions. After getting the result from models, you can verify your response using the process response. This will help you verify the service and whether it is valid or not. The fee settlement will be handled by the SDK in the background.

Anytime if you want to get the balance, you can use this get ledger to get your balance. If you want to refund the balance from the ledger back to your wallet, you can always use the request refund method that is retrieve fund to get your balances back to your wallet. Now let's see the compute SDK in action. To start with, we are building this project and we are going to start this here. If you can see, we already do have balances.

We are going to open the swagger documentation. Here we do have different endpoints. The deposit is to deposit the amount to the ledger and the info endpoint is to get the balance and other details like inferences that previously made and refund endpoint it is to get the unused fund back to your wallet. List AI services will list all the service provider that are available and the query endpoint is the most important where you can give the service provider address and the query that you need to perform. This will give you the results from the LLM with the process response.

Let me start by testing the list. Here we are. We got the deepseek and llama that is available on the service marketplace. Let's use deepseek to test out by passing the provider address [Music] Yeah, here we got the answer and you can able to see it is valid via the Eml is the verifiability layer that is giving this result. That's it.

We have integrated the compute SDK. That's how easy it is to integrate the comput SDK. For more advanced use cases like fine-tuning, please do check out the docs.0g.ai.

Check out the documentation and the starter kit link in the description. Happy building. [Music]

Automatic transcript — names and jargon may be misspelled.