Kibisis Wallet
This guide explains how to integrate Kibisis wallet with Sign-In with Algorand (SIWA) for message signing.
Prerequisites
Install the Kibisis wallet extension on Chrome
Overview
Kibisis wallet uses a direct message signing approach for SIWA messages. Here's how it works:
Inject the Kibisis wallet script
Enable the wallet and get the user's address
Sign the SIWA message using the wallet's
signBytesmethod
Implementation
1. Injecting and Connecting to Kibisis Wallet
To use Kibisis wallet, you need to inject its script and enable it:
2. Signing a SIWA Message
To sign a SIWA message with Kibisis wallet:
Prepare the message by prefixing it with "MX"
Use the
window.algorand.signBytesmethod to sign the message
Here's the code to accomplish this:
Verification
When verifying the SIWA message signature for Kibisis wallet, the process is straightforward as it uses direct message signing. Here's how it works:
The verification function receives the following parameters:
message: The original SIWA messagesignature: The signature in base64 formatprovider: The wallet provider (in this case, "Kibisis")
The verification process for Kibisis wallet:
This verification process ensures that:
The message is properly hashed
The signature is valid for the given message and address
Key points to remember for Kibisis wallet verification:
The message used for verification should be the same as the one used for signing (including the "MX" prefix).
The
algosdk.verifyBytesfunction is used to verify the signature against the hashed message and the signer's address.Any errors during the verification process will result in a
falsereturn value.
Remember to handle any potential errors during the verification process and ensure that all required parameters are provided.
Last updated
