Chain SDK

Draft

Motivation

Integrations are a key part of Akash’s ecosystem growth strategy. In order for integrations to happen quicker Akash needs a feature rich and easy to use library for both blockchain nodes and provider nodes.

Background

Right now interacting with the blockchain and the provider is arduous for someone who is not deeply involved with the core team. The reasons for this are primarily because there are a mix of different implementations for various things as noted here:

  • Blockchain nodes are built using CosmosSDK.
  • Queries are done via a pure grpc service on top of protobuf.
  • Transactions are done via RPC servers but the wire encoding also uses protobuf
  • Provider nodes currently have a mix of GRPC server + protobuf and REST handlers for some of the mutations which are going to be rewritten to GRPC methods as well (see akash-network/support#191)

Scope of Work

Investigate and implement chain SDK which supports:

  • blockchain nodes API
  • provider nodes API
  • cosmosSDK built-in function (e.g., getting last block)

Additionally, this SDK should have:

All changes needs to be done in https://github.com/akash-network/akash-api/tree/sdk-47 (sdk-47 branch). Library should have the best possible typescript support in order to make it super-easy to use with IDE. Also it should be possible to use in browser, so it needs to be bundle size wise.

Additional notes

api/grpc

import { ChainSDK } from "@akashnetwork/chain-sdk/chain-sdk"
// Using the sdk instance
const chainSdk = new ChainSDK({
rest: "https://api.akashnet.net",
rpc: "https://rpc.akashnet.net"
});
// Querying data from api or grpc with typed parameters
// https://api.akashnet.net/akash/deployment/v1beta3/deployments/info?id.owner=akash1234&id.dseq=1234;
const response = await axios.get(chainSdk.rest.deployments.info({ owner: "akash1234", dseq: "1234" }));
const deployment = response.data.deployment; // Typed response
// Potential grpc usage
const response = await chainSdk.grpc.deployments.info({ owner: "akash1234", dseq: "1234" });

protobuf

// Importing the protobuf types
import { MsgCreateBid } from "@akashnetwork/chain-sdk/akash/market/v1beta4";

certificates

// Certificate utils
import { certificateManager } from "@akashnetwork/chain-sdk/certificate";
const { cert: crtpem, publicKey: pubpem, privateKey: encryptedKey } = certificateManager.generatePEM(address);

sdl

import { SDL, v2Sdl, NetworkId } from "@akashnetwork/chain-sdk/sdl";
export function getSdl(yamlJson: string | v2Sdl, networkType: NetworkType, networkId: NetworkId) {
return isValidString(yamlJson) ? SDL.fromString(yamlJson, networkType, networkId) : new SDL(yamlJson, networkType, networkId);
}

Estimated completion: 9/15/2025

Created: 1/10/2025

Last Updated: 7/30/2025

Category: Interface

Status: Draft

Experience the Supercloud.