GithubHelp home page GithubHelp logo

nexus's People

Contributors

homura avatar ironlu233 avatar liriu avatar pygman avatar renovate[bot] avatar zhangyouxin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nexus's Issues

[Feature Request] Create an Account Or Import Mnemonics

Create an Account Or Import Mnemonics

Motivation

As a Nexus wallet user, the first thing I want to do is to create/import an account, so that I can get access to other wallet functionalities.

Description

If I was a new ckb user, I would like to create a new account, so I need a "Create Account" button, and the wallet should prompt a list of randomly generated mnemonics.

image

After the user had created an account, the root address should be generated by the key derivation rule.

Or if the user had imported an account, the root address should be generated, and the used addresses should be discovered by a similar rule in bip-44.

Privacy

The mnemonics should be encrypted and stored with web3 secret storage.

Test vectors

//tbd

Find a reliable solution to enable dApps to obtain network

Nexus supports switching networks, but there is no particular way to get a network in a dApp.

We discussed using the chain in get_blockchain_info as a way to get the network, but we need to check if this is a reliable way to do it, or if there is a more reliable way

UI bugs and improvments

Resolve #154

Show password should on import wallet page

image

All "Select User name" typing should replace to "Create Username"

image

In Confirm Seed Page, replace the text to "Please select words in correct order to form your seed"

image

Change the validate password time

Password field should validate on blur

Confirm password field should validate on change

image

empty whitelist list should have min height and placeholder

image

Address on sign transaction is not correspond to DApp's

image

username should less than 12 characters

image

Message bridge for Nexus

Is your feature request related to a problem? Please describe.

The injected CKB Provider will communicate with the Nexus, so a message bridge (wrapper) is required for Nexus. This bridge should

  • webpage <-> content script
  • content script <-> background script
  • background script <-> extension UI, e.g. chrome.window created window, popup.

For the CKB Provider, it may act as an RPC client, so we also need to make the bridge simply adaptable to server-client mode

// perhaps the CKB provider will be like this
await window.ckb.nexus.getUnusedLocks()
await window.ckb.nexus.getCells()

// or act as RPC client
await window.ckb.nexus.request({
  method: 'wallet_getUnusedLocks',
  params: []
})
await window.ckb.nexus.request({
  method: 'wallet_getCells',
  params: []
})

Additional context

webext-bridge looks good, but webext-bridge seems not supported for injected script, maybe we can enhance it

chomex offers server-client functionality, we can also have a look to check if we can implement it based on

Tutorial for Nexus MVP

  • for end-user
    • how to initialize the Nexus
      • create a wallet
      • import a wallet
  • for developer
    • intro full ownership
    • how to communicate with Nexus via the global injected window.ckb
    • how to send a transferring transaction via Nexus
      • off-chain lock
      • live cells
      • sepc256k1.transfer method to createTransactionSkeleton via Lumos
      • signTransaction
      • link to nexus-demo to preview how to work with Nexus

service interface design and organization

For better development and testing, we need to split the Nexusinto several services, such as WalletService, OwnershipService, ConfigServices, etc. which will be described in TypeScript interface.

Services need to call each other, so we need a good practice to organize these services, maybe a dependency injection is required

2023-02-20

Agenda

  • review and update the progress in #77
  • demonstrating E2E for wallet pages
  • demonstrating Nervos Dapp demo dApp

Discussion

Actions

  • [code] unit test for wallet_* RPC scaffolding
  • [code] unit test for wallet_enable RPC
  • [code] implement whitelist & network pages
  • [code] mock a signData & signTransaction RPC for e2e
  • [e2e] signData
  • [e2e] signTransaction
  • [code] implement signData notification service
  • [code] implement signData notification page
  • [code] implement signTransaction notification service
  • [code] implement signTransaction notification page
  • [code] review rule-based ownership service ##76

Other Notes

CKB Wallet Demo dApp

To demonstrate how Nexus works with a dApp, we had plans to create a Nervos DAO dApp demo, however, we found this demo may still be a bit complicated for newcomers, as it requires some knowledge about Nervos DAO, so we're planning to make another demo for CKB wallet.

This demo should have the following features

  • UTxO style wallet - an address is only used once
  • Show the total capacity owned by the current wallet
  • Transfer CKB
  • Receive CKB

2023-02-13

Agenda

  • review and update the progress in #65
  • present the basic UI implementation

Discussion

Actions

  • [code] refine UI implementation
  • [code] implement Create a new wallet and Import a wallet
  • [code] implement KeystoreService.initKeystore for New wallet
  • [code] implement wallet_enable to work with New wallet and initKeystore
  • [code] review and merge #75
  • [code] review and merge #73
  • [code] provide test-data-id in UI for e2e testing
  • [e2e] a list of user stories of ownership
  • [code] Nervos DAO dApp with unlock feature
  • [code] Nervos DAO dApp nickname / connect to wallet / network switch

Continuing

  • [code] implement rule-based ownership service

Other Notes

Documentation for unlocking by another script

Since not all cells can be fully controlled by a single party, a case in point is the name service, which generally has an expiration date and the owner only has control over it for a given duration, we need a document that describes how Nexus works with this scenario

Chrome extension development environment setup

Is your feature request related to a problem? Please describe.

Nexus will be a browser extension, we need to setup a development environment for Nexus

Describe the solution you'd like

  • webpack
  • HMR supported for popup, content script, background script
  • a dead simple example with
    • inject a fake ckb provider API into page
    • call ckb.enable() to show the popup

2023-01-16

Agenda

Discussion

Customizable Nickname

Since the cell model is not bound to a specific address, but to make the UX better, the dApp or Nexus still needs to have an identifier to indicate the user's identity. Therefore, Nexus can provide a way for users to customize their nickname to present user information in a more friendly way

Element Locator for E2E

Actions

  • [UI/UX] remove address from homepage in wireframe
  • [UI/UX] customizable nickname from wireframe
  • [UI/UX] determine width/height for popup and extension page
  • #55
  • [code] support customize nickname
  • [code] review #39
  • [code] review #44
  • #59
  • [e2e] mock unimplemented module, allowing e2e to better start

Other Notes

2023-03-06

Agenda

  • review actions in #80 and #90

Discussion

Actions

  • [code] make dependencies more clear
  • [code] refactor interfaces to make docs can be generated automatically #101
  • [code] make RPC error more friendly
  • [code] make network edtiable
  • #116
  • #117

Continue

  • [code] implement whitelist & network pages - wait for merge
  • [e2e] signTransaction
  • [code] implement signTransaction notification service - wait for merge
  • [code] implement signTransaction notification page - wait for merge
  • [code] continue and finish #89, exposed as RPC methods - wait for merge
  • [code] make the #83 works with testnet
  • [code] make the Nervos DAO dApp works with testnet - wait for review
    • show deposited/withdrawed cells
    • deposit/withdraw/unlock
    • works with Nexus, wallet_enable, getOffChainLocks, getLiveCells, signTransaction
  • [UI/UX] make network edtiable
  • [code] ckb-js/lumos#487
  • [UI/UX] design system for Nexus

Other Notes

2023-01-30

Agenda

  • review and update the progress in #28 #45

Discussion

  • design system is not

Actions

  • [UI/UX] design for initiating wallet base on the wireframe
  • [UI/UX] design popup page base on the wireframe
  • [UI/UX] design notification page for base on the wireframe
  • [review] review #44
  • [review] #56
  • [code] implement a FullOwnershipService
  • [code] NervosDAO dApp with deposit feature on GitHub Page

Other Notes

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency @types/chrome to v0.0.235
  • chore(deps): update dependency lerna to v6.6.2
  • chore(deps): update dependency lint-staged to v13.2.2
  • fix(deps): update dependency eventemitter3 to v5.0.1
  • fix(deps): update dependency zustand to v4.3.8
  • chore(deps): update dependency @auto-it/released to v10.46.0
  • chore(deps): update dependency @auto-it/upload-assets to v10.46.0
  • chore(deps): update dependency eslint to v8.39.0
  • chore(deps): update dependency semver to v7.5.0
  • chore(deps): update dependency ts-jest to v29.1.0
  • chore(deps): update dependency typedoc to v0.24.6
  • chore(deps): update dependency typedoc-plugin-markdown to v3.15.3
  • chore(deps): update dependency webpack to v5.82.0
  • chore(deps): update dependency webpack-dev-server to v4.13.3
  • chore(deps): update typescript-eslint monorepo to v5.59.2 (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • fix(deps): update dependency joi to v17.9.2
  • fix(deps): update dependency json-rpc-2.0 to v1.5.1
  • fix(deps): update dependency react-router-dom to v6.11.1
  • fix(deps): update dependency zod-validation-error to v1.3.0
  • chore(deps): update dependency @svgr/webpack to v7
  • chore(deps): update dependency fork-ts-checker-webpack-plugin to v8
  • chore(deps): update dependency rimraf to v5
  • chore(deps): update dependency typescript to v5
  • fix(deps): update dependency immer to v10
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/actions/install-deps/action.yaml
  • actions/setup-node v3
  • actions/cache v3
.github/workflows/main.yaml
  • actions/checkout v3
  • codecov/codecov-action v3
  • actions/checkout v3
  • actions/checkout v3
npm
e2e/package.json
  • @types/env-paths 2.1.0
  • @types/fs-extra 11.0.1
  • detect-port 1.5.1
  • download 8.0.0
  • fs-extra 11.1.1
  • hpagent 1.2.0
  • lockfile 1.0.4
  • lodash.random 3.2.0
  • nanoid 3.3.6
  • playwright 1.33.0
  • @ckb-lumos/base 0.20.0-alpha.2
  • @ckb-lumos/ckb-indexer 0.20.0-alpha.2
  • @ckb-lumos/config-manager 0.20.0-alpha.2
  • @ckb-lumos/hd 0.20.0-alpha.2
  • @ckb-lumos/helpers 0.20.0-alpha.2
  • @ckb-lumos/rpc 0.20.0-alpha.2
  • @ltd/j-toml 1.38.0
  • @types/detect-port 1.3.2
  • @types/download 8.0.2
  • @types/lockfile 1.0.2
  • @types/lodash.random 3.2.7
package.json
  • @auto-it/core 10.44.0
  • @auto-it/magic-zero 10.43.0
  • @auto-it/npm 10.44.0
  • @auto-it/protected-branch 10.44.0
  • @auto-it/released 10.44.0
  • @auto-it/upload-assets 10.45.0
  • @babel/preset-env 7.20.2
  • @babel/preset-react 7.18.6
  • @babel/preset-typescript 7.18.6
  • @types/jest 29.5.1
  • @types/lodash.times 4.3.7
  • @typescript-eslint/eslint-plugin 5.58.0
  • @typescript-eslint/parser 5.58.0
  • concat-md 0.5.1
  • cross-env 7.0.3
  • eslint 8.38.0
  • eslint-config-react-app 7.0.1
  • eslint-plugin-import 2.27.5
  • husky 8.0.3
  • jest 29.5.0
  • jest-environment-jsdom 29.5.0
  • lerna 6.6.1
  • lint-staged 13.2.1
  • npm-run-all 4.1.5
  • prettier 2.8.8
  • rimraf 4.4.1
  • semver 7.4.0
  • ts-jest 29.0.5
  • ts-node 10.9.1
  • typedoc 0.23.26
  • typedoc-plugin-markdown 3.14.0
  • typescript 4.9.5
  • node >=18.14
  • npm >=9.4
packages/detect-ckb/package.json
packages/extension-chrome/package.json
  • @chakra-ui/anatomy 2.1.2
  • @chakra-ui/icons 2.0.17
  • @chakra-ui/react 2.4.9
  • @chakra-ui/theme-tools 2.0.17
  • @ckb-lumos/base 0.20.0-alpha.2
  • @ckb-lumos/bi 0.20.0-alpha.2
  • @ckb-lumos/codec 0.20.0-alpha.2
  • @ckb-lumos/common-scripts 0.20.0-alpha.2
  • @ckb-lumos/config-manager 0.20.0-alpha.2
  • @ckb-lumos/hd 0.20.0-alpha.2
  • @ckb-lumos/helpers 0.20.0-alpha.2
  • @ckb-lumos/lumos 0.20.0-alpha.2
  • @ckb-lumos/rpc 0.20.0-alpha.2
  • @tanstack/react-query 4.29.1
  • awilix 8.0.1
  • eventemitter3 5.0.0
  • immer 9.0.21
  • is-utf8 0.2.1
  • joi 17.7.1
  • json-rpc-2.0 1.4.2
  • lodash.chunk 4.2.0
  • lodash.isequal 4.5.0
  • lodash.maxby 4.6.0
  • lodash.omit 4.5.0
  • lodash.range 3.2.0
  • lodash.shuffle 4.2.0
  • lodash.times 4.3.2
  • lodash.zip 4.2.0
  • nanoid 3.3.6
  • numeral 2.0.6
  • rc-steps 6.0.0
  • react 18.2.0
  • react-dom 18.2.0
  • react-hook-form 7.43.1
  • react-router-dom 6.10.0
  • react-use 17.4.0
  • retry 0.13.1
  • sanitize.css 13.0.0
  • webext-bridge 6.0.1
  • webextension-polyfill 0.10.0
  • zod 3.21.4
  • zod-validation-error 1.0.1
  • zustand 4.3.7
  • @babel/preset-env 7.21.4
  • @babel/preset-react 7.18.6
  • @babel/preset-typescript 7.21.4
  • @pmmmwh/react-refresh-webpack-plugin 0.5.10
  • @svgr/webpack 6.5.1
  • @types/chrome 0.0.233
  • @types/is-utf8 0.2.1
  • @types/lodash.chunk 4.2.7
  • @types/lodash.isequal 4.5.6
  • @types/lodash.maxby 4.6.7
  • @types/lodash.omit 4.5.7
  • @types/lodash.range 3.2.7
  • @types/lodash.shuffle 4.2.7
  • @types/lodash.zip 4.2.7
  • @types/numeral 2.0.2
  • @types/react 18.0.35
  • @types/react-dom 18.0.11
  • @types/rimraf 3.0.2
  • @types/webextension-polyfill 0.10.0
  • babel-loader 9.1.2
  • bestzip 2.2.1
  • buffer 6.0.3
  • clean-webpack-plugin 4.0.0
  • copy-webpack-plugin 11.0.0
  • crypto-browserify 3.12.0
  • css-loader 6.7.3
  • file-loader 6.2.0
  • fork-ts-checker-webpack-plugin 7.3.0
  • html-loader 4.2.0
  • html-webpack-plugin 5.5.1
  • jest-fetch-mock 3.0.3
  • path-browserify 1.0.1
  • rimraf 4.4.1
  • source-map-loader 4.0.1
  • stream-browserify 3.0.0
  • style-loader 3.3.2
  • terser-webpack-plugin 5.3.7
  • ts-loader 9.4.2
  • ts-node 10.9.1
  • webpack 5.78.0
  • webpack-cli 5.0.1
  • webpack-dev-server 4.11.1
  • webpack-inject-plugin 1.5.5
  • webpack-merge 5.8.0
  • ws 8.13.0
packages/ownership-providers/package.json
  • lodash.range 3.2.0
  • @ckb-lumos/base 0.20.0-alpha.2
  • @ckb-lumos/bi 0.20.0-alpha.2
  • @ckb-lumos/codec 0.20.0-alpha.2
  • @ckb-lumos/common-scripts 0.20.0-alpha.2
  • @ckb-lumos/config-manager 0.20.0-alpha.2
  • @ckb-lumos/helpers 0.20.0-alpha.2
  • @types/lodash.range 3.2.7
  • @ckb-lumos/base 0.20.0-alpha.2
  • @ckb-lumos/bi 0.20.0-alpha.2
  • @ckb-lumos/codec 0.20.0-alpha.2
  • @ckb-lumos/common-scripts 0.20.0-alpha.2
  • @ckb-lumos/config-manager 0.20.0-alpha.2
  • @ckb-lumos/helpers 0.20.0-alpha.2
packages/protocol/package.json
  • @ckb-lumos/base 0.20.0-alpha.2
  • @ckb-lumos/base 0.20.0-alpha.2
packages/testkit/package.json
  • @ckb-lumos/base 0.20.0-alpha.2
  • @ckb-lumos/bi 0.20.0-alpha.2
  • @ckb-lumos/codec 0.20.0-alpha.2
  • @ckb-lumos/helpers 0.20.0-alpha.2
  • eventemitter3 5.0.0
packages/types/package.json
  • @ckb-lumos/codec 0.20.0-alpha.2
  • @ckb-lumos/helpers 0.20.0-alpha.2
  • @ckb-lumos/codec 0.20.0-alpha.2
  • @ckb-lumos/helpers 0.20.0-alpha.2
packages/utils/package.json

  • Check this box to trigger a request for Renovate to run again on this repository

Continuous delivery

Nexus needs a continuous release system. Since Nexus has just developed an MVP, it is foreseeable that we will be collecting feedback from various parties and making modifications.

This continuous release system should be able to meet the following requirements

  • sufficiently automated
  • generate formatted changelogs

2023-01-09

Agenda

  • Discuss MVP target
  • Discuss the Nexus prototype
  • Discuss how to test InjectedCkb

Discussion

  • Chakra UI as UI library

Actions

Other Notes

  • MVP tasks
    • Scaffolding
      • Messaging
        • content script <-> injected script
        • content script <-> background
        • background <-> popup
        • background <-> chrome.windows.create
      • Service Interface
        • WalletService - for ckb.enable
        • KeyingService - managing encrypted mnemonic
        • ConfigService - managing Nexus configuration
        • OwnershipService - support for CkbProvider
        • OwnershipRecoverService - recovering imported exists mnemonic
      • Storage
      • RPC
      • Pages
        • popup - for managing Nexus configuration
        • confirm
          • ckb.enable
          • ownership.signData
          • ownership.signTx
    • UI/UX
    • Implement
      • messaging
      • storage
      • services
      • RPC
      • pages
    • E2E
    • Demo dApp
      • Minimal CKB wallet
        • total CKB (total + occupied)
        • transfer CKB
      • Nervos DAO dApp
        • show deposited CKB
        • deposit
        • withdraw
        • unlock
      • Vote app
        • create/sign proposal (options)
        • create/sign vote
  • Chakra UI Figma Kit
  • chrome.storage.local.get(null, console.log) to fetch all stored data

UTxO pattern designing

Is your feature request related to a problem? Please describe.

As a CKB layer 1 wallet, Nexus needs to be UTxO-friendly, while allowing the dApp to interact with it. This design may require some thought

  • rules for key derivation
  • how dApps interact with the derivation keys
  • trade-off between decentralization, recoverability, flexibility, etc

Nexus needs a design or description for this

Additional context

#4

2023-02-27

Agenda

  • review and update the progress in #80

Discussion

Actions

  • [code] continue and finish #89, exposed as RPC methods
  • [code] make the #83 works with testnet
  • [code] design and implement an event pubsub module to handle events, e.g. networkChanged
  • [code] make the Nervos DAO dApp works with testnet
    • show deposited/withdrawed cells
    • deposit/withdraw/unlock
    • works with Nexus, wallet_enable, getOffChainLocks, getLiveCells, signTransaction
  • [UI/UX] design system for Nexus
  • [UI/UX] make network edtiable
  • [code] review and merge #84
  • [code] ckb-js/lumos#487

Other Notes

Fake refetch logic in backendUtils

const fetchPromise = fetch(url, {
method: 'POST',
body: JSON.stringify(body),
headers: {
'Content-Type': 'application/json',
},
});
const retryRunner = async () => {
const res = await fetchPromise;
// Abort retrying if the resource doesn't exist
if (res.status >= 300) {
/* istanbul ignore next */
throw NexusCommonErrors.RequestCkbFailed(res);
}
return res.json();
};
const retryPromise = pRetry(retryRunner, { retries: options?.maxRetries || 5 });
const res = await pTimeout(retryPromise, {
milliseconds: options?.timeout || 5_000,
});
return res as Promise<JSONRPCResponse | JSONRPCResponse[]>;

2023-02-06

Agenda

  • review and update the progress in #58
  • Nexus does not seem to be a wallet, a different description is needed
  • Demonstrate the Nervos DAO dApp

Discussion

Should we change the description of Nexus?

No, although Nexus in its MVP stage is only acting as a signer, Nexus's positioning is as a wallet, and we will make Nexus a user-friendly wallet, with signer just being its current state

Actions

  • [UI/UX] review design sign transaction notification page
  • [code] review and merge #64
  • [code] implement rule-based ownership service
  • [code] implement UI in pages (no business logic)
  • [code] define internal_X internal methods for extension pages
    • internal_getRequesterAppInfo
    • internal_approvedEnableWallet
    • internal_approvedSignData
    • internal_approvedSignTransaction
  • implement a mock RPC for InjectedCkb
  • [code] Nervos DAO dApp with list/withdraw feature and make it enable to preview online

Other Notes

[UI/UX] `wallet_signData` overflowed

Reproduce

  1. open this link
  2. run ckb.request({method: "wallet_enable"})
  3. run await ckb.request({method:'wallet_fullOwnership_signData', params: { data:'0x68656c6c6f20e4bda0e5a5bd20e38193e38293e381abe381a1e381af20f09f918b' }})

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.