Giter Club home page Giter Club logo

tezori's Introduction

Tezori - A whitelabel wallet framework for Tezos

Node.js CI Dependency Review

Overview

Tezori is a whitelabel wallet framework for the Tezos blockchain.

Most notably, Tezori is used for deploying the Galleon wallet.

The main branch for the third generation of the project is trunk. The current generation is actively under development and therefore at an early stage right now.

For the first generation of the product, see the main branch. For the second generation, see the T2 repo.

Tezori is built using Node.js, React.js and Typescript.

Build and run

This project is meant to be run using Node.js v16.

First, install all dependencies:

npm install

Then, to run the web application, run:

npm run dev

To build a deployable web application, run:

npm run build

To run the app as a native Electron.js application, run:

npm run electron-dev

to build a deployable native application using Electron.js, run:

npm run electron-package

tezori's People

Contributors

amardeepio avatar dependabot[bot] avatar developer0623 avatar mtrager22 avatar nike682631 avatar vishakh avatar

Stargazers

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

Watchers

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

tezori's Issues

As a user, I want to see a total balance for each account

The total balance of all the addresses for an account is displayed next to an Account label. Keep in mind that Tezos balances can have up to 6 decimal places. We are rounding the number to two decimal places and showing that it's approximate by adding "~" in front of the number. On hover, we should display the full balance and a copy button.

image

Design:
https://zpl.io/2EAReXY

Update handling of results for 'send' and 'delegate'

As part of the move to the latest back end Tezos interface, the return types of sendTransactionOperation and sendDelegationOperation() have been rationalized. If there is an error, an explicit Error is thrown. If there is not an error, the operation ID and the results are returned. The operation ID should be shown to the user after a successful operation send in a snackbar. Otherwise, the error should be shown in the snackbar.

As reference, here is the TypeScript definition of the result object:

/**
 * Result of a successfully sent operation
 */
export interface OperationResult {
    results: TezosTypes.AlphaOperationsWithMetadata,
    operationGroupID: String
}

export interface AlphaOperationsWithMetadata {
    contents: AlphaOperationContentsAndResult[],
    signature: string,
    kind: string, //only if error
    id: string, //only if error
    contract: string //only if error
}

export interface AlphaOperationContentsAndResult {
    kind: string,
    metadata: AlphaOperationResult
}

export interface AlphaOperationResult {
    status: string,
    originated_contracts: string[]
    errors: string[]
}

Inputted amounts and addresses should be validated

At the moment, amounts entered for transactions and account creation are not validated. We should ensure only valid numbers conforming to a regular expression are accepted.

Similarly, Tezos addresses ('tz1...' or 'TZ1..') should also be validated with a regular expression to ensure they are of a valid form.

Identities and accounts that cannot be fetched should still show up

When a new identity is imported or created, getAccount() is used to get the details of the identity, specifically its balance. A second call is then made to getAccounts() to get the child accounts of the identity in order to get the addresses and balances of the child accounts. Unfortunately, if an identity (even if valid) has not been activated on the blockchain then getAccount() will fail. In this case, the UI simply doesn't show the identity which might cause panic for users if they think that identity has failed. Instead, when the call fails, we should still show the identity and show the balance as 'Unknown'.

Similar to the above, when a new child account is created using sendOriginationOperation, there is some lag before the account is actually available on the blockchain. Again in this case, the getAccount() for getting the account balance will fail and the new account will not appear on the left. Instead, a fix should be made so that when a new account is created, it is added the list on the left with its balance set to 'Unknown'.

Eventually, when the wallet periodically refreshes its data, the correct balance will show up for all identities and accounts.

Limit account import/creation to only two tabs and fix language and add tooltips

  • Remove mnemonic and key pair tabs from Add an Account screen.
  • Rename "Import Fundraiser" tab to "Import Fundraiser Wallet"
  • Change Import fundraiser instructional text to "Please refer to the PDF document that you created during the Fundraiser."
  • Use proper field labels: 15 Word Secret Key, Fundraiser Password, Fundraiser Email Address, KYC/AML Activation Code.
  • Add tooltips to Fundraiser Password, Fundraiser Email Address, and KYC/AML Activation Code. (text provided below)

Fundraiser Password Tooltip:
This is the password that you used when generating a Tezos paper wallet to participate in the Fundraiser.
Email Tooltip:
This is the email address that you used when generating a Tezos paper wallet to participate in the Fundraiser.
KYC/AML Activation Code Tooltip:
This is the activation code that you received after completing the KYC/AML process. An activation code corresponds to a public key hash and is required if you participated in the Fundraiser. You may complete the process at verification.tezos.com if you have not done so already.

Designs:
https://zpl.io/blpj4o0
https://zpl.io/2ZJDxYE

Do not display passwords as clear text

The 'Create' panel of the wallet app displays the password the user is typing in clear text. This should be masked as stars and the user asked to type the same password twice as a security precaution.

As a user, I want to see human-readable labels for my accounts and addresses.

We will be programmatically generating labels for Accounts, Manager Address, and Smart Addresses.

Account Labels
Account n+1 (n=0) [ first account will be labeled Account 1, second Account 2, and etc.]

Manager Address Label
Each account's identity will be labeled as "Manager Address"

Smart Address Labels
Each "TZ1" Smart Address will be labeled using the same approach as Accounts (Smart Address 1, Smart Address 2, etc).

Labels should be displayed in the sidebar and on each Address detail pane.

image

image

image

Fix imports for Linux builds

As Linux paths are case sensitive, capitalization in the package imports causes missing file errors. Where needed, imports should be changed to lower case.

15-Word Seed Auto complete

Since prototype didn't test any data entry, we should follow best practices for entering seed words:

  1. Provide autocomplete selection for each word to avoid spelling arrows or use of the words that are not on the list
  2. Provide numbering of words so that user can easily cross-reference the entry.

The delegation function should be called when the user tries to delegate their account

On the Delegate tab, the user is able to specify a delegate, hit the update button and then confirm the operation by entering their wallet password. However, this does not actually perform the operation as sendDelegationOperation() is never called. Just as the Send tab calls sendTransactionOperation() to perform the send operation, the Delegate tab should call sendDelegationOperation() to perform the delegation operation.

Key reveal operations should be performed during account origination

When a user decides to create a smart address (child) for a manager address (parent), the wallet code calls sendOriginationOperation() from TezosOperations. However, as smart addresses don't have their own public and private key and rely on the keys of their parents, a key reveal operation must also be performed on the blockchain so the rest of the participants know the public key of the parent of the new child. The new flow for creating a new smart address should be:

  1. Call sendOriginationOperation() from TezosOperations
  2. If the above operation is successful, the returned object will contain a value for originated_contracts. This gives the address of the new child account.
  3. Wait one minute and inform the user during that time that the account is being created
  4. Call sendKeyRevealOperation() from TezosOperations
  5. Show the user the operationGroupID from the result object of both calls.
  6. Add the new child to the list of the parent's children.

Here is an example of a result object returned by TezosOperations showing how the value of originated_contracts can be obtained:

{
   "results":{
      "contents":[
         {
            "kind":"origination",
            "source":"tz1aj32NRPg49jtvSDhkpruQAFevjaewaLew",
            "fee":"1",
            "counter":"102",
            "gas_limit":"120",
            "storage_limit":"0",
            "managerPubkey":"tz1aj32NRPg49jtvSDhkpruQAFevjaewaLew",
            "balance":"100",
            "delegate":"tz1aj32NRPg49jtvSDhkpruQAFevjaewaLew",
            "metadata":{
               "balance_updates":[
                  {
                     "kind":"contract",
                     "contract":"tz1aj32NRPg49jtvSDhkpruQAFevjaewaLew",
                     "change":"-1"
                  }
               ],
               "operation_result":{
                  "status":"applied",
                  "balance_updates":[
                     {
                        "kind":"contract",
                        "contract":"tz1aj32NRPg49jtvSDhkpruQAFevjaewaLew",
                        "change":"-100"
                     },
                     {
                        "kind":"contract",
                        "contract":"TZ1gN9JSgWeGWB47bY8g3K9xQHysTwBrLPy6",
                        "change":"100"
                     }
                  ],
                  "originated_contracts":[
                     "TZ1gN9JSgWeGWB47bY8g3K9xQHysTwBrLPy6"
                  ]
               }
            }
         }
      ],
      "signature":"edsigu34SShkDWpfMeQkBoyiBkFjjFWPCnk6KzeW3gjTFzj2oxrSTiVGT15S1b9xi9gmPycgX1ESYXVf1AtDq6K6Vra5diY1CDb"
   },
   "operationGroupID":"op1.."
}

As a user, I want a clear and secure way of creating and encrypting my wallet file.

The current flow with "select file" could be confusing to the user. We need a different flow that makes it clear that the new file will be generated and what it is for. At the same time, we need to comply with security audit requirements.

We also need to provide messaging around password creation, so that the user is aware of what it is for.

Please use a slug library to ensure that regardless of what the user inputs into "Name Your Wallet File" field we can transform it into a proper file name.

However, if the part where a user names the file and then picks a directory becomes too complicated implementation wise please let me know and we can scale back the design.

Zeplin Designs:
https://app.zeplin.io/project/5b1752dd44fc7a0363cd9dc8/dashboard?seid=5b2c8d534b04d64da0bc8e78

Show tez amounts in tez and not µtez

All tez amounts in the wallet are huge as they are denominated in µtez. Instead, they should be displayed in tez. One tez is one million µtez.

Let's keep amounts to two decimal places rounded up or down with "~" in front in three places:

  • Total Wallet Balance
  • Total Account Balance
  • Address Balance Detail View
    For these three places, on hover, the user should be able to view the full amount in the tooltip and copy the accurate number.

We can display all 6 decimal places for each address in the sidebar as we have plenty of space there.

image

image

Account creation should require a password

When a user tries to send a transaction, they are prompted for the wallet password as a security measure. Howerver, this is not done when they try to create a new child account. This should be fixed and the same security measure should be consistently in place for transactions, account creations and delegations.

Move wallet operations to the latest Tezos RPC interface

The Tezos RPC interface has changed significantly in the last two weeks. Conseil and Conseil.js have already been changed to make them compatible. The wallet must now pull in the right version of the Conseil.js NPM package and correctly invoke the operations.

Update outdated NPM dependencies

The following dependencies are outdated: classnames, eletron-debug, react, react-dom, react-hot-loader, react-router, react-router-reduce, source-map-support (excluding dev dependencies). These should be updated to the latest stable version.

As a first-time user, I want to have a clear understanding that I need to create a wallet first in order to import my fundraiser account.

50% of users still go first to "Open Wallet" when trying to use the wallet first-time to import their fundraiser holdings. This misconception is based on the following:

  1. Tezos fundraiser PDF is a paper wallet (the words wallet are at the top of the PDF) so people think that they already have a wallet.
  2. Users are not accustomed to using desktop wallets and saving their wallets to file.

Inactive fundraiser accounts should be activated

Users go to 'Import from fundraiser' in the 'Add an Address' screen when they want to import tez they received in recognition of their contribution to the Tezos fundraiser. By default, these accounts are in an inactive state and are not usable. They must be explicitly activated to be usable. Unfortunately, the wallet does not yet perform the activation operation.

The current approach is:

  • Call unlockFundraiserIdentity() from TezosWallet
  • Call getAccount() from TezosConseilQuery
  • Call getOperationGroupsForAccount() from TezosConseilQuery
  • Call getAccountsForIdentity() from TezosConseilQuery

The new approach should be:

  • Call unlockFundraiserIdentity() from TezosWallet
  • Call getAccount() from TezosConseilQuery
  • If the getAccount() call returns an error:
    • Call sendIdentityActivationOperation() from TezosOperations using the activation code provided by the user.
    • If the above call is successful, call getAccount again after a one minute delay. During this delay, the user should be explicitly asked to wait for a minute for activation.
    • If the above call is unsuccessful, display the account as 'uninitialized' on the left side of the wallet.
  • Call getOperationGroupsForAccount() from TezosConseilQuery
  • Call getAccountsForIdentity() from TezosConseilQuery

This logic can be tested by getting accounts from https://faucet.tzalpha.net/.

As a user, I want backup verification for my new seed phrase as I create an account.

We need to include backup verification for newly generated seed phrases. We can do by asking the user to type in the n-th word from the seed phrase after it was generated. The number of values for n depends on the level of security we want (2-word minimum and maximum entire phrase).

Let's do 4 words verification.

Design:
https://app.zeplin.io/project/5b1752dd44fc7a0363cd9dc8/dashboard?seid=5b2c9c408eac4a6376e1d194

Fix Redux data model so accounts have non-null keys

At the moment, the public and private keys of child accounts are set to null when operations are initiated. The Redux data model should be changed so child accounts inherit the public and private keys (but not the public key hashes) or their parent identities.

As a user, I want my Manager and Smart addresses to be grouped under an account

We are implementing a new information architecture for displaying what we currently call "addresses" and "accounts". In our new design the terms are reversed:

An account - is a grouping of a single "tz1" address with all "TZ1" addresses it manages

An address - refers to any address in an account.

Manager address - "tz1" address
Smart address - "TZ1" address

Designs:
Version 1: https://app.zeplin.io/project/5b1752dd44fc7a0363cd9dc8?seid=5b286ad46af9a4fe7f6d724a

image

As a user, I want my newly generated seed phrase to be formatted in such a way so it's easy to write down and cross-reference.

Currently, we just show a space-delimited string, but that will cause a lot of mistakes when people will be writing it down. Human eye frequently loses track of the last word. This way the user is prone to miss a word or mix up the order.

We should display the seed phrase in easy to read numbered grid.

  • Display Seed Phrase in a grid
  • Allow the user to generate a different one

Designs:
https://app.zeplin.io/project/5b1752dd44fc7a0363cd9dc8/dashboard?seid=5b2c9c408eac4a6376e1d194

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.