Offchain Data
On this page, we'll provide an example of how to sign and verify arbitrary data as per the ADR-036 specification on Cosmos.
Sign and verify using a browser wallet like Keplr
(async () => {
const message = "Offline Sign Message Example";
const signer = 'inj1...'
const chainId = 'injective-1'
// Sign Arbitrary Data
const signature = await window.keplr.signArbitrary(chainId, signer, message)
// Verify Arbitrary Data
const result = await window.keplr.verifyArbitrary(chainId, signer, message, signature)
if (result) {
console.log("Signature is valid");
}
})();Sign and verify using PrivateKey in a CLI environment
Last updated
