Send encrypted messages through the XRP Ledger using Ed25519/X25519 cryptography.
- Your message is encrypted using the recipient's public key
- The encrypted message is attached to an XRPL transaction as a Memo
- Only the recipient can decrypt it using their private key
-
Install dependencies:
npm install
-
Get a testnet wallet (public address and seed) from the XRPL Faucets.
-
Copy
.env.exampleto.envand fill in your values:cp .env.example .env
-
Edit
.envwith:MY_SEED: Your XRPL wallet seedRECIPIENT_PUBLIC_KEY: The recipient's Ed25519 public key (starts withED)MESSAGE: The message you want to send
- Go to XRPL Testnet Explorer
- Search for the recipient's address
- Look at any transaction they've sent
- Copy the
SigningPubKeyfield (must start withEDfor Ed25519)
Run the script to send an encrypted message:
node index.jsNote: By default, the transaction also sends 10 XRP to the recipient. You can adjust this amount in
index.jsat line 64 by changingAmount: "10000000"(value is in drops, 1 XRP = 1,000,000 drops).
-
Edit
.envwith:MY_SEED: Your XRPL wallet seedSENDER_PUBLIC_KEY: The sender's Ed25519 public key (fromSigningPubKeyin the transaction)MEMO_DATA: TheMemoDatafield from the received transaction
-
Run:
node decypher.js