For the complete documentation index, see llms.txt. This page is also available as Markdown.

SignatureVerificationService/VerifySignature - SUI

Example code for the SignatureVerificationService/VerifySignature gRPC method. Complete guide on how to use SignatureVerificationService/VerifySignature gRPC method in GetBlock Web3 documentation.

Verifies a UserSignature against a message. Sui supports multiple signature schemes including Ed25519, Secp256k1, Secp256r1, and zkLogin signatures (proofs over OAuth credentials). The verifier picks the correct scheme based on the signature bytes.

Service: sui.rpc.v2.SignatureVerificationService Proto file: sui/rpc/v2/signature_verification_service.proto Full method path: sui.rpc.v2.SignatureVerificationService/VerifySignature

Request Fields

Field
Type
Required
Description

message

string (base64)

Yes

Base64-encoded message that was signed

signature

string (base64)

Yes

Base64-encoded signature bytes (includes scheme byte)

address

Address

No

Expected signer address; if provided, verification additionally checks that the signature was produced by this address

Request Example

# Clone the official proto files first (one-time setup):
#   git clone https://github.com/MystenLabs/sui-apis.git && cd sui-apis

grpcurl \
  -import-path proto \
  -proto sui/rpc/v2/signature_verification_service.proto \
  -H "x-grpc-web: 1" \
  -d '{
    "message": "SGVsbG8sIFN1aSE=",
    "signature": "ANQ7+Lr9X4eYRT5/A...",
    "address": "0xb871a42470b59c7184033a688f883cf24eb5e66eae1db62319bab27adb30b873"
}' \
  go.getblock.io:443/<ACCESS-TOKEN> \
  sui.rpc.v2.SignatureVerificationService/VerifySignature
import * 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/signature_verification_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 ServiceClient = proto.sui.rpc.v2.SignatureVerificationService;

const metadata = new grpc.Metadata();
metadata.add('authorization', `Bearer ${ACCESS_TOKEN}`);

const client = new ServiceClient('go.getblock.io:443', grpc.credentials.createSsl());

const request = {
    "message": "SGVsbG8sIFN1aSE=",
    "signature": "ANQ7+Lr9X4eYRT5/A...",
    "address": "0xb871a42470b59c7184033a688f883cf24eb5e66eae1db62319bab27adb30b873"
};

client.VerifySignature(request, metadata, (err: any, response: any) => {
    if (err) {
        console.error('Error:', err);
        return;
    }
    console.log(JSON.stringify(response, null, 2));
});

Response Example

Responses are encoded in Protocol Buffers binary format on the wire. The example below shows the protobuf JSON encoding for readability.

Response Fields

Field
Type
Description

is_valid

bool

true if the signature is valid for the message

signer_address

Address

Address derived from the signature's public key

scheme

string

Signature scheme — ED25519, SECP256K1, SECP256R1, MULTISIG, or ZKLOGIN

Use Cases

  • Off-chain login flows that authenticate users by signature

  • API gateways verifying signed requests without re-implementing Sui's signature schemes

  • zkLogin integrations validating OAuth-backed signatures

Error Handling

gRPC uses status codes rather than JSON-RPC numeric error codes. The most relevant for this method:

Status Code
Numeric
Cause

UNAUTHENTICATED

16

Missing or invalid <ACCESS-TOKEN> in the URL path

INVALID_ARGUMENT

3

Request fields are missing, malformed, or fail validation

UNAVAILABLE

14

Node is overloaded or temporarily unable to handle the request — retry with backoff

DEADLINE_EXCEEDED

4

Request did not complete within the timeout window

RESOURCE_EXHAUSTED

8

Rate limit exceeded for your plan

INVALID_ARGUMENT

3

Malformed message, signature, or address — or signature/address mismatch when address is provided

SDK Integration

Was this helpful?