Skip to Content
WaaP for AppsSign Messages and Data

Sign Messages and Data

WaaP makes it easy to sign messages and data. The SDK abstracts away cryptographic complexity while remaining fully compatible with standard interfaces on each chain.

Sign a Personal Message

personal_sign

Sign an arbitrary message with the user’s WaaP wallet. This is useful for authentication, off-chain actions, or verifying user intent.

All signing methods are available via the WaapProvider object returned by initWaaP() from the @human.tech/waap-sdk package.

import { initWaaP } from "@human.tech/waap-sdk"; initWaaP();
// message example const message = 'Hello World!'; const signature = await window.waap.request({ method: "personal_sign", params: [message, address], });
  • message: The string message to sign.
  • address: The user’s EVM address.

Note: The signature is EIP-191 compliant and can be verified using standard Ethereum libraries.

Demo


Advanced: Typed Data Signing

EVM only — Sui does not have an equivalent to EIP-712 typed data signing.

eth_signTypedData_v4

Sign EIP-712 typed data (structured data) for advanced use cases like DeFi, DAOs, and more.

// typedData example const typedData = { types: { EIP712Domain: [ { name: 'name', type: 'string' }, { name: 'version', type: 'string' }, { name: 'chainId', type: 'uint256' }, { name: 'verifyingContract', type: 'address' } ], Message: [ { name: 'content', type: 'string' }, { name: 'timestamp', type: 'uint256' } ] }, primaryType: 'Message', domain: { name: 'WaaP Demo', version: '1', chainId: 1, verifyingContract: '0x0000000000000000000000000000000000000000' }, message: { content: 'Hello World!', timestamp: Math.floor(Date.now() / 1000) } }; const signature = await window.waap.request({ method: "eth_signTypedData_v4", params: [address, JSON.stringify(typedData)], });
  • address: The user’s address.
  • typedData: The EIP-712 typed data object.

Demo


Security and User Experience

  • User Consent: All signing and transaction actions require explicit user approval via the WaaP modal.
  • No Private Key Exposure: Uses Two-Party Computation (2PC) where the private key is split into shares between the user’s device and the authentication server, ensuring the full private key is never reconstructed or exposed.
  • Multi-Chain: The SDK handles chain switching and ensures transactions are sent to the correct network.
Last updated on