Sign a message
When a web application is connected to Jelli, it can also request that the user signs a given message. Applications are free to write their own messages which will be displayed to users from within Jelli's signature prompt. Message signatures do not involve network fees and are a convenient way for apps to verify ownership of an address.
π Message Signing Methods
Jelli supports two message signing methods, both 100% compatible with Phantom wallet:
Method 1: Direct signMessage()
signMessage()Signature: signMessage(message: Uint8Array, encoding?: string): Promise<SignedMessage>
const provider = getProvider();
await provider.connect(); // Must connect first
const message = "To avoid digital dognappers, sign below to authenticate with CryptoCorgis";
const encodedMessage = new TextEncoder().encode(message);
try {
const result = await provider.signMessage(encodedMessage, "utf8");
console.log('β
Message signed successfully!');
console.log('Signature:', result.signature); // Uint8Array (64 bytes)
console.log('Public Key:', result.publicKey); // PublicKey object
console.log('Address:', result.publicKey.toString()); // Base58 address
} catch (error) {
console.error('β Signing failed:', error.message);
}Method 2: JSON RPC request()
request()Signature: request(params: { method: string, params: object }): Promise<SignedMessage>
Input Requirements
Message Format: Hex or UTF-8 encoded string as
Uint8ArrayConnection: Wallet must be connected before signing
Encoding: Supports both
"utf8"and"hex"display formats
Return Value Structure
Both methods return the same structure:
β
Signature Verification
Jelli uses Ed25519 signatures compatible with the tweetnacl library (same as Phantom):
Verification Example with Manual Public Key
Sign-In with Solana (SIWS)
Coming soon π
Last updated