Skip to content

SignatureVerificationService.VerifySignature ​

Perform signature verification of a UserSignature against the provided message.

Endpoint ​

NetworkHostAuthentication
Mainnetmainnet-grpc.inodra.com:443x-api-key metadata
Testnettestnet-grpc.inodra.com:443x-api-key metadata

Full method name: sui.rpc.v2.SignatureVerificationService/VerifySignature. Unary: one request, one response. Get a key from the dashboard; the same key works on every protocol.

Request: VerifySignatureRequest ​

FieldTypeDescription
messageBcsThe message to verify against. Today the only supported message types are PersonalMessage and TransactionData and the Bcs.name must be set to indicate which type of message is being verified.
signatureUserSignatureThe signature to verify.
addressstringOptional. Address to validate against the provided signature. If provided, this address will be compared against the the address derived from the provide signature and a successful response will only be returned if they match.
jwksrepeated ActiveJwkThe set of JWKs to use when verifying Zklogin signatures. If this is empty the current set of valid JWKs stored onchain will be used
check_address_aliasesboolOptional. If true, address is required and the signature must be from a member of address's current AddressAliases set rather than from address itself. An address with no AddressAliases set is its own only alias. Servers that predate this field ignore it, so clients must check address_aliases_checked in the response.

Response: VerifySignatureResponse ​

FieldTypeDescription
is_validboolIndicates if the provided signature was valid given the requested parameters.
reasonstringIf is_valid is false, this is the reason for why the signature verification failed.
address_aliases_checkedboolSet to true when the server applied check_address_aliases, whether or not the signature is valid. Unset by servers that predate it.

grpcurl ​

bash
grpcurl -H "x-api-key: YOUR_API_KEY" \
  -d '{
  "message": "aGVsbG8=",
  "signature": {
    "bcs": {
      "value": "AA=="
    }
  },
  "address": "0x0000000000000000000000000000000000000000000000000000000000000002",
  "check_address_aliases": true
}' \
  mainnet-grpc.inodra.com:443 \
  sui.rpc.v2.SignatureVerificationService/VerifySignature

Server reflection is enabled, so no proto files are needed for grpcurl. Field masks are written as {"paths": [...]}.

The body is a template: replace the empty BCS bytes with your own values before the call succeeds.

TypeScript ​

typescript
import { GrpcWebFetchTransport, SuiGrpcClient } from '@mysten/sui/grpc'
import { bcs } from '@mysten/sui/bcs'
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519'
import { fromBase64 } from '@mysten/sui/utils'

const transport = new GrpcWebFetchTransport({
  baseUrl: 'https://mainnet-grpc.inodra.com',
  meta: { 'x-api-key': process.env.INODRA_API_KEY! }
})
const client = new SuiGrpcClient({ network: 'mainnet', transport })

const keypair = new Ed25519Keypair()
const message = new TextEncoder().encode('hello')
const { signature } = await keypair.signPersonalMessage(message)

const { response } = await client.signatureVerificationService.verifySignature({
  message: { name: 'PersonalMessage', value: bcs.byteVector().serialize(message).toBytes() },
  signature: { bcs: { value: fromBase64(signature) }, signature: { oneofKind: undefined } },
  address: keypair.toSuiAddress(),
  jwks: []
})
console.log(response.isValid, response.reason)

@mysten/sui v2 has no typed method for this RPC, so the sample calls the generated client.signatureVerificationService service client. Install with npm install @mysten/sui and set INODRA_API_KEY. The gRPC gateway guide covers native gRPC transport for backends.

Credits ​

1 credit per call. See credits and billing for the full table.

The full-stack Sui data layer.