From 88112e062975894c20da965eb55c3ac88839f702 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sat, 19 Aug 2023 19:10:32 -0600 Subject: [PATCH 1/3] add note for deployment --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 78d0d7c..7a84a33 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,9 @@ npm run serve ``` ### Compiles and minifies for production + +If you are deploying in a subdirectory, add it to `publicPath` in vue.config.js, eg: `publicPath: "/app/time-tracker/",` + ``` npm run build ``` From 98c093f655cc532675a320e3d49fd914518b7cb0 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 20 Aug 2023 06:29:29 -0600 Subject: [PATCH 2/3] add potential tasks for multiple derivation paths --- project.task.yaml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/project.task.yaml b/project.task.yaml index d9dc289..e8799f3 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -15,9 +15,9 @@ tasks: - 08 Scan QR code to import into contacts assignee:matthew - SEE: https://github.com/gruhn/vue-qrcode-reader -- Show pop-up or some message confirming that settings & contacts download has been initiated/finished assignee:matthew +- 01 Show pop-up or some message confirming that settings & contacts download has been initiated/finished assignee:matthew -- Ensure each action sent to the server has a confirmation - eg registration (ie a toast something that dismisses after 5-10s) +- 01 Ensure each action sent to the server has a confirmation - eg registration (ie a toast something that dismisses after 5-10s) - SEE: https://github.com/emmanuelsw/notiwind assignee:jose - Home Feed & Quick Give screen : @@ -27,6 +27,7 @@ tasks: - 24 Move to Vite assignee:matthew +- .5 include the hash of the latest commit, and maybe a version - .5 add link to further project / people when a project pays ahead - .5 add project ID to the URL, to make a project publicly-accessible - .5 remove edit from project page for projects owned by others @@ -39,6 +40,14 @@ tasks: - Discuss whether the remaining tasks are worthwhile before MVP release. +- 04 allow user to download claims, mine + ones I can see about me from others +- .5 change the derivation path, and regenerate test IDs +- 02 allow user to create new DIDs from the same seed phrase (ie. increment derivation path) +- .5 on ProjectView page, show immediate feedback when a gift is given (on list?) -- and consider the same for Home & Contacts pages +- .5 customize favicon +- .5 Do we want to combine first name & last name? +- .2 Show a warning if both giver and recipient are the same (but still allow?) + - contacts v+ : - 01 Import all the non-sensitive data (ie. contacts & settings). - .2 show error to user when adding a duplicate contact @@ -51,12 +60,6 @@ tasks: - maybe - allow type annotations in World.js & landmarks.js (since we get this error - "Types are not supported by current JavaScript version") - 08 convert to cleaner implementation (maybe Drie -- https://github.com/janvorisek/drie) -- .5 on ProjectView page, show immediate feedback when a gift is given (on list?) -- and consider the same for Home & Contacts pages -- .5 customize favicon -- 04 allow user to download claims, mine + ones I can see about me from others -- Do we want to combine first name & last name? -- Show a warning if both giver and recipient are the same (but still allow?) - - Release Minimum Viable Product : - 08 thorough testing for errors & edge cases - Turn off stats-world or ensure it's usable (eg. cannot zoom out too far and lose world, cannot screenshot). From 0c05505c461ef281c525e23ef3f1aefd0661fbd2 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sun, 20 Aug 2023 19:46:12 -0600 Subject: [PATCH 3/3] allow use of custom derivation path, and add way to increment derivation for existing --- project.task.yaml | 1 + src/db/index.ts | 4 +- src/libs/crypto/index.ts | 8 +- src/router/index.ts | 8 ++ src/views/ImportAccountView.vue | 35 +++++- src/views/ImportDerivedAccountView.vue | 163 +++++++++++++++++++++++++ src/views/SeedBackupView.vue | 10 ++ src/views/StartView.vue | 28 ++++- 8 files changed, 244 insertions(+), 13 deletions(-) create mode 100644 src/views/ImportDerivedAccountView.vue diff --git a/project.task.yaml b/project.task.yaml index e8799f3..763acca 100644 --- a/project.task.yaml +++ b/project.task.yaml @@ -37,6 +37,7 @@ tasks: - .2 fix rate limit verbiage (with the new one-per-day allowance) assignee:trent - .2 move 'switch identity' to the advanced section - .1 remove the logic to exclude beforeId in list of plans after server has commit 26b25af605e715600d4f12b6416ed9fd7142d164 +- .2 in SeedBackupView, don't load the mnemonic and keep it in memory; only load it when they click "show" - Discuss whether the remaining tasks are worthwhile before MVP release. diff --git a/src/db/index.ts b/src/db/index.ts index 8091e5c..d39ea5e 100644 --- a/src/db/index.ts +++ b/src/db/index.ts @@ -28,12 +28,12 @@ type NonsensitiveTables = { * https://9to5answer.com/how-to-bypass-warning-unexpected-any-specify-a-different-type-typescript-eslint-no-explicit-any */ export type SensitiveDexie = BaseDexie & T; -export const accountsDB = new BaseDexie("KickStartAccounts") as SensitiveDexie; +export const accountsDB = new BaseDexie("TimeSafariAccounts") as SensitiveDexie; const SensitiveSchemas = Object.assign({}, AccountsSchema); export type NonsensitiveDexie = BaseDexie & T; -export const db = new BaseDexie("KickStart") as NonsensitiveDexie; +export const db = new BaseDexie("TimeSafari") as NonsensitiveDexie; const NonsensitiveSchemas = Object.assign({}, ContactsSchema, SettingsSchema); /** diff --git a/src/libs/crypto/index.ts b/src/libs/crypto/index.ts index fb75e20..b3600b4 100644 --- a/src/libs/crypto/index.ts +++ b/src/libs/crypto/index.ts @@ -7,6 +7,8 @@ import { HDNode } from "@ethersproject/hdnode"; import * as didJwt from "did-jwt"; import * as u8a from "uint8arrays"; +export const DEFAULT_ROOT_DERIVATION_PATH = "m/76798669'/0'/0'/0'"; + /** * * @@ -47,17 +49,17 @@ export const newIdentifier = ( */ export const deriveAddress = ( mnemonic: string, + derivationPath: string = DEFAULT_ROOT_DERIVATION_PATH, ): [string, string, string, string] => { - const UPORT_ROOT_DERIVATION_PATH = "m/7696500'/0'/0'/0'"; mnemonic = mnemonic.trim().toLowerCase(); const hdnode: HDNode = HDNode.fromMnemonic(mnemonic); - const rootNode: HDNode = hdnode.derivePath(UPORT_ROOT_DERIVATION_PATH); + const rootNode: HDNode = hdnode.derivePath(derivationPath); const privateHex = rootNode.privateKey.substring(2); // original starts with '0x' const publicHex = rootNode.publicKey.substring(2); // original starts with '0x' const address = rootNode.address; - return [address, privateHex, publicHex, UPORT_ROOT_DERIVATION_PATH]; + return [address, privateHex, publicHex, derivationPath]; }; /** diff --git a/src/router/index.ts b/src/router/index.ts index c524c1b..7ce59c4 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -91,6 +91,14 @@ const routes: Array = [ /* webpackChunkName: "import-account" */ "../views/ImportAccountView.vue" ), }, + { + path: "/import-derive", + name: "import-derive", + component: () => + import( + /* webpackChunkName: "import-derive" */ "../views/ImportDerivedAccountView.vue" + ), + }, { path: "/new-edit-account", name: "new-edit-account", diff --git a/src/views/ImportAccountView.vue b/src/views/ImportAccountView.vue index ae3f0ac..52e9330 100644 --- a/src/views/ImportAccountView.vue +++ b/src/views/ImportAccountView.vue @@ -24,6 +24,24 @@ v-model="mnemonic" /> {{ mnemonic }} +

+ Advanced +

+
+ Enter a custom derivation path + + For previous uPort or Endorser users, + + click here to use that value. + +