Sui (SUI)

Sui is a Layer 1 blockchain built by Mysten Labs, designed from the ground up for low-latency, high-throughput applications. It uses the Move programming language — a Rust-based, asset-oriented smart contract language with built-in safety guarantees — and an object-centric data model where every on-chain entity is an object with ownership properties.

The network achieves sub-second finality (~400ms average) through Mysticeti consensus (which evolved from Narwhal and Bullshark) and processes independent transactions in parallel, with a theoretical throughput of 100,000+ TPS.

Sui's RPC surface is built around gRPC with Protocol Buffers — strongly typed, type-safe, bandwidth-efficient, and supporting server-side streaming for real-time data delivery. Methods are organized into seven services: LedgerService, StateService, TransactionExecutionService, MovePackageService, NameService, SignatureVerificationService, and SubscriptionService.

Key Features

  • gRPC Native: Strongly typed, Protocol Buffers-based RPC with automatic client code generation for TypeScript, Go, Rust, Python, and more — significantly faster and lighter than JSON-RPC
  • Object-Centric Model: Everything on Sui is an object with explicit ownership — enables parallel transaction execution for independent operations
  • Move Programming Language: Rust-based smart contract language with linear types, resource safety, and verifier checks built into the toolchain
  • Mysticeti Consensus: Sub-second finality (~400ms average) via the latest evolution of Narwhal-Bullshark DAG-based consensus
  • Parallel Transaction Execution: Transactions that touch disjoint objects execute in parallel — horizontal throughput scaling
  • SUI Native Token: 9 decimals — smallest unit MIST. Used for gas, staking, and governance
  • Sponsored Transactions: Gas payment abstraction — third parties can pay gas on behalf of users for better UX
  • SuiNS: Native name service for human-readable addresses (example.sui resolves to 0x...)
  • zkLogin: Native account abstraction using OAuth credentials (Google, Apple, Facebook, etc.) with zero-knowledge proofs
  • Dynamic NFTs: Native support for evolving, composable digital assets through Move's resource model
  • Field Masks: gRPC read_mask parameter lets clients request only the fields they need — major bandwidth and latency win for indexers and explorers
  • Server-Side Streaming: SubscribeCheckpoints provides real-time checkpoint updates over a single long-lived gRPC stream — replaces the deprecated JSON-RPC WebSocket subscriptions

TECHNICAL DISCLAIMER: AUTHORITATIVE gRPC SPECIFICATION

GetBlock’s Sui API reference documentation is provided exclusively for informational purposes and to optimize the developer experience. The canonical and normative specification for the Sui gRPC interface — including service definitions, message types, enums, and scalar types — is maintained by Mysten Labs and the Sui Foundation and published at docs.sui.io/references/fullnode-protocol. The official .proto source files are hosted at github.com/MystenLabs/sui-apis. For Move language details, the object model, Mysticeti consensus, and SDK references, consult the official Sui documentation.

JSON-RPC IS DEPRECATED — SUNSET END OF JULY 2026

Sui's JSON-RPC interface is being deprecated and will be fully deactivated at the end of July 2026, in line with the Sui Foundation's network-wide deprecation timeline. Migrate existing integrations to gRPC (recommended for indexers and backend services) or GraphQL (recommended for frontends and analytics). GetBlock continues to support JSON-RPC throughout the transition for compatibility, but new integrations should target gRPC directly. This documentation focuses exclusively on the gRPC API.

For JSON-RPC method mappings, decision criteria, and common migration gotchas, see the official JSON-RPC Migration Guide.

Network Information

PropertyValue
Network NameSui Mainnet
Chain ID101 (mainnet)
Native CurrencySUI
Decimals9 (1 SUI = 1,000,000,000 MIST)
Block Time / Checkpoint~400 ms average finality (Mysticeti consensus)
ConsensusMysticeti (DAG-based BFT, single-slot finality)
VMMove (Rust-based smart contract language)
Data ModelObject-centric (not account-based)
Address Format32-byte hex 0x... (different from Ethereum's 20-byte)
Block Explorersuiscan.xyz, suivision.xyz
ProtocolgRPC with Protocol Buffers (HTTP/2) — gRPC-Web also supported
Port443 (TLS)

Base URL

All Sui gRPC methods follow the pattern:

bashhttps://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/sui.rpc.v2.<ServiceName>/<MethodName>

For example, to call GetServiceInfo on the LedgerService:

bashhttps://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/sui.rpc.v2.LedgerService/GetServiceInfo
bashhttps://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/
bashhttps://shared.us-east-1.getblock.io/<ACCESS-TOKEN>/

For real-time SubscribeCheckpoints streaming, the same base URL is used over the same gRPC connection — Sui's subscription API is a server-side streaming RPC, not a WebSocket subscription.

Supported Networks

NetworkgRPCFrankfurt, GermanyNew York, USA
Mainnet✅✅✅

Quickstart

In this section, you will learn how to make your first gRPC call against Sui mainnet using grpcurl — the standard CLI tool for gRPC, which works against the official Sui proto files. You can also use generated TypeScript / Python / Rust clients (see the SDK Integration section on every endpoint page).

Before you begin, you must have installed:

  1. Clone the Sui proto files

    bashgit clone https://github.com/MystenLabs/sui-apis.git
    cd sui-apis
  2. Make your first gRPC call

    bashgrpcurl \
      -import-path proto \
      -proto sui/rpc/v2/ledger_service.proto \
      -H "x-grpc-web: 1" \
      -d '{}' \
      shared.eu-central-1.getblock.io/<ACCESS-TOKEN> \
      sui.rpc.v2.LedgerService/GetServiceInfo

    Replace <ACCESS-TOKEN> with your actual GetBlock access token.

  3. Expected response

    json{
      "chain_id": "4btiuiMPvEENsttpZC7CZ53DruC3MAgfznDbASZ7DR6S",
      "chain": "mainnet",
      "epoch": "1084",
      "checkpoint_height": "260411497",
      "timestamp": {
        "seconds": "1775050511",
        "nanos": 19000000
      },
      "lowest_available_checkpoint": "259896745",
      "lowest_available_checkpoint_objects": "259896745",
      "server": "sui-node/1.68.1-3c0f387ebb40"
    }

    chain: "mainnet" confirms you are connected to Sui mainnet. The checkpoint_height is the current chain tip.

  1. Setup project

    bashmkdir sui-grpc-quickstart
    cd sui-grpc-quickstart
    npm init --yes
    npm install @grpc/grpc-js @grpc/proto-loader
    npm install -D typescript ts-node @types/node
    npx tsc --init
  2. Download proto files

    bashgit clone https://github.com/MystenLabs/sui-apis.git protos
  3. Create index.ts

    index.ts

    typescriptimport * as grpc from '@grpc/grpc-js';
    import * as protoLoader from '@grpc/proto-loader';
    import * as path from 'path';
    
    const PROTO_PATH = path.join(__dirname, 'protos/proto/sui/rpc/v2/ledger_service.proto');
    const ACCESS_TOKEN = '<ACCESS-TOKEN>';
    
    const packageDef = protoLoader.loadSync(PROTO_PATH, {
        includeDirs: [path.join(__dirname, 'protos/proto')],
        keepCase: true,
        longs: String,
        enums: String,
        defaults: true,
    });
    
    const proto = grpc.loadPackageDefinition(packageDef) as any;
    const LedgerService = proto.sui.rpc.v2.LedgerService;
    
    // Use credentials with metadata for the access token
    const metadata = new grpc.Metadata();
    metadata.add('authorization', `Bearer ${ACCESS_TOKEN}`);
    
    const client = new LedgerService(
        'shared.eu-central-1.getblock.io:443',
        grpc.credentials.createSsl()
    );
    
    client.GetServiceInfo({}, metadata, (err: any, response: any) => {
        if (err) {
            console.error('Error:', err);
            return;
        }
        console.log('Service Info:', JSON.stringify(response, null, 2));
    });

    Replace <ACCESS-TOKEN> with your actual access token from GetBlock.

  4. Run

    bashnpx ts-node index.ts

More Examples

Get Balance (StateService)

To query balances, use the StateService:

getBalance.ts

typescriptimport * as https from 'https';
import * as path from 'path';
import * as protobuf from 'protobufjs';

const ACCESS_TOKEN = "<ACCESS_TOKEN>";
const HOST = "shared.eu-central-1.getblock.io";
const PROTO_ROOT = path.join(__dirname, 'protos/proto');

// Encode request + wrap in gRPC-Web 5-byte frame, then POST over HTTPS
function grpcWebCall(
    root: protobuf.Root,
    servicePath: string,
    method: string,
    requestType: string,
    responseType: string,
    requestData: object
): Promise<object> {
    const ReqType = root.lookupType(requestType);
    const ResType = root.lookupType(responseType);

    const encoded = ReqType.encode(ReqType.create(requestData)).finish();

    // gRPC-Web frame: 1-byte flags (0 = no compression) + 4-byte big-endian length + body
    const frame = Buffer.alloc(5 + encoded.length);
    frame.writeUInt8(0, 0);
    frame.writeUInt32BE(encoded.length, 1);
    Buffer.from(encoded).copy(frame, 5);

    return new Promise((resolve, reject) => {
        const req = https.request(
            {
                hostname: HOST,
                port: 443,
                path: `/${ACCESS_TOKEN}/${servicePath}/${method}`,
                method: 'POST',
                headers: {
                    'content-type': 'application/grpc-web+proto',
                    'x-grpc-web': '1',
                    'accept': 'application/grpc-web+proto',
                    'content-length': frame.length,
                },
            },
            (res) => {
                console.log('HTTP status  :', res.statusCode);
                console.log('Content-Type :', res.headers['content-type']);

                const chunks: Buffer[] = [];
                res.on('data', (chunk: Buffer) => chunks.push(chunk));
                res.on('end', () => {
                    const data = Buffer.concat(chunks);
                    if (data.length < 5) {
                        return reject(new Error(`Short response: ${data.toString('hex')}`));
                    }

                    const flags = data.readUInt8(0);
                    const length = data.readUInt32BE(1);

                    // Trailer frame (flags bit 7 set) contains gRPC status metadata
                    if (flags & 0x80) {
                        const trailer = data.slice(5).toString();
                        return reject(new Error(`gRPC-Web error trailer: ${trailer}`));
                    }

                    const responseBytes = data.slice(5, 5 + length);
                    const response = ResType.decode(responseBytes);
                    resolve(ResType.toObject(response, { longs: String, enums: String, defaults: true }));
                });
            }
        );

        req.on('error', reject);
        req.write(frame);
        req.end();
    });
}

async function main() {
    const root = new protobuf.Root();
    root.resolvePath = (_origin: string, target: string) =>
        target.startsWith('/') ? target : path.join(PROTO_ROOT, target);
    await root.load(path.join(PROTO_ROOT, 'sui/rpc/v2/ledger_service.proto'), { keepCase: true });

    console.log('Fetching service info...\n');
    const info = await grpcWebCall(
        root,
        'sui.rpc.v2.LedgerService',
        'GetServiceInfo',
        'sui.rpc.v2.GetServiceInfoRequest',
        'sui.rpc.v2.GetServiceInfoResponse',
        {}
    );
    console.log('Service Info:', JSON.stringify(info, null, 2));
}

main().catch(console.error);
bashFetching SUI balance...

Balance: {
  "balance": {
    "coin_type": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
    "balance": "1035000074",
    "coin_balance": "1035000074"
  }
}

Available API Methods

Sui's gRPC API is organized into 7 services with a total of 22 methods. Field masks (read_mask: {paths: [...]}) let you request only specific response fields — use ["*"] for all fields.

LedgerService (7 methods)

Core blockchain queries — service info, objects, transactions, checkpoints, epochs.

MethodDescription
GetServiceInfoReturns node info — chain ID, epoch, checkpoint height
GetObjectReturns object data by object ID
BatchGetObjectsReturns multiple objects by IDs in a single call
GetTransactionReturns a transaction by its digest
BatchGetTransactionsReturns multiple transactions in a single call
GetCheckpointReturns a checkpoint by sequence number or digest
GetEpochReturns information about a specific epoch

StateService (5 methods)

Account state and balance queries — owned objects, dynamic fields, coin balances.

MethodDescription
ListDynamicFieldsReturns dynamic fields of a parent object
ListOwnedObjectsReturns objects owned by an address
GetCoinInfoReturns coin metadata (symbol, decimals, supply)
GetBalanceReturns balance for an address and a specific coin type
ListBalancesReturns all coin balances for an address

TransactionExecutionService (2 methods)

Transaction submission and simulation.

MethodDescription
ExecuteTransactionSubmits and executes a signed transaction
SimulateTransactionDry-runs a transaction without execution (for cost estimation and pre-flight checks)

MovePackageService (4 methods)

Introspection of Move packages and their types/functions.

MethodDescription
GetPackageReturns Move package metadata and modules
GetDatatypeReturns the definition of a Move struct or enum
GetFunctionReturns the signature of a Move function
ListPackageVersionsReturns all versions of a package (for upgrade tracking)

NameService (2 methods)

SuiNS (Sui Name Service) — human-readable addresses.

MethodDescription
LookupNameResolves a SuiNS name (e.g. example.sui) to an address
ReverseLookupNameResolves an address to its primary SuiNS name

SignatureVerificationService (1 method)

MethodDescription
VerifySignatureVerifies a UserSignature against a message

SubscriptionService (1 method, server-side streaming)

MethodDescription
SubscribeCheckpointsStreams checkpoints in order, starting from the latest executed checkpoint as seen by the server. Server-side streaming RPC — not WebSocket

Support

For technical support and questions:

See Also