Sign Messages and Transactions
Execute message and transaction signatures for a full-functionality app
With Crossmint’s Smart Wallet SDK, you can enable no-friction signing experiences for your users. This includes:
- Message signatures from as well as
- Gas-less signatures for arbitrary transactions, leveraging Crossmint’s paymaster service
You have full flexibility to customize the UI for signing, to make the make the blockchain as invisible as you’d like.
Sign and Verify Messages
This function allows your users to sign an arbitrary message. Please make sure you have an instantiated Crossmint smart wallet. Check the create wallet page for more info. The createAAWallet
function examples all return an account
, which is what the sample code below is using.
const message = "<message>";
const signature = await account.client.wallet.signMessage(message);
You can then verify that the message was signed by the wallet.
const isVerified = await account.client.public.verifyMessage({
address: account.address,
message,
signature,
});
Sign and Send Transactions
Crossmint provides a function to sign and send transactions, allowing your user to interact with smart contracts in your app. This function allows for arbitrary transaction execution. It’s also gas-less by default, sponsored by Crossmint’s paymaster.
Mint an NFT using Smart Wallet
The Crossmint smart wallet provides a powerful function to make contract calls that handles simulation, sending, and waiting for transaction confirmation into a single function call.
For more granular control, you can use the functions built into viem
.
See the code examples below to understand the two approaches.