Skip to main content

VerifySignature

gRPC
RPC Methodsui.rpc.v2.SignatureVerificationService/VerifySignature

Verifies a UserSignature against the provided message.

Proto files required

Running the examples below requires the official Sui proto files. Download the proto files, then set the example's -import-path relative to the proto root (the -proto path in the examples is relative to the proto root).

github.com/MystenLabs/sui-apis/tree/main/proto

Request Message
messageobject
The 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.
signatureobject
The signature to verify.
addressstring
Optional. Address to validate against the provided signature. If provided, this address will be compared against the address derived from the signature and a successful response will only be returned if they match.
jwksarray
The set of JWKs to use when verifying Zklogin signatures. If this is empty, the current set of valid JWKs stored on-chain will be used.
Response Message
is_validboolean
Indicates if the provided signature was valid given the requested parameters.
reasonstring
If is_valid is false, this is the reason for why the signature verification failed.
grpcurl
grpcurl \
-import-path . \
-proto sui/rpc/v2/signature_verification_service.proto \
-H 'X-API-KEY: nodit-demo' \
-d '{
"message": {
"name": "PersonalMessage",
"value": "<base64-encoded message bytes>"
},
"signature": {
"bcs": {
"value": "<base64-encoded user signature>"
}
},
"address": "0x0000000000000000000000000000000000000000000000000000000000000001"
}' \
sui-mainnet.nodit.io:443 \
sui.rpc.v2.SignatureVerificationService/VerifySignature