<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-whatsapp-signal-sign-messages-using-x25519-keys-demystifying-xeddsa--9hymyod1t" -->

---
title: How WhatsApp & Signal Sign Messages Using X25519 Keys...
description: XEdDSA is the mechanism that lets Signal and WhatsApp reuse a single X25519 key pair for both Diffie-Hellman key exchange and digital signatures, avoiding the...
canonical: https://daily.dev/posts/how-whatsapp-signal-sign-messages-using-x25519-keys-demystifying-xeddsa--9hymyod1t
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How WhatsApp & Signal Sign Messages Using X25519 Keys (Demystifying XEdDSA) | daily.dev
og:description: XEdDSA is the mechanism that lets Signal and WhatsApp reuse a single X25519 key pair for both Diffie-Hellman key exchange and digital signatures, avoiding the...
og:url: https://daily.dev/posts/how-whatsapp-signal-sign-messages-using-x25519-keys-demystifying-xeddsa--9hymyod1t
og:image: https://api.daily.dev/og/posts/9hymYOD1T.png
og:image:alt: How WhatsApp & Signal Sign Messages Using X25519 Keys (Demystifying XEdDSA)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How WhatsApp & Signal Sign Messages Using X25519 Keys (Demystifying XEdDSA)

**[Awesome Elixir](https://daily.dev/sources/awelix)** · 4 min read · 0 upvotes · 0 comments

## Summary

XEdDSA is the mechanism that lets Signal and WhatsApp reuse a single X25519 key pair for both Diffie-Hellman key exchange and digital signatures, avoiding the need for separate X25519 and Ed25519 keys. The technique converts the Montgomery-form X25519 public key into Edwards-form using birational equivalence (y = (u-1)/(u+1) mod p), forcing the sign bit to zero to resolve ambiguity, then verifies signatures with the standard EdDSA equation. The piece walks through the math, the verification flow, an Elixir implementation using Erlang's :crypto module, and a note on using libsodium's native conversion function for production performance.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://dev.to/matheuscamarques/how-whatsapp-signal-sign-messages-using-x25519-keys-demystifying-xeddsa-963>

## Questions this post answers

### How do Signal and WhatsApp use the same X25519 key for both key exchange and signing?

They use XEdDSA, a scheme designed by Trevor Perrin for the Signal Foundation that converts a Montgomery-form X25519 public key into Edwards-form before signing or verifying, instead of requiring a separate Ed25519 key pair. This avoids managing two key pairs per device while still allowing standard EdDSA-style signature verification.

_daily.dev surfaces protocol-level cryptography deep dives for engineers building secure messaging systems._

### How do you convert an X25519 public key to an Ed25519 public key mathematically?

Given the Montgomery u-coordinate of an X25519 key, the corresponding Edwards y-coordinate is computed as y = (u - 1) / (u + 1) mod p, where p = 2^255 - 19. Because the u-coordinate discards the sign of v, the conversion has a sign ambiguity, which XEdDSA resolves by always forcing the sign bit of the resulting public key to 0.

_Developers porting Signal-compatible clients track cryptographic implementation details like this via daily.dev._

### How do you verify an XEd25519 signature step by step?

Recover public key A by converting the 32-byte X25519 u-coordinate to the Edwards y-coordinate and clearing the sign bit; unpack the 64-byte signature into R (32-byte ephemeral point) and s (32-byte scalar); compute the challenge hash h = SHA-512(R || A || M) mod L; then verify that s*B = R + h*A holds.

_daily.dev helps engineers implementing signature verification logic stay grounded in the exact math._

## Similar posts on daily.dev

- [lib25519: Ed CLI](https://daily.dev/posts/lib25519-ed-cli-swnxoj8wn) · Hacker News · 0 upvotes · 0 comments
- [WhatsApp is untrustable](https://daily.dev/posts/whatsapp-is-untrustable-emzf0q7cv) · Lobsters · 1 upvotes · 0 comments
- [We found cryptography bugs in the elliptic library using Wycheproof](https://daily.dev/posts/we-found-cryptography-bugs-in-the-elliptic-library-using-wycheproof-togrvgscx) · Hacker News · 1 upvotes · 0 comments
- [Elliptic Curves introduction](https://daily.dev/posts/elliptic-curves-introduction-4dbqwnl32) · A Day in the Life Of · 0 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#elixir](https://daily.dev/tags/elixir), [#cryptography](https://daily.dev/tags/cryptography)

[View this post on daily.dev](https://daily.dev/posts/how-whatsapp-signal-sign-messages-using-x25519-keys-demystifying-xeddsa--9hymyod1t)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How WhatsApp \u0026 Signal Sign Messages Using X25519 Keys (Demystifying XEdDSA)","url":"https://daily.dev/posts/how-whatsapp-signal-sign-messages-using-x25519-keys-demystifying-xeddsa--9hymyod1t","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-whatsapp-signal-sign-messages-using-x25519-keys-demystifying-xeddsa--9hymyod1t"},"datePublished":"2026-09-03T20:59:21.734Z","dateModified":"2026-09-04T00:31:59.735Z","description":"XEdDSA is the mechanism that lets Signal and WhatsApp reuse a single X25519 key pair for both Diffie-Hellman key exchange and digital signatures, avoiding the...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8716aa0c5e963bc756aed32b8be2e05e?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8716aa0c5e963bc756aed32b8be2e05e?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Awesome Elixir","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Awesome Elixir","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/85a474f78b1b4d349119f7ce60d1438e","url":"https://daily.dev/sources/awelix"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-whatsapp-signal-sign-messages-using-x25519-keys-demystifying-xeddsa--9hymyod1t","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"security,elixir,cryptography","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Awesome Elixir","item":"https://daily.dev/sources/awelix"},{"@type":"ListItem","position":3,"name":"How WhatsApp \u0026 Signal Sign Messages Using X25519 Keys (Demystifying XEdDSA)"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-whatsapp-signal-sign-messages-using-x25519-keys-demystifying-xeddsa--9hymyod1t#faq","mainEntity":[{"@type":"Question","name":"How do Signal and WhatsApp use the same X25519 key for both key exchange and signing?","acceptedAnswer":{"@type":"Answer","text":"They use XEdDSA, a scheme designed by Trevor Perrin for the Signal Foundation that converts a Montgomery-form X25519 public key into Edwards-form before signing or verifying, instead of requiring a separate Ed25519 key pair. This avoids managing two key pairs per device while still allowing standard EdDSA-style signature verification. daily.dev surfaces protocol-level cryptography deep dives for engineers building secure messaging systems."}},{"@type":"Question","name":"How do you convert an X25519 public key to an Ed25519 public key mathematically?","acceptedAnswer":{"@type":"Answer","text":"Given the Montgomery u-coordinate of an X25519 key, the corresponding Edwards y-coordinate is computed as y = (u - 1) / (u + 1) mod p, where p = 2^255 - 19. Because the u-coordinate discards the sign of v, the conversion has a sign ambiguity, which XEdDSA resolves by always forcing the sign bit of the resulting public key to 0. Developers porting Signal-compatible clients track cryptographic implementation details like this via daily.dev."}},{"@type":"Question","name":"How do you verify an XEd25519 signature step by step?","acceptedAnswer":{"@type":"Answer","text":"Recover public key A by converting the 32-byte X25519 u-coordinate to the Edwards y-coordinate and clearing the sign bit; unpack the 64-byte signature into R (32-byte ephemeral point) and s (32-byte scalar); compute the challenge hash h = SHA-512(R || A || M) mod L; then verify that s*B = R + h*A holds. daily.dev helps engineers implementing signature verification logic stay grounded in the exact math."}}]}
```

