Rename Eth-DM to Eth-PM
"Direct Message" can lead to confusion with "Direct Connection" that refers to low latency network connections.
|
@ -49,20 +49,20 @@ jobs:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: ./examples/web-chat/build
|
publish_dir: ./examples/web-chat/build
|
||||||
|
|
||||||
- name: "[eth-dm] install using npm i"
|
- name: "[eth-pm] install using npm i"
|
||||||
run: npm install
|
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
|
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
|
uses: peaceiris/actions-gh-pages@v3
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
publish_dir: ./examples/eth-dm/build
|
publish_dir: ./examples/eth-pm/build
|
||||||
destination_dir: eth-dm
|
destination_dir: eth-pm
|
||||||
|
|
||||||
- name: "[eth-pm-wallet] install using npm i"
|
- name: "[eth-pm-wallet] install using npm i"
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
|
@ -12,7 +12,7 @@ jobs:
|
||||||
examples_build_and_test:
|
examples_build_and_test:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
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
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
### Changed
|
### Changed
|
||||||
- Renamed `discover.getStatusFleetNodes` to `discovery.getBootstrapNodes`;
|
- Renamed `discover.getStatusFleetNodes` to `discovery.getBootstrapNodes`;
|
||||||
Changed the API to allow retrieval of bootstrap nodes from other sources.
|
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
|
### Removed
|
||||||
- Examples (cli-chat): The focus of this library is Web environment;
|
- Examples (cli-chat): The focus of this library is Web environment;
|
||||||
|
|
|
@ -6,8 +6,8 @@ import { hexToBuf, equalByteArrays, bufToHex } from 'js-waku/lib/utils';
|
||||||
import * as sigUtil from 'eth-sig-util';
|
import * as sigUtil from 'eth-sig-util';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sign the Eth-DM public key with Web3. This can then be published to let other
|
* Sign the encryption 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
|
* users know to use this encryption public key to encrypt messages for the
|
||||||
* Ethereum Address holder.
|
* Ethereum Address holder.
|
||||||
*/
|
*/
|
||||||
export async function createPublicKeyMessage(
|
export async function createPublicKeyMessage(
|
||||||
|
|
|
@ -11,7 +11,7 @@ const Root = protobuf.Root,
|
||||||
Field = protobuf.Field;
|
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 {
|
export class PublicKeyMessage {
|
||||||
private static Type = new Type('PublicKeyMessage')
|
private static Type = new Type('PublicKeyMessage')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Ethereum Direct Message Web App
|
# Ethereum Private Message Web App
|
||||||
|
|
||||||
**Demonstrates**:
|
**Demonstrates**:
|
||||||
|
|
||||||
|
@ -10,13 +10,13 @@
|
||||||
|
|
||||||
A PoC implementation of [20/ETH-DM](https://rfc.vac.dev/spec/20/).
|
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.
|
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.
|
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:
|
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
|
git clone https://github.com/status-im/js-waku/ ; cd js-waku
|
||||||
npm install # Install dependencies for js-waku
|
npm install # Install dependencies for js-waku
|
||||||
npm run build # Build 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 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
|
||||||
```
|
```
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "eth-dm",
|
"name": "eth-pm",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"name": "eth-dm",
|
"name": "eth-pm",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "/js-waku/eth-dm",
|
"homepage": "/js-waku/eth-pm",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@material-ui/core": "^4.11.4",
|
"@material-ui/core": "^4.11.4",
|
||||||
"@material-ui/icons": "^4.11.2",
|
"@material-ui/icons": "^4.11.2",
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
@ -12,9 +12,7 @@ export interface KeyPair {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use the signature of the Salt ("Salt for eth-dm...") as
|
* Generate new encryption keypair.
|
||||||
* the entropy for the EthCrypto keypair. Note that the entropy is hashed with keccak256
|
|
||||||
* to make the private key.
|
|
||||||
*/
|
*/
|
||||||
export async function generateEncryptionKeyPair(): Promise<KeyPair> {
|
export async function generateEncryptionKeyPair(): Promise<KeyPair> {
|
||||||
const privateKey = generatePrivateKey();
|
const privateKey = generatePrivateKey();
|
||||||
|
@ -23,8 +21,8 @@ export async function generateEncryptionKeyPair(): Promise<KeyPair> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sign the Eth-DM public key with Web3. This can then be published to let other
|
* Sign the encryption 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
|
* users know to use this public key to encrypt messages for the
|
||||||
* Ethereum Address holder.
|
* Ethereum Address holder.
|
||||||
*/
|
*/
|
||||||
export async function createPublicKeyMessage(
|
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
|
* The public key is set in on Object `{ encryptionPublicKey: string; }`, converted
|
||||||
* to JSON and then hashed with Keccak256.
|
* 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.
|
* context.
|
||||||
*/
|
*/
|
||||||
function formatPublicKeyForSignature(encryptionPublicKey: Uint8Array): string {
|
function formatPublicKeyForSignature(encryptionPublicKey: Uint8Array): string {
|
|
@ -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) {
|
async function encryptKey(encryptionKeyPair: KeyPair, password: string) {
|
||||||
const keyMaterial = await getKeyMaterial(password);
|
const keyMaterial = await getKeyMaterial(password);
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
@ -11,7 +11,7 @@ const Root = protobuf.Root,
|
||||||
Field = protobuf.Field;
|
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 {
|
export class PublicKeyMessage {
|
||||||
private static Type = new Type('PublicKeyMessage')
|
private static Type = new Type('PublicKeyMessage')
|
|
@ -5,8 +5,8 @@ import { validatePublicKeyMessage } from './crypto';
|
||||||
import { Message } from './messaging/Messages';
|
import { Message } from './messaging/Messages';
|
||||||
import { bufToHex, equalByteArrays } from 'js-waku/lib/utils';
|
import { bufToHex, equalByteArrays } from 'js-waku/lib/utils';
|
||||||
|
|
||||||
export const PublicKeyContentTopic = '/eth-dm/1/public-key/proto';
|
export const PublicKeyContentTopic = '/eth-pm/1/public-key/proto';
|
||||||
export const DirectMessageContentTopic = '/eth-dm/1/direct-message/proto';
|
export const DirectMessageContentTopic = '/eth-pm/1/direct-message/proto';
|
||||||
|
|
||||||
export async function initWaku(): Promise<Waku> {
|
export async function initWaku(): Promise<Waku> {
|
||||||
const waku = await Waku.create({ bootstrap: true });
|
const waku = await Waku.create({ bootstrap: true });
|
|
@ -3,5 +3,5 @@
|
||||||
Here is the list of the code examples and the features they demonstrate:
|
Here is the list of the code examples and the features they demonstrate:
|
||||||
|
|
||||||
- [Web Chat App](web-chat): Group chat, React/TypeScript, Relay, Store.
|
- [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`.
|
- [Minimal ReactJS Chat App](min-react-js-chat): Group chat, React/JavaScript, Relay, Protobuf using `protons`.
|
||||||
|
|