From 9692b4af728e77062749efffe7c8ea976cb91cd0 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Tue, 17 Aug 2021 16:01:27 +1000 Subject: [PATCH] Rename Eth-DM to Eth-PM "Direct Message" can lead to confusion with "Direct Connection" that refers to low latency network connections. --- .github/workflows/deploy-gh-pages.yml | 14 +++++++------- .github/workflows/examples-ci.yml | 2 +- CHANGELOG.md | 2 ++ examples/eth-pm-wallet-encryption/src/crypto.ts | 4 ++-- .../src/messaging/wire.ts | 2 +- examples/{eth-dm => eth-pm}/.gitignore | 0 examples/{eth-dm => eth-pm}/README.md | 12 ++++++------ examples/{eth-dm => eth-pm}/package-lock.json | 2 +- examples/{eth-dm => eth-pm}/package.json | 4 ++-- examples/{eth-dm => eth-pm}/public/favicon.ico | Bin examples/{eth-dm => eth-pm}/public/index.html | 0 examples/{eth-dm => eth-pm}/public/logo192.png | Bin examples/{eth-dm => eth-pm}/public/logo512.png | Bin examples/{eth-dm => eth-pm}/public/manifest.json | 0 examples/{eth-dm => eth-pm}/public/robots.txt | 0 examples/{eth-dm => eth-pm}/src/App.css | 0 examples/{eth-dm => eth-pm}/src/App.tsx | 0 .../{eth-dm => eth-pm}/src/BroadcastPublicKey.tsx | 0 examples/{eth-dm => eth-pm}/src/ConnectWallet.tsx | 0 examples/{eth-dm => eth-pm}/src/crypto.ts | 12 +++++------- examples/{eth-dm => eth-pm}/src/index.css | 0 examples/{eth-dm => eth-pm}/src/index.tsx | 0 .../src/key_pair_handling/KeyPairHandling.tsx | 0 .../src/key_pair_handling/LoadKeyPair.tsx | 0 .../src/key_pair_handling/PasswordInput.tsx | 0 .../src/key_pair_handling/SaveKeyPair.tsx | 0 .../src/key_pair_handling/key_pair_storage.ts | 2 +- examples/{eth-dm => eth-pm}/src/logo.svg | 0 .../{eth-dm => eth-pm}/src/messaging/Messages.tsx | 0 .../src/messaging/Messaging.tsx | 0 .../src/messaging/SendMessage.tsx | 0 examples/{eth-dm => eth-pm}/src/messaging/wire.ts | 2 +- .../{eth-dm => eth-pm}/src/react-app-env.d.ts | 0 examples/{eth-dm => eth-pm}/src/setupTests.ts | 0 examples/{eth-dm => eth-pm}/src/waku.ts | 4 ++-- examples/{eth-dm => eth-pm}/tsconfig.json | 0 examples/examples.md | 2 +- 37 files changed, 32 insertions(+), 32 deletions(-) rename examples/{eth-dm => eth-pm}/.gitignore (100%) rename examples/{eth-dm => eth-pm}/README.md (65%) rename examples/{eth-dm => eth-pm}/package-lock.json (99%) rename examples/{eth-dm => eth-pm}/package.json (97%) rename examples/{eth-dm => eth-pm}/public/favicon.ico (100%) rename examples/{eth-dm => eth-pm}/public/index.html (100%) rename examples/{eth-dm => eth-pm}/public/logo192.png (100%) rename examples/{eth-dm => eth-pm}/public/logo512.png (100%) rename examples/{eth-dm => eth-pm}/public/manifest.json (100%) rename examples/{eth-dm => eth-pm}/public/robots.txt (100%) rename examples/{eth-dm => eth-pm}/src/App.css (100%) rename examples/{eth-dm => eth-pm}/src/App.tsx (100%) rename examples/{eth-dm => eth-pm}/src/BroadcastPublicKey.tsx (100%) rename examples/{eth-dm => eth-pm}/src/ConnectWallet.tsx (100%) rename examples/{eth-dm => eth-pm}/src/crypto.ts (83%) rename examples/{eth-dm => eth-pm}/src/index.css (100%) rename examples/{eth-dm => eth-pm}/src/index.tsx (100%) rename examples/{eth-dm => eth-pm}/src/key_pair_handling/KeyPairHandling.tsx (100%) rename examples/{eth-dm => eth-pm}/src/key_pair_handling/LoadKeyPair.tsx (100%) rename examples/{eth-dm => eth-pm}/src/key_pair_handling/PasswordInput.tsx (100%) rename examples/{eth-dm => eth-pm}/src/key_pair_handling/SaveKeyPair.tsx (100%) rename examples/{eth-dm => eth-pm}/src/key_pair_handling/key_pair_storage.ts (98%) rename examples/{eth-dm => eth-pm}/src/logo.svg (100%) rename examples/{eth-dm => eth-pm}/src/messaging/Messages.tsx (100%) rename examples/{eth-dm => eth-pm}/src/messaging/Messaging.tsx (100%) rename examples/{eth-dm => eth-pm}/src/messaging/SendMessage.tsx (100%) rename examples/{eth-dm => eth-pm}/src/messaging/wire.ts (96%) rename examples/{eth-dm => eth-pm}/src/react-app-env.d.ts (100%) rename examples/{eth-dm => eth-pm}/src/setupTests.ts (100%) rename examples/{eth-dm => eth-pm}/src/waku.ts (94%) rename examples/{eth-dm => eth-pm}/tsconfig.json (100%) diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml index bdb7c1b6c8..9fe74f43e2 100644 --- a/.github/workflows/deploy-gh-pages.yml +++ b/.github/workflows/deploy-gh-pages.yml @@ -49,20 +49,20 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./examples/web-chat/build - - name: "[eth-dm] install using npm i" + - name: "[eth-pm] install using npm i" run: npm install - working-directory: examples/eth-dm + working-directory: examples/eth-pm - - name: "[eth-dm] build" + - name: "[eth-pm] build" run: npm run build - working-directory: examples/eth-dm + working-directory: examples/eth-pm - - name: "[eth-dm] Deploy on gh pages to /eth-dm" + - name: "[eth-pm] Deploy on gh pages to /eth-pm" uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./examples/eth-dm/build - destination_dir: eth-dm + publish_dir: ./examples/eth-pm/build + destination_dir: eth-pm - name: "[eth-pm-wallet] install using npm i" run: npm install diff --git a/.github/workflows/examples-ci.yml b/.github/workflows/examples-ci.yml index 330c4f58cd..688ba125b5 100644 --- a/.github/workflows/examples-ci.yml +++ b/.github/workflows/examples-ci.yml @@ -12,7 +12,7 @@ jobs: examples_build_and_test: strategy: matrix: - example: [ web-chat, eth-dm, eth-pm-wallet-encryption, min-react-js-chat, store-reactjs-chat ] + example: [ web-chat, eth-pm, eth-pm-wallet-encryption, min-react-js-chat, store-reactjs-chat ] runs-on: ubuntu-latest steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a2275304b..583fb1f88a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - Renamed `discover.getStatusFleetNodes` to `discovery.getBootstrapNodes`; Changed the API to allow retrieval of bootstrap nodes from other sources. +- Examples: Renamed `eth-dm` to `eth-pm`: "Direct Message" can lead to confusion with "Direct Connection" that + refers to low latency network connections. ### Removed - Examples (cli-chat): The focus of this library is Web environment; diff --git a/examples/eth-pm-wallet-encryption/src/crypto.ts b/examples/eth-pm-wallet-encryption/src/crypto.ts index 6461f48679..1fc360d338 100644 --- a/examples/eth-pm-wallet-encryption/src/crypto.ts +++ b/examples/eth-pm-wallet-encryption/src/crypto.ts @@ -6,8 +6,8 @@ import { hexToBuf, equalByteArrays, bufToHex } from 'js-waku/lib/utils'; import * as sigUtil from 'eth-sig-util'; /** - * Sign the Eth-DM public key with Web3. This can then be published to let other - * users know to use this Eth-DM public key to encrypt messages for the + * Sign the encryption public key with Web3. This can then be published to let other + * users know to use this encryption public key to encrypt messages for the * Ethereum Address holder. */ export async function createPublicKeyMessage( diff --git a/examples/eth-pm-wallet-encryption/src/messaging/wire.ts b/examples/eth-pm-wallet-encryption/src/messaging/wire.ts index 4fa1d65750..bc668c92ab 100644 --- a/examples/eth-pm-wallet-encryption/src/messaging/wire.ts +++ b/examples/eth-pm-wallet-encryption/src/messaging/wire.ts @@ -11,7 +11,7 @@ const Root = protobuf.Root, Field = protobuf.Field; /** - * Message used to communicate the Eth-Dm public key linked to a given Ethereum account + * Message used to communicate the encryption public key linked to a given Ethereum account */ export class PublicKeyMessage { private static Type = new Type('PublicKeyMessage') diff --git a/examples/eth-dm/.gitignore b/examples/eth-pm/.gitignore similarity index 100% rename from examples/eth-dm/.gitignore rename to examples/eth-pm/.gitignore diff --git a/examples/eth-dm/README.md b/examples/eth-pm/README.md similarity index 65% rename from examples/eth-dm/README.md rename to examples/eth-pm/README.md index 1428a1e29e..dfea147fc2 100644 --- a/examples/eth-dm/README.md +++ b/examples/eth-pm/README.md @@ -1,4 +1,4 @@ -# Ethereum Direct Message Web App +# Ethereum Private Message Web App **Demonstrates**: @@ -10,13 +10,13 @@ A PoC implementation of [20/ETH-DM](https://rfc.vac.dev/spec/20/). -Ethereum Direct Message, or Eth-DM, is a protocol that allows sending encrypted message to a recipient, +Ethereum Private Message, or Eth-PM, is a protocol that allows sending encrypted message to a recipient, only knowing their Ethereum Address. -This is protocol has been created to demonstrated how encryption and signature could be added to messages +This protocol has been created to demonstrated how encryption and signature could be added to message sent over the Waku v2 network. -The `main` branch's HEAD is deployed on GitHub Pages at https://status-im.github.io/js-waku/eth-dm/. +The `main` branch's HEAD is deployed on GitHub Pages at https://status-im.github.io/js-waku/eth-pm/. To run a development version locally, do: @@ -24,7 +24,7 @@ To run a development version locally, do: git clone https://github.com/status-im/js-waku/ ; cd js-waku npm install # Install dependencies for js-waku npm run build # Build js-waku -cd examples/eth-dm +cd examples/eth-pm npm install # Install dependencies for the web app -npm run start # Start development server to serve the web app on http://localhost:3000/js-waku/eth-dm +npm run start # Start development server to serve the web app on http://localhost:3000/js-waku/eth-pm ``` diff --git a/examples/eth-dm/package-lock.json b/examples/eth-pm/package-lock.json similarity index 99% rename from examples/eth-dm/package-lock.json rename to examples/eth-pm/package-lock.json index 6517f9b530..79ee13258e 100644 --- a/examples/eth-dm/package-lock.json +++ b/examples/eth-pm/package-lock.json @@ -1,5 +1,5 @@ { - "name": "eth-dm", + "name": "eth-pm", "version": "0.1.0", "lockfileVersion": 2, "requires": true, diff --git a/examples/eth-dm/package.json b/examples/eth-pm/package.json similarity index 97% rename from examples/eth-dm/package.json rename to examples/eth-pm/package.json index 405f819d9d..ee0b1b45a8 100644 --- a/examples/eth-dm/package.json +++ b/examples/eth-pm/package.json @@ -1,8 +1,8 @@ { - "name": "eth-dm", + "name": "eth-pm", "version": "0.1.0", "private": true, - "homepage": "/js-waku/eth-dm", + "homepage": "/js-waku/eth-pm", "dependencies": { "@material-ui/core": "^4.11.4", "@material-ui/icons": "^4.11.2", diff --git a/examples/eth-dm/public/favicon.ico b/examples/eth-pm/public/favicon.ico similarity index 100% rename from examples/eth-dm/public/favicon.ico rename to examples/eth-pm/public/favicon.ico diff --git a/examples/eth-dm/public/index.html b/examples/eth-pm/public/index.html similarity index 100% rename from examples/eth-dm/public/index.html rename to examples/eth-pm/public/index.html diff --git a/examples/eth-dm/public/logo192.png b/examples/eth-pm/public/logo192.png similarity index 100% rename from examples/eth-dm/public/logo192.png rename to examples/eth-pm/public/logo192.png diff --git a/examples/eth-dm/public/logo512.png b/examples/eth-pm/public/logo512.png similarity index 100% rename from examples/eth-dm/public/logo512.png rename to examples/eth-pm/public/logo512.png diff --git a/examples/eth-dm/public/manifest.json b/examples/eth-pm/public/manifest.json similarity index 100% rename from examples/eth-dm/public/manifest.json rename to examples/eth-pm/public/manifest.json diff --git a/examples/eth-dm/public/robots.txt b/examples/eth-pm/public/robots.txt similarity index 100% rename from examples/eth-dm/public/robots.txt rename to examples/eth-pm/public/robots.txt diff --git a/examples/eth-dm/src/App.css b/examples/eth-pm/src/App.css similarity index 100% rename from examples/eth-dm/src/App.css rename to examples/eth-pm/src/App.css diff --git a/examples/eth-dm/src/App.tsx b/examples/eth-pm/src/App.tsx similarity index 100% rename from examples/eth-dm/src/App.tsx rename to examples/eth-pm/src/App.tsx diff --git a/examples/eth-dm/src/BroadcastPublicKey.tsx b/examples/eth-pm/src/BroadcastPublicKey.tsx similarity index 100% rename from examples/eth-dm/src/BroadcastPublicKey.tsx rename to examples/eth-pm/src/BroadcastPublicKey.tsx diff --git a/examples/eth-dm/src/ConnectWallet.tsx b/examples/eth-pm/src/ConnectWallet.tsx similarity index 100% rename from examples/eth-dm/src/ConnectWallet.tsx rename to examples/eth-pm/src/ConnectWallet.tsx diff --git a/examples/eth-dm/src/crypto.ts b/examples/eth-pm/src/crypto.ts similarity index 83% rename from examples/eth-dm/src/crypto.ts rename to examples/eth-pm/src/crypto.ts index aadb189da0..b67df1940d 100644 --- a/examples/eth-dm/src/crypto.ts +++ b/examples/eth-pm/src/crypto.ts @@ -12,9 +12,7 @@ export interface KeyPair { } /** - * Use the signature of the Salt ("Salt for eth-dm...") as - * the entropy for the EthCrypto keypair. Note that the entropy is hashed with keccak256 - * to make the private key. + * Generate new encryption keypair. */ export async function generateEncryptionKeyPair(): Promise { const privateKey = generatePrivateKey(); @@ -23,8 +21,8 @@ export async function generateEncryptionKeyPair(): Promise { } /** - * Sign the Eth-DM public key with Web3. This can then be published to let other - * users know to use this Eth-DM public key to encrypt messages for the + * Sign the encryption public key with Web3. This can then be published to let other + * users know to use this public key to encrypt messages for the * Ethereum Address holder. */ export async function createPublicKeyMessage( @@ -62,10 +60,10 @@ export function validatePublicKeyMessage(msg: PublicKeyMessage): boolean { } /** - * Prepare Eth-Dm Public key to be signed for publication. + * Prepare encryption public key to be signed for publication. * The public key is set in on Object `{ encryptionPublicKey: string; }`, converted * to JSON and then hashed with Keccak256. - * The usage of the object helps ensure the signature is only used in an Eth-DM + * The usage of the object helps ensure the signature is only used in an Eth-PM * context. */ function formatPublicKeyForSignature(encryptionPublicKey: Uint8Array): string { diff --git a/examples/eth-dm/src/index.css b/examples/eth-pm/src/index.css similarity index 100% rename from examples/eth-dm/src/index.css rename to examples/eth-pm/src/index.css diff --git a/examples/eth-dm/src/index.tsx b/examples/eth-pm/src/index.tsx similarity index 100% rename from examples/eth-dm/src/index.tsx rename to examples/eth-pm/src/index.tsx diff --git a/examples/eth-dm/src/key_pair_handling/KeyPairHandling.tsx b/examples/eth-pm/src/key_pair_handling/KeyPairHandling.tsx similarity index 100% rename from examples/eth-dm/src/key_pair_handling/KeyPairHandling.tsx rename to examples/eth-pm/src/key_pair_handling/KeyPairHandling.tsx diff --git a/examples/eth-dm/src/key_pair_handling/LoadKeyPair.tsx b/examples/eth-pm/src/key_pair_handling/LoadKeyPair.tsx similarity index 100% rename from examples/eth-dm/src/key_pair_handling/LoadKeyPair.tsx rename to examples/eth-pm/src/key_pair_handling/LoadKeyPair.tsx diff --git a/examples/eth-dm/src/key_pair_handling/PasswordInput.tsx b/examples/eth-pm/src/key_pair_handling/PasswordInput.tsx similarity index 100% rename from examples/eth-dm/src/key_pair_handling/PasswordInput.tsx rename to examples/eth-pm/src/key_pair_handling/PasswordInput.tsx diff --git a/examples/eth-dm/src/key_pair_handling/SaveKeyPair.tsx b/examples/eth-pm/src/key_pair_handling/SaveKeyPair.tsx similarity index 100% rename from examples/eth-dm/src/key_pair_handling/SaveKeyPair.tsx rename to examples/eth-pm/src/key_pair_handling/SaveKeyPair.tsx diff --git a/examples/eth-dm/src/key_pair_handling/key_pair_storage.ts b/examples/eth-pm/src/key_pair_handling/key_pair_storage.ts similarity index 98% rename from examples/eth-dm/src/key_pair_handling/key_pair_storage.ts rename to examples/eth-pm/src/key_pair_handling/key_pair_storage.ts index 1e52cb2f62..a6a157838e 100644 --- a/examples/eth-dm/src/key_pair_handling/key_pair_storage.ts +++ b/examples/eth-pm/src/key_pair_handling/key_pair_storage.ts @@ -69,7 +69,7 @@ function getWrapKey(keyMaterial: CryptoKey, salt: Uint8Array) { } /** - * Encrypt Eth-DM KeyPair using provided password + * Encrypt encryption KeyPair using provided password. */ async function encryptKey(encryptionKeyPair: KeyPair, password: string) { const keyMaterial = await getKeyMaterial(password); diff --git a/examples/eth-dm/src/logo.svg b/examples/eth-pm/src/logo.svg similarity index 100% rename from examples/eth-dm/src/logo.svg rename to examples/eth-pm/src/logo.svg diff --git a/examples/eth-dm/src/messaging/Messages.tsx b/examples/eth-pm/src/messaging/Messages.tsx similarity index 100% rename from examples/eth-dm/src/messaging/Messages.tsx rename to examples/eth-pm/src/messaging/Messages.tsx diff --git a/examples/eth-dm/src/messaging/Messaging.tsx b/examples/eth-pm/src/messaging/Messaging.tsx similarity index 100% rename from examples/eth-dm/src/messaging/Messaging.tsx rename to examples/eth-pm/src/messaging/Messaging.tsx diff --git a/examples/eth-dm/src/messaging/SendMessage.tsx b/examples/eth-pm/src/messaging/SendMessage.tsx similarity index 100% rename from examples/eth-dm/src/messaging/SendMessage.tsx rename to examples/eth-pm/src/messaging/SendMessage.tsx diff --git a/examples/eth-dm/src/messaging/wire.ts b/examples/eth-pm/src/messaging/wire.ts similarity index 96% rename from examples/eth-dm/src/messaging/wire.ts rename to examples/eth-pm/src/messaging/wire.ts index 4fa1d65750..bc668c92ab 100644 --- a/examples/eth-dm/src/messaging/wire.ts +++ b/examples/eth-pm/src/messaging/wire.ts @@ -11,7 +11,7 @@ const Root = protobuf.Root, Field = protobuf.Field; /** - * Message used to communicate the Eth-Dm public key linked to a given Ethereum account + * Message used to communicate the encryption public key linked to a given Ethereum account */ export class PublicKeyMessage { private static Type = new Type('PublicKeyMessage') diff --git a/examples/eth-dm/src/react-app-env.d.ts b/examples/eth-pm/src/react-app-env.d.ts similarity index 100% rename from examples/eth-dm/src/react-app-env.d.ts rename to examples/eth-pm/src/react-app-env.d.ts diff --git a/examples/eth-dm/src/setupTests.ts b/examples/eth-pm/src/setupTests.ts similarity index 100% rename from examples/eth-dm/src/setupTests.ts rename to examples/eth-pm/src/setupTests.ts diff --git a/examples/eth-dm/src/waku.ts b/examples/eth-pm/src/waku.ts similarity index 94% rename from examples/eth-dm/src/waku.ts rename to examples/eth-pm/src/waku.ts index 83214e1457..539750f1f0 100644 --- a/examples/eth-dm/src/waku.ts +++ b/examples/eth-pm/src/waku.ts @@ -5,8 +5,8 @@ import { validatePublicKeyMessage } from './crypto'; import { Message } from './messaging/Messages'; import { bufToHex, equalByteArrays } from 'js-waku/lib/utils'; -export const PublicKeyContentTopic = '/eth-dm/1/public-key/proto'; -export const DirectMessageContentTopic = '/eth-dm/1/direct-message/proto'; +export const PublicKeyContentTopic = '/eth-pm/1/public-key/proto'; +export const DirectMessageContentTopic = '/eth-pm/1/direct-message/proto'; export async function initWaku(): Promise { const waku = await Waku.create({ bootstrap: true }); diff --git a/examples/eth-dm/tsconfig.json b/examples/eth-pm/tsconfig.json similarity index 100% rename from examples/eth-dm/tsconfig.json rename to examples/eth-pm/tsconfig.json diff --git a/examples/examples.md b/examples/examples.md index 7531852e76..b4136229dd 100644 --- a/examples/examples.md +++ b/examples/examples.md @@ -3,5 +3,5 @@ Here is the list of the code examples and the features they demonstrate: - [Web Chat App](web-chat): Group chat, React/TypeScript, Relay, Store. -- [Ethereum Direct Message Web App](eth-dm): Private Messaging, React/TypeScript, Light Push, Signature with Web3, Asymmetric Encryption. +- [Ethereum Private Message Web App](eth-pm): Private Messaging, React/TypeScript, Light Push, Signature with Web3, Asymmetric Encryption. - [Minimal ReactJS Chat App](min-react-js-chat): Group chat, React/JavaScript, Relay, Protobuf using `protons`.