Skip to main content
The signData method asks the connected wallet to sign arbitrary off-chain content — recording agreement to terms of service, authorizing an off-chain action — and returns an Ed25519 signature you can verify and store; nothing is sent on-chain. All snippets assume a connected connector — see Connect Wallet.

Payload Types

Three payload models are supported:
Wallets advertise which payload types they support as part of their SignData feature. sign_data() automatically verifies that the connected wallet declares the feature and supports the payload’s type, raising WalletNotSupportFeatureError otherwise.

Requesting a Signature

sign_data(payload) sends the request and returns a request_id immediately; wait_sign_data(request_id) blocks until the wallet responds and returns a (result, error) tuple:
The result fields: Common errors are UserRejectsError and RequestTimeoutError — see Errors. A pending request can be canceled with connector.drop_request(request_id).

Verifying the Signature

Never trust a signature without verifying it. Build a SignDataPayloadDto from the connected account and the result, then run VerifySignData. Any failed check raises nacl.exceptions.BadSignatureError:
Verification performs five cryptographic checks — the full list, and how to verify a signature received from a frontend as a raw dict, is in Backend Verification.

Complete Example

Send Request Examples

Full source code of the sign data flow on GitHub