Git Product home page Git Product logo

crypto-com-interview's Introduction

Crypto.com interview (built by react)

The site deployed to AWS S3 + CloudFront for your preview, please check the docs as below:

The libraries are used in this project

bitcoinjs-lib - The javascript implementation of bitcoin library, use for getting derivation path bip39 - The javascript version of bip39, use it for getting the seed from mnemonic words. bip32 - The javascript version of bip32, use it for getting the root key / calculate the extended key (BIP32 priv / pub keys, Account priv / pub keys), and derived addresses.

sjcl - Stanford Javascript Crypto Library, mainly for sha256 hash fastest-levenshtein use for pick the closest word when having a typo in the phrase

react-js - A UI library redux-toolkit - Redux state management for react, redux toolkit is a set of tools which maintains the states better.

What I learnt from this exercise?

The exercise was trying to use a single secret to create any amount of key pairs for transaction. so the steps as follows:

  • Generate an entropy (128 / 256 bits)
  • Convert entropy to seed and also the recover phrase (the words combination) - Proposed in BIP39
  • Convert the seed to HDWallet, HDWallet to generate the individual keys
  • Use the keys to convert to addresses (Propose in BIP32 / BIP44)

The features are implemented in the current codebase.

(Bonus) multi-sig

Apologies for not implement the bonus feature with the limited time, what I learn from the feature is that, without multi-sig, people can use a single key to corresponds with the address, or if you lost the key, you will never get the coins back.

In order to improve the security and prevent a single key lost, P2SH allows multi keys associates with the multisig address, and you need at least n of m keys in order to move the coins.

In bitcoinjs lib, multi-sig has been implemented for my reference.

Is it safe for users to use?

The library is completely runnable without network, doesn't save data in cookies or any tmp storages

Does it follow any practices?

Code implemented in Typescript which check code quality by eslint with typescript recommendation rules.

Are there any test cases coverage?

# Run all test
yarn test

# Check test coverage
yarn coverage

Apologies for not having enough tests as this moment, since I was focus on understand and build the code as good as I can, normally, I will separate the codes in libs folder to an npm package, and have the testing without mixin the front-end logics.

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

yarn test

he graduated from Singapore Management University with Master of Science in Applied Finance, and he strong at golang / node.js as well, please let me know if we try it or not, thanks! Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

Monero 42rn2KSjdpd817HiXzJQX3GuJm9ks2z8SPHrXSdrUvUp7wrPUzS1ykxannPgPiqpUZVdPNzc1WbHCKcsTueBsPFuB4HZhFT

crypto-com-interview's People

Contributors

samson-crypto avatar homywu avatar

Watchers

 avatar

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.