Signing Messages

Once an application is connected to the Elli Wallet via connect method, it can also request that the user signs a given message using window.elli.signMessage().Applications are free to write their own messages which will be displayed to users from within Elli Wallet's signature prompt. Message signatures do not involve network fees and are a convenient way for apps to verify ownership of an address. It takes one parameter listed below:

{
   message: string; // message bytes as an Uint8Array
}

Below is an example code describing the way to sign a message.

const signature = await window.elli.signMessage({
    message: new Uint8Array(Buffer.from('Message to sign', 'utf-8'))
});
console.log(signature)
// messageBytes: "TWVzc2FnZSB0byBzaWdu"
// signature: "ANMdECyd1yA7lK7Mpo7LEh9eYpOMmpF8gAlBOU40y9+a8HYKz81GQ8OGyksGQyQ8GqJAZQL7vp4KeQeNK3zlgwTTnc9S2ydSMONTpeeyJF6DFmV31jIzl3S8mS5P3zDDmQ=="

Last updated